# Can't set up 1 node pxc on kubernetes cluster

**URL:** https://forums.percona.com/t/cant-set-up-1-node-pxc-on-kubernetes-cluster/28160
**Category:** Percona XtraDB Cluster 5.x
**Tags:** mysql, percona
**Created:** [February 1, 2024, 2:55am UTC](https://forums.percona.com/t/cant-set-up-1-node-pxc-on-kubernetes-cluster/28160 "2024-02-01T02:55:52Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Tu\_n\_Nguy\_n\_Thuc](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tu_n_nguy_n_thuc/32/10956_2.png) [@Tu\_n\_Nguy\_n\_Thuc](https://forums.percona.com/u/Tu_n_Nguy_n_Thuc)
#### Post date: [February 1, 2024, 2:55am UTC](https://forums.percona.com/t/cant-set-up-1-node-pxc-on-kubernetes-cluster/28160/1 "2024-02-01T02:55:52Z")

</div>

I’m a newbie of percona xtradb cluster. When i set up the size of pxc to 1 to deploy mysql server to kubernetes cluster the result is 3 pxc node. This is my code:

apiVersion: [pxc.percona.com/v1](http://pxc.percona.com/v1)  
kind: PerconaXtraDBCluster  
metadata:  
name: cluster1  
spec:  
crVersion: 1.13.0  
pxc:  
size: 1  
image: perconalab/percona-xtradb-cluster:8.0.32-24.2  
resources:  
requests:  
memory: 500M  
cpu: 300m  
volumeSpec:  
persistentVolumeClaim:  
resources:  
requests:  
storage: 10G

and this is my result:  
cluster1-pxc-0 2/2 Running 0 2d16h  
cluster1-pxc-1 2/2 Running 1 (2d16h ago) 2d16h  
cluster1-pxc-2 2/2 Running 0 2d16h  
Can anyone explain this to me?

---

<div class="post-metadata">

### Author: ![lalit.choudhary](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lalit.choudhary/32/51_2.png) [@lalit.choudhary](https://forums.percona.com/u/lalit.choudhary)
#### Post date: [February 1, 2024, 5:10am UTC](https://forums.percona.com/t/cant-set-up-1-node-pxc-on-kubernetes-cluster/28160/2 "2024-02-01T05:10:08Z")

</div>

Hello @Tu_n_Nguy_n_Thuc  
Is there any specific reason for using a 1 node PXC cluster?

The size of the Percona XtraDB cluster must be 3 or 5 for [High Availability](https://www.percona.com/doc/percona-xtradb-cluster/5.7/intro.html). other values are allowed if the `spec.allowUnsafeConfigurations` key is set to true  
Ref: [Custom Resource options - Percona Operator for MySQL based on Percona XtraDB Cluster](https://docs.percona.com/percona-operator-for-mysql/pxc/operator.html?h=pxc#pxc-section)

**Example:**

```auto
  allowUnsafeConfigurations: true

  pxc:
    size: 1
    image: percona/percona-xtradb-cluster:8.0.32-24.2

```

```auto
kubectl apply -f deploy/cr.yaml -n pxc

$ kubectl get pods -n pxc
NAME READY STATUS RESTARTS AGE
percona-xtradb-cluster-operator-77c67b5dfc-ckjf8 1/1 Running 0 21m
cluster1-pxc-0 3/3 Running 0 56s
cluster1-haproxy-0 2/2 Running 0 21m
cluster1-haproxy-1 2/2 Running 0 18m
cluster1-haproxy-2 2/2 Running 0 17m

```

If you are looking for single primary setup , you might check [Percona Operator for MySQL](https://github.com/percona/percona-server-mysql-operator)  
Note: It is **a tech preview release** and it is **not recommended for production environments**. **As of today, we recommend using** [Percona Operator for MySQL based on Percona XtraDB Cluster](https://www.percona.com/doc/kubernetes-operator-for-pxc/index.html), which is production-ready and contains everything you need to quickly and consistently deploy and scale MySQL clusters in a Kubernetes-based environment, on-premises or in the cloud.

---

<div class="post-metadata">

### Author: ![Tu\_n\_Nguy\_n\_Thuc](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/tu_n_nguy_n_thuc/32/10956_2.png) [@Tu\_n\_Nguy\_n\_Thuc](https://forums.percona.com/u/Tu_n_Nguy_n_Thuc)
#### Post date: [February 1, 2024, 6:16am UTC](https://forums.percona.com/t/cant-set-up-1-node-pxc-on-kubernetes-cluster/28160/3 "2024-02-01T06:16:28Z")

</div>

Thank you for your answer, I have read the document about percona XtraDB cluster and it say that I can create 1 node PXC cluster so I just want to test this case.
