apiVersion: apps/v1
kind: Deployment
metadata:
  name: centralledger
  labels:
    app: centralledger
spec:
  replicas: 3
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxSurge: 1 # exeed the replicas by 1 pod
      # maxUnavailable: 25% #25% of pods can be unavailable during an upgrade
  selector:
    matchLabels:
      app: centralledger
  template:
    metadata:
      labels:
        app: centralledger
    spec:
      containers:
      - name: central-ledger
        image: mojaloop/central-ledger:v9.5.0
        env:
          - name: CLEDG_DATABASE__HOST
            value: mysql
          # TODO: replace with file?
          - name: CLEDG_KAFKA__PRODUCER__BULK__PROCESSING__config__rdkafkaConf__metadata.broker.list
            value: kafka:9092
          - name: CLEDG_KAFKA__PRODUCER__TRANSFER__PREPARE__config__rdkafkaConf__metadata.broker.list
            value: kafka:9092
          - name: CLEDG_KAFKA__PRODUCER__TRANSFER__NOTIFICATION__EVENT__config__rdkafkaConf__metadata.broker.list
            value: kafka:9092
          - name: CLEDG_KAFKA__PRODUCER__TRANSFER__ADMIN__TRANSFER__config__rdkafkaConf__metadata.broker.list
            value: kafka:9092
          - name: CLEDG_KAFKA__CONSUMER__BULK__PREPARE__config__rdkafkaConf__metadata.broker.list
            value: kafka:9092
          - name: CLEDG_KAFKA__CONSUMER__TRANSFER__PREPARE__config__rdkafkaConf__metadata.broker.list
            value: kafka:9092
          - name: CLEDG_KAFKA__CONSUMER__ADMIN__TRANSFER__config__rdkafkaConf__metadata.broker.list
            value: kafka:9092
        # command: [ "sh", "-c", "tail -f /dev/null" ]
        # securityContext:
          # runAsUser: 0