<p>I am new to stackoverflow, so pardon if I have not followed all rules for asking this question.</p>
<p>So, I am using this helm chart: <a href="https://github.com/helm/charts/tree/master/stable/mysql" rel="nofollow noreferrer">https://github.com/helm/charts/tree/master/stable/mysql</a> for deploying mysql for our production env. Infact we have this setup in our production running but it creates only 1 pod of mysql whereas I need to run 3 pods. I tried to set the replicas=3 in values.yaml file of the helm chart and redeploy that chart but it is continuously failing with some error, the error being:</p>
<pre><code>Events:
    Type     Reason            Age                    From                  Message
    ----     ------            ----                   ----                  -------
    Warning  FailedScheduling  4m58s                  default-scheduler     pod has unbound immediate PersistentVolumeClaims (repeated 4 times)
    Normal   Scheduled         4m58s                  default-scheduler     Successfully assigned test-helm/cluster-mysql-5bcdf87779-vdb2s to innolx12896
    Normal   Pulled            4m57s                  kubelet, innolx12896  Container image &quot;busybox:1.29.3&quot; already present on machine
    Normal   Created           4m56s                  kubelet, innolx12896  Created container
    Normal   Started           4m56s                  kubelet, innolx12896  Started container
    Warning  BackOff           4m32s (x2 over 4m37s)  kubelet, innolx12896  Back-off restarting failed container
    Normal   Pulled            2m52s (x4 over 4m55s)  kubelet, innolx12896  Container image &quot;mysql:5.7.14&quot; already present on machine
    Normal   Created           2m52s (x4 over 4m55s)  kubelet, innolx12896  Created container
    Warning  Unhealthy         2m52s (x3 over 3m12s)  kubelet, innolx12896  Readiness probe failed: mysqladmin: [Warning] Using a password on the command line interface can be insecure.
                                                                            mysqladmin: connect to server at 'localhost' failed
                                                                            error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
                                                                            Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
    Normal   Killing           2m52s                  kubelet, innolx12896  Killing container with id docker://cluster-mysql:Container failed liveness probe.. Container will be killed and recreated.
    Normal   Started           2m51s (x4 over 4m54s)  kubelet, innolx12896  Started container
    Warning  Unhealthy         2m12s (x4 over 3m42s)  kubelet, innolx12896  Liveness probe failed: mysqladmin: [Warning] Using a password on the command line interface can be insecure.
                                                                            mysqladmin: connect to server at 'localhost' failed
                                                                            error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
                                                                            Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
</code></pre>
<p>Also when I try to see the <strong>mysqld</strong> sock, it is missing. But I don't understand why. Since a single pod deployment works fine but 3 pod deployment produces this error.</p>
<p>Also there might be ways to solve this problem by explicitly defining the paths for the sock which other StackOverflow answers suggest like this answer <a href="https://stackoverflow.com/questions/11990708/error-cant-connect-to-local-mysql-server-through-socket-var-run-mysqld-mysq">1</a>
or this answer <a href="https://stackoverflow.com/questions/5376427/cant-connect-to-local-mysql-server-through-socket-var-mysql-mysql-sock-38">2</a>. But the caveat is we have whole production chart deployment automated through Jenkins and there is no scope of explicitly running those commands for every production release.</p>
<p>So, I need to know how to solve this problem or maybe know what is causing this problem, so that I can change or alter some parameters in the helm chart I mentioned in the beginning. Also tell me if it is not possible to scale this deployment, meaning this helm chart doesn't support or is not meant for multiple mysql pods.</p>
<p>Thanks in advance.</p>

Navin Kumar
<p>It looks like the Readiness probe failed &amp; the Liveness probe is failing in your case. For MySQL, please try with the below (in <code>templates/deployment.yaml</code>) for Readiness &amp; Liveness:</p>
<pre class="lang-yaml prettyprint-override"><code>ports:
  - name: mysql
    containerPort: {{ .Values.service.port }}
    protocol: TCP
livenessProbe:
  exec:
    command: [&quot;mysqladmin&quot;, &quot;ping&quot;]
  initialDelaySeconds: 30
  periodSeconds: 10
  timeoutSeconds: 5
readinessProbe:
  exec:
    # Check we can execute queries over TCP (skip-networking is off).
    command: [&quot;mysql&quot;, &quot;-h&quot;, &quot;127.0.0.1&quot;, &quot;-e&quot;, &quot;SELECT 1&quot;]
  initialDelaySeconds: 5
  periodSeconds: 2
  timeoutSeconds: 1
</code></pre>
