apiVersion: apps/v1
kind: Deployment
metadata:
  name: cactus-api
  namespace: cacti
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cactus-api
  template:
    metadata:
      labels:
        app: cactus-api
    spec:
      containers:
      - name: cactus-api
        image: ghcr.io/hyperledger/cactus-cmd-api-server:v2.0.0
        env:
        - name: CACTUS_NODE_ID
          value: cactus-node-1
        - name: CACTUS_LOG_LEVEL
          value: info
        - name: HTTP_PORT
          value: "4000"
        - name: WS_PORT
          value: "4001"
        ports:
        - containerPort: 4000
          name: http
        - containerPort: 4001
          name: ws
        volumeMounts:
        - name: config
          mountPath: /etc/cactus
        resources:
          requests:
            cpu: "1"
            memory: "2Gi"
          limits:
            cpu: "2"
            memory: "4Gi"
        livenessProbe:
          httpGet:
            path: /api/v1/api-server/healthcheck
            port: 4000
          initialDelaySeconds: 60
          periodSeconds: 30
        readinessProbe:
          httpGet:
            path: /api/v1/api-server/healthcheck
            port: 4000
          initialDelaySeconds: 30
          periodSeconds: 10
      volumes:
      - name: config
        configMap:
          name: cactus-config
---
apiVersion: v1
kind: Service
metadata:
  name: cactus-api
  namespace: cacti
spec:
  selector:
    app: cactus-api
  ports:
  - port: 4000
    targetPort: 4000
    name: http
  - port: 4001
    targetPort: 4001
    name: ws
  type: ClusterIP

