apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mysql
spec:
  selector:
    matchLabels:
      app: mysql
  serviceName: "mysql"
  replicas: 1
  template:
    metadata:
      labels:
        app: mysql
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: mysql
        image: 172.16.77.53:30882/mysql:0.0.1
        imagePullPolicy: IfNotPresent
        env:
        - name: MYSQL_ROOT_PASSWORD
          value: "bnsbdlmysql"
        - name: MYSQL_MAX_CONNECTIONS
          value: "10000"
        ports:
        - containerPort: 3306
          name: mysql
        volumeMounts:
        - mountPath: /var/lib/mysql
          name: mysql-masks
        - mountPath: /etc/mysql/conf.d/self.cnf
          name: conf
          subPath: self.cnf
      volumes:
      - name: conf
        configMap:
          name: mysql-config
  volumeClaimTemplates:
  - metadata:
      name: mysql-masks
      annotations:
        volume.beta.kubernetes.io/storage-class: "mysql-masks"
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 5Gi