apiVersion: apps/v1
kind: Deployment
metadata:
  name: cactus-besu-connector
  namespace: cacti
spec:
  replicas: 1
  selector:
    matchLabels:
      app: cactus-besu-connector
  template:
    metadata:
      labels:
        app: cactus-besu-connector
    spec:
      containers:
      - name: besu-connector
        image: ghcr.io/hyperledger/cactus-plugin-ledger-connector-besu:v2.0.0
        env:
        - name: BESU_RPC_HTTP
          value: http://besu-rpc-service.besu-network.svc.cluster.local:8545
        - name: BESU_RPC_WS
          value: ws://besu-rpc-service.besu-network.svc.cluster.local:8546
        - name: BESU_CHAIN_ID
          value: "138"
        - name: CACTUS_API_URL
          value: http://cactus-api:4000
        ports:
        - containerPort: 3000
          name: connector
        volumeMounts:
        - name: config
          mountPath: /etc/cactus
        resources:
          requests:
            cpu: "500m"
            memory: "1Gi"
          limits:
            cpu: "1"
            memory: "2Gi"
        livenessProbe:
          httpGet:
            path: /health
            port: 3000
          initialDelaySeconds: 30
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /health
            port: 3000
          initialDelaySeconds: 10
          periodSeconds: 5
      volumes:
      - name: config
        configMap:
          name: cactus-config
---
apiVersion: v1
kind: Service
metadata:
  name: cactus-besu-connector
  namespace: cacti
spec:
  selector:
    app: cactus-besu-connector
  ports:
  - port: 3000
    targetPort: 3000
    name: connector

