apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: kompose convert
    kompose.version: 1.22.0 (955b78124)
  labels:
    io.kompose.service: mysql
  name: mysql
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: mysql
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        kompose.cmd: kompose convert
        kompose.version: 1.22.0 (955b78124)
      labels:
        io.kompose.service: mysql
    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
          ports:
            - containerPort: 3306
          resources: {}
          volumeMounts:
#            挂载数据
            - mountPath: /var/lib/mysql
              name: mysql-claim0
#            挂载配置文件
            - mountPath: /etc/mysql/conf.d/my.cnf
              name: mysql-config
              subPath: my.cnf
#            挂载日志输出目录
            - mountPath: /var/log/mysql
              name: mysql-claim2
      restartPolicy: Always
      volumes:
        - name: mysql-claim0
          persistentVolumeClaim:
            claimName: mysql-claim0
        - name: mysql-config
          configMap:
            name: mysql-config
            items:
              - key: master.cnf
                path: my.cnf
        - name: mysql-claim2
          persistentVolumeClaim:
            claimName: mysql-claim2
##配置App
