apiVersion: apps/v1
kind: Deployment
metadata:
  name: checking-account
spec:
  replicas: 3
  selector:
    matchLabels:
      app: checking-account
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate

  template:
    metadata:
      labels:
        app: checking-account
    spec:
      containers:
        - name: checking-account
          image: emmanuelsilva/checking-account:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 8080
          env:
            #kafka configuration
            - name: KAFKA_BOOTSTRAP_SERVERS
              value: kafka.kafka.svc.cluster.local:9092
            # database configuration
            - name: DB_HOST
              value: mysql.mysql.svc.cluster.local
            - name: DB_PORT
              value: "3306"
            - name: DB_USER
              value: root
            - name: DB_PASSWORD
              value: root