title: Scale up mysql with hpa creates an empty database on Kubernetes
body: <p>I have a cluster with MySQL database which is a <strong>StatefulSet</strong>.</p>
  <p>I would like to scale up my database with hpa.</p>
  <p>The problem is that the second database that has been created is <strong>empty</strong>.
  I don't know how to synchronize the second with the first replica.</p>
  <p>Someone told me that I have to create Operators, but I thought that the problem could have been solved with StatefulSets...</p>
  <p>This is mysql statefulset code:</p>
  <pre><code>apiVersion: apps/v1
  kind: StatefulSet
  metadata:
    name: mysql
  spec:
    selector:
      matchLabels:
        app: mysql
    serviceName: mysql
    replicas: 1
    template:
      metadata:
        labels:
          app: mysql
      spec:
        containers:
          - name: mysql
            image: mysql:5.7.21
            imagePullPolicy: Always
            resources:
              requests:
                memory: 50Mi #50
                cpu: 50m
              limits:
                  memory: 500Mi #220?
                  cpu: 400m #65  
            ports:
            - containerPort: 3306
              name: mysql
            volumeMounts:
              - name: mysql-storage
                mountPath: /var/lib/mysql
                subPath: mysql
            env:
              - name: MYSQL_ROOT_PASSWORD
                valueFrom:
                  secretKeyRef:
                    name: mysql-secret # MARK P
                    key: password
              - name: MYSQL_ROOT_HOST
                valueFrom:
                  secretKeyRef:
                    name: mysql-secret # MARK P
                    key: host                  
    volumeClaimTemplates:
      - metadata:
          name: mysql-storage
        spec:
          accessModes:
              - ReadWriteOnce
          storageClassName: standard 
          resources:
              requests:
                  storage: 5Gi
         
  </code></pre>
  <p>Does anyone have any idea?</p>