apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.22.0 (955b78124)
  labels:
    io.kompose.service: mysql-slave2
  name: mysql-slave2
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: mysql-slave2
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.22.0 (955b78124)
      labels:
        io.kompose.service: mysql-slave2
    spec:
      containers:
        - args:
            - mysqld
            - --character-set-server=utf8mb4
            - --collation-server=utf8mb4_unicode_ci
          env:
            - name: MYSQL_ROOT_PASSWORD
              value: root
          image: mysql:latest
          name: mysql-slave2
          ports:
            - containerPort: 3306
          resources: {}
          volumeMounts:
            - mountPath: /var/lib/mysql
              name: mysql-slave2-claim0
            - mountPath: /etc/mysql/conf.d/my.cnf
              name: mysql-config
              subPath: my.cnf
            - mountPath: /var/log/mysql
              name: mysql-slave2-claim2
      initContainers:
        - name: init-mydb1
          image: busybox
          command: ['sh', '-c', 'until nslookup mysql; do echo waiting for mysql; sleep 2; done;']
      restartPolicy: Always
      volumes:
        - name: mysql-slave2-claim0
          persistentVolumeClaim:
            claimName: mysql-slave2-claim0
        - name: mysql-config
          configMap:
            name: mysql-config
            items:
              - key: slave2.cnf
                path: my.cnf
        - name: mysql-slave2-claim2
          persistentVolumeClaim:
            claimName: mysql-slave2-claim2
