apiVersion: apps/v1
kind: Deployment
metadata:
  name: mysql-deploy
  namespace: goms-ek8s
  labels:
    svc: mysql-deploy
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mysql  #选择 pod label
  template:
    metadata:
      labels:
        app: mysql #标注 pod label
    spec:
      containers:
      - name: mysql
        image: mysqltest
        imagePullPolicy: IfNotPresent
        command: ["sh", "/mysql/sqlx/setup.sh"]
        ports:
        - containerPort: 3306
        env:
        - name: MYSQL_ALLOW_EMPTY_PASSWORD 
          value: "yes"
      #   volumeMounts:
      #   - name: mysql-vol-3
      #     mountPath: /var/lib/mysql
      # volumes:
      # - name: mysql-vol
      #   hostPath:
      #     path: /var/lib/mysqlx/vol #宿主机路径
      #     type: Directory