Labeling on HaProxy Service in Percona Operator

Hello,

During MySQL instance deployment from Percona MySql Operator, i noticed something like below -

kubectl describe svc mysql-1314-pxc-db-haproxy -n ns1
Name:                     mysql-1314-pxc-db-haproxy
Namespace:                ns1
Labels:                   app.kubernetes.io/component=haproxy
                          app.kubernetes.io/instance=mysql-1314-pxc-db
                          app.kubernetes.io/managed-by=percona-xtradb-cluster-operator
                          app.kubernetes.io/name=percona-xtradb-cluster
                          app.kubernetes.io/part-of=percona-xtradb-cluster

In my requirement, i need to put some extra label on Haproxy Svc so if i try to label them by some kubectl command then those labels would not persist.
Any idea, how we can put some more labels on these SVC permanently ?

Thanks
Chandra

1 Like

Hi @cmg1986 ,

We know about it and we have added improvement to our operator. Starting from 1.11.0 you will have possibility to add labels on haproxy services.

Please see [K8SPXC-738] Labels are not applied to Service - Percona JIRA

1 Like

@SlavaSarzhan
So as of now, whats fix… as there is no service getting deployed through deploy/cr.yaml then how can we update label for this haproxy svc ?

1 Like

@cmg1986 You will need just to add label into CR e.g. percona-xtradb-cluster-operator/cr.yaml at main · percona/percona-xtradb-cluster-operator · GitHub for HaProxy service and apply it. The services will be updated.

P.S. The code was merged into main branch and you can test it but please note it is not production ready. If you want to use it in production you need to wait for release.

1 Like