apiVersion: apps/v1
kind: Deployment
metadata:
  name: inventory-mysql
  namespace: kafka
spec:
  replicas: 1
  revisionHistoryLimit: 0 
  selector:
    matchLabels:
      app: mysql
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: mysql
    spec:
      tolerations:
      - effect: NoSchedule
        key: dedicated
        value: spot_primary_mumbai
        operator: Equal
      containers:
      - env:
        - name: MYSQL_ROOT_PASSWORD
          value: debezium
        - name: MYSQL_USER
          value: mysqluser
        - name: MYSQL_PASSWORD
          value: mysqlpw
        image: practodev/example-mysql:1.4
        imagePullPolicy: IfNotPresent
        name: mysql
        ports:
        - containerPort: 3306
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /var/lib/mysql
          name: inventory-storage
          subPath: kafka/mysql
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - name: inventory-storage
        persistentVolumeClaim:
          claimName: inventory-mysql-pvc
