# Can you help me setup pxc cluster on k8s

**URL:** <https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590>\
**Category:** Percona Operator for MySQL\
**Created:** [July 29, 2021, 3:25pm UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590 "2021-07-29T15:25:51Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![thanh](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@thanh](https://forums.percona.com/u/thanh)\
**Post date:** [July 29, 2021, 3:25pm UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/1 "2021-07-29T15:25:52Z")

</div>

Hello, I have 3 nodes with 1 master and 2 worker nodes on k8s.  
I setup by this tutorial [Install Percona XtraDB Cluster using Helm](https://www.percona.com/doc/kubernetes-operator-for-pxc/helm.html)  
with same namespace for pxc-db & operator.  
But I got error. some time:  
pod/my-db-pxc-db-haproxy-0 1/2 CrashLoopBackOff 165 7h54m  
pod/my-db-pxc-db-haproxy-1 1/2 Running 161 7h47m  
pod/my-db-pxc-db-haproxy-2 0/2 Pending 0 7h43m  
and  
pod/my-db-pxc-db-pxc-0 3/3 Running 0 7h54m  
pod/my-db-pxc-db-pxc-1 0/3 Pending 0 7h51m  
can you help me?

 ![error db](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/7/76a8f2892666d85ccb32d75ffee12a0ade5db941.jpeg)

---

<div class="post-metadata">

**Author:** ![Ege\_Gunes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ege_gunes/32/4595_2.png) [@Ege\_Gunes](https://forums.percona.com/u/Ege_Gunes)\
**Post date:** [July 29, 2021, 7:45pm UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/2 "2021-07-29T19:45:15Z")

</div>

Hi @thanh,

Could you please share the haproxy logs from crashed pod?

```auto
kubectl logs my-db-pxc-db-haproxy-0

```

---

<div class="post-metadata">

**Author:** ![thanh](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@thanh](https://forums.percona.com/u/thanh)\
**Post date:** [July 30, 2021, 3:41am UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/3 "2021-07-30T03:41:07Z")

</div>

Here my log:  
kubectl -n pxc logs my-db-pxc-db-haproxy-0  
error: a container name must be specified for pod my-db-pxc-db-haproxy-0, choose one of: [haproxy pxc-monit]

---

<div class="post-metadata">

**Author:** ![Ege\_Gunes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ege_gunes/32/4595_2.png) [@Ege\_Gunes](https://forums.percona.com/u/Ege_Gunes)\
**Post date:** [July 30, 2021, 6:39am UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/4 "2021-07-30T06:39:08Z")

</div>

Please share the output of `kubectl -n pxc logs my-db-pxc-db-haproxy-0 haproxy`

---

<div class="post-metadata">

**Author:** ![thanh](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@thanh](https://forums.percona.com/u/thanh)\
**Post date:** [July 30, 2021, 7:20am UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/5 "2021-07-30T07:20:04Z")

</div>

> [@Ege\_Gunes](#):
>
> ubectl -n pxc logs my-db-pxc-db-haproxy-0 haproxy

Here my logs:

- ‘[’ haproxy = haproxy ‘]’
- ‘[’ ‘!’ -f /etc/haproxy/pxc/haproxy.cfg ‘]’
- custom\_conf=/etc/haproxy-custom/haproxy-global.cfg
- ‘[’ -f /etc/haproxy-custom/haproxy-global.cfg ‘]’
- haproxy\_opt='-W -db ’
- ‘[’ -f /etc/haproxy-custom/haproxy-global.cfg -a -z ‘’ ‘]’
- haproxy\_opt+='-f /etc/haproxy/haproxy-global.cfg ’
- haproxy\_opt+='-f /etc/haproxy/pxc/haproxy.cfg -p /etc/haproxy/pxc/haproxy.pid -S /etc/haproxy/pxc/haproxy-main.sock ’
- exec haproxy -W -db -f /etc/haproxy/haproxy-global.cfg -f /etc/haproxy/pxc/haproxy.cfg -p /etc/haproxy/pxc/haproxy.pid -S /etc/haproxy/pxc/haproxy-main.sock  
[NOTICE] 210/071749 (1) : New worker #1 (9) forked

---

<div class="post-metadata">

**Author:** ![thanh](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@thanh](https://forums.percona.com/u/thanh)\
**Post date:** [July 30, 2021, 8:20am UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/6 "2021-07-30T08:20:36Z")

</div>

and mysql-pxc-db is still pending

pod/mysql-pxc-db-pxc-0 0/3 Pending

---

<div class="post-metadata">

**Author:** ![Slava\_Sarzhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/slava_sarzhan/32/3196_2.png) [@Slava\_Sarzhan](https://forums.percona.com/u/Slava_Sarzhan)\
**Post date:** [August 2, 2021, 8:56am UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/7 "2021-08-02T08:56:47Z")

</div>

@thanh Do you know why it is Pending?  
You need to get more information about it:  
`kubectl describe pods my-db-pxc-db-pxc-1`

Also I can see your haproxy pods can’t connect to ‘pxc-0’. You need to check logs from ‘pxc-0’ pod using the following commands:

```auto
kubectl logs my-db-pxc-db-pxc-0 -c pxc
kubectl logs my-db-pxc-db-pxc-0 -c logs

```

And all logs from haproxy pods:

```auto
kubectl logs my-db-pxc-db-haproxy-0 -c haproxy
kubectl logs my-db-pxc-db-haproxy-0 -c pxc-monit

```

Only after that you will have the whole picture why the cluster can’t start.

---

<div class="post-metadata">

**Author:** ![thanh](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@thanh](https://forums.percona.com/u/thanh)\
**Post date:** [August 4, 2021, 1:59pm UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/8 "2021-08-04T13:59:14Z")

</div>

my error:

Volumes:  
datadir:  
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)  
ClaimName: datadir-cluster1-pxc-0  
ReadOnly: false

Warning FailedScheduling 61s (x5 over 3m40s) default-scheduler 0/4 nodes are available: 4 pod has unbound immediate PersistentVolumeClaims.

persistentvolumeclaim/datadir-cluster1-pxc-0 Pending 6m37s

how to fix this?

---

<div class="post-metadata">

**Author:** ![thanh](https://avatars.discourse-cdn.com/v4/letter/t/c5a1d2/32.png) [@thanh](https://forums.percona.com/u/thanh)\
**Post date:** [August 4, 2021, 2:26pm UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/9 "2021-08-04T14:26:28Z")

</div>

error:

 ![errrr](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/d/d14229e83e7503017f91dae17303046f44f19c88.jpeg)  
[des-cluster1-pxc-0.txt](https://forums.percona.com/uploads/short-url/26krbWx7DfhyrJgzaJYJc0m5JCM.txt) (8.3 KB)

---

<div class="post-metadata">

**Author:** ![iso](https://avatars.discourse-cdn.com/v4/letter/i/46a35a/32.png) [@iso](https://forums.percona.com/u/iso)\
**Post date:** [August 19, 2021, 2:35pm UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/10 "2021-08-19T14:35:00Z")

</div>

@Slava_Sarzhan Same problem using official page instructions → [Install Percona XtraDB Cluster on Kubernetes](https://www.percona.com/doc/kubernetes-operator-for-pxc/kubernetes.html)

Problem is related with waiting pending from PVC , there is no PV error;

Events:  
Type Reason Age From Message

* * *

Normal FailedBinding 34s (x102 over 25m) persistentvolume-controller no persistent volumes available for this claim and no storage class is set

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [August 23, 2021, 8:18am UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/11 "2021-08-23T08:18:37Z")

</div>

@iso  
do you have a storage class?  
Looks like some issue with CSI driver.

---

<div class="post-metadata">

**Author:** ![Slava\_Sarzhan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/slava_sarzhan/32/3196_2.png) [@Slava\_Sarzhan](https://forums.percona.com/u/Slava_Sarzhan)\
**Post date:** [August 25, 2021, 2:01pm UTC](https://forums.percona.com/t/can-you-help-me-setup-pxc-cluster-on-k8s/11590/12 "2021-08-25T14:01:54Z")

</div>

@thanh @iso

If your storage does not support dynamic provisioning of PVs you can use local storage [Local Storage support for the Percona Operator for MySQL](https://www.percona.com/doc/kubernetes-operator-for-pxc/storage.html) feature or you can deploy OpenEBS for these needs. More detailed information you can find on our blogpost: [Deploying Percona Kubernetes Operators with OpenEBS Local Storage - Percona Database Performance Blog](https://www.percona.com/blog/2020/10/01/deploying-percona-kubernetes-operators-with-openebs-local-storage/)
