Percona mysql xtradb helm commands not working

I tried installing mysql percona xtraDB, it installs fine but the output it generates after the helm chat installation to interact with the pods are not working.

Install steps

helm repo add percona https://percona.github.io/percona-helm-charts/
helm repo update
kubectl create ns pxc
 helm install my-op percona/pxc-operator --namespace pxc

helm install my-db percona/pxc-db  --namespace pxc  --set pxc.volumeSpec.resources.requests.storage=20Gi --set pxc.spec.crVersion="1.11.0"

now these create outputs like below

NOTES:
1. To get a MySQL prompt inside your new cluster you can run:

    ROOT_PASSWORD=`kubectl -n pxc get secrets my-db-pxc-db -o jsonpath="{.data.root}" | base64 --decode`
    kubectl -n pxc exec -ti \
      my-db-pxc-db-pxc-0 -- mysql -uroot -p"$ROOT_PASSWORD"

2. To connect an Application running in the same Kubernetes cluster you can connect with:


$ kubectl run -i --tty --rm percona-client --image=percona --restart=Never \
  -- mysql -h my-db-pxc-db-proxysql.pxc.svc.cluster.local -uroot -p"$ROOT_PASSWORD"


Both of the above commands give error

kubectl run -i --tty --rm percona-client --image=percona --restart=Never \
  -- mysql -h my-db-pxc-db-proxysql.pxc.svc.cluster.local -uroot -p"$ROOT_PASSWORD"
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2005 (HY000): Unknown MySQL server host 'my-db-pxc-db-proxysql.pxc.svc.cluster.local' (2)
pod "percona-client" deleted
pod default/percona-client terminated (Error)

above works when I change the -h to my-db-pxc-db-pxc.pxc.svc.cluster.local

another one

ROOT_PASSWORD=`kubectl -n pxc get secrets my-db-pxc-db -o jsonpath="{.data.root}" | base64 --decode`
    kubectl -n pxc exec -ti \                                                      
      my-db-pxc-db-pxc-0 -- mysql -uroot -p"$ROOT_PASSWORD"
Defaulted container "logs" out of: logs, logrotate, pxc, pxc-init (init)
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

above will work if I add -c pxc as the container to log into

So the helm outputs are wrong or is it something I am not doing right ?

My pods looks fine

kubectl get pods -n pxc
NAME                                  READY   STATUS    RESTARTS   AGE
my-op-pxc-operator-58c9bfb678-mbpgn   1/1     Running   0          77m
my-db-pxc-db-pxc-0                    3/3     Running   0          77m
my-db-pxc-db-haproxy-0                2/2     Running   0          77m
my-db-pxc-db-haproxy-1                2/2     Running   0          75m
my-db-pxc-db-haproxy-2                2/2     Running   0          75m
my-db-pxc-db-pxc-1                    3/3     Running   0          75m
my-db-pxc-db-pxc-2                    3/3     Running   0          74m

svc

kubectl get svc -n pxc 
NAME                              TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)                                 AGE
percona-xtradb-cluster-operator   ClusterIP   10.43.44.223   <none>        443/TCP                                 77m
my-db-pxc-db-pxc                  ClusterIP   None           <none>        3306/TCP,33062/TCP,33060/TCP            77m
my-db-pxc-db-pxc-unready          ClusterIP   None           <none>        3306/TCP,33062/TCP,33060/TCP            77m
my-db-pxc-db-haproxy              ClusterIP   10.43.69.102   <none>        3306/TCP,3309/TCP,33062/TCP,33060/TCP   77m
my-db-pxc-db-haproxy-replicas     ClusterIP   10.43.60.195   <none>        3306/TCP                                77m

2 Likes

Hey @Saiyam_Pathak ,

seems like we have not updated the helm chart output after we introduced log containers. We will fix this (PR).
Going with -c pxc looks like a good fix.

Your installation looks fine for me.

3 Likes

Great, nice to know that the installation is one , I will be adding this as a marketplace app to Civo Kubernetes for 1 click install.

1 Like

Hi @spronin what is the flag to provide custom password ?

1 Like

I tried --set pxc.secrets.passwords.root=
but it didnt work

1 Like

Also the above helm chart does not create and PV , and created emptyDIr which is not good, anyway I can get the PV created and that is being used in the statefulsets? Then only its actually usable.

1 Like

Hi @Saiyam_Pathak!
You can specify options for passwords and PVC’s like this:

helm install my-db percona/pxc-db --set secrets.passwords.root=aaa --set pxc.persistence.enabled=true --set pxc.persistence.size=20G

All the options available should be visible here: percona-helm-charts/README.md at main · percona/percona-helm-charts · GitHub

1 Like
helm install my-db percona/pxc-db  --namespace pxc  --set spec.crVersion="1.11.0" --set secrets.passwords.root=$PERCONA_ROOT_PASSWORD --set pxc.persistence.enabled=true --set pxc.persistence.size=$VOLUME_SIZE

this will install percona mysql xtradb one with persistence and custom password

1 Like

Should it be --set spec.crVersion=“1.11.0” or pxc.–set spec.crVersion=“1.11.0” ? @Tomislav_Plavcic

1 Like

@Tomislav_Plavcic I will be proving percona as a marketplace application for our customers to have on their Kubernetes clusters. For the logo what can I use ?


or only the wheel I can use ?

1 Like

Hey @Saiyam_Pathak - feel free to use this one :slight_smile:

1 Like

Guess what
Percona is available to install from civo marketplace on civo kubernetes cluster in 1 click and in 7 minutes everything will. be ready :slight_smile:
image

3 Likes