K8s + cluster-wide + mysql version

Hi Guys,

I have some, pretty simple questions, but I am not sure if I get it right.

I have installed the cluster-wide deployment as per docs here: cluster-wide-docs
The cluster-wide install is done from the branch v1.6.0. All runs fine.

Now I am confused with mysql versions.

I would like to use mysql version 5.7. As per docs this seems to be possible to either deploy one or another (8.0).

I can deploy client version 8.0:

kubectl run -i --rm --tty percona-client --image=percona:8.0 --restart=N│
ever --env="POD_NAMESPACE=<namespace>" -- bash -il

or I can deploy client version 5.7:

kubectl run -i --rm --tty percona-client --image=percona:5.7--restart=N│
ever --env="POD_NAMESPACE=<namespace>" -- bash -il

But as I understand I also have to deploy the cluster with the image of pxc: set to proper version, either:

pxc:
    size: 3
    image: percona/percona-xtradb-cluster:8.0.20-11.1

or:

  pxc:
    size: 3
    image: percona/percona-xtradb-cluster:5.7.31-31.45

Question 1:
Is this all I need to run mysql with proper version (either 8.0 or 5.7)?
Actually it looks like, like the version depends only on the percona-client, not the percona-xtradb-cluster:version. Is this so?

Question 2:
Do I have also to redeploy operator for another version, related to mysql5.7 (but that does not seem necessary). If yes, how do I figure out proper versions?

1 Like

Hi @magic !

For selecting the PXC version few things are important in cr.yaml:

  1. PXC image:
  pxc:
    size: 3
    image: percona/percona-xtradb-cluster:8.0.20-11.2
  1. backup image for 8.0:
  backup:
    image: percona/percona-xtradb-cluster-operator:1.6.0-pxc8.0-backup

and for 5.7:

  backup:
    image: percona/percona-xtradb-cluster-operator:1.6.0-pxc5.7-backup
  1. Disable SmartUpdate (change “apply: recommended” to “apply: disabled”):
  updateStrategy: SmartUpdate
  upgradeOptions:
    versionServiceEndpoint: https://check.percona.com
    apply: disabled

This is doing automatic minor PXC version upgrade (when available), but if you leave it enabled while starting the cluster it will always install latest 8.0 regardless of the images you specified in cr.yaml.

The client you are mentioning is only used to connect to the cluster and I think it should be safe to use even the latest major version (8.0) even for older clusters (eg. 5.7), although best use the same version.

I hope this helps!

2 Likes

Hello @Tomislav_Plavcic

Thank you for reply. That have helped me to figure it out.

For the sake of helping others who might have the same question, the way I’m doing it right now is:

The cr.yaml for mysql 5.7:

  updateStrategy: SmartUpdate
  upgradeOptions:
    versionServiceEndpoint: https://check.percona.com
    apply: disabled
    schedule: "0 4 * * *"
  pxc:
    size: 3
    image: percona/percona-xtradb-cluster:5.7.31-31.45
[..]
  backup:
    image: percona/percona-xtradb-cluster-operator:1.6.0-pxc5.7-backup

The cr.yaml for mysql 8.0:

  updateStrategy: SmartUpdate
  upgradeOptions:
    versionServiceEndpoint: https://check.percona.com
    apply: disabled
    schedule: "0 4 * * *"
  pxc:
    size: 3
    image: percona/percona-xtradb-cluster:8.0.20-11.2
[..]
  backup:
    image: percona/percona-xtradb-cluster-operator:1.6.0-pxc8.0-backup

The percona-client, because it’s backward compatible can run with percona:8.0 image:

kubectl run -i --rm --tty percona-client --image=percona:8.0 --restart=Never --env="POD_NAMESPACE=<namespace>" -- bash -il

This runs a client version:

[mysql@percona-client /]$ mysql -V                                                    
mysql  Ver 8.0.22-13 for Linux on x86_64 (Percona Server (GPL), Release 13, Revision 6f7

But when you log in to the server:

[mysql@percona-client /]$ mysql -h cluster1-haproxy -uroot -p<password>
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 675
Server version: 5.7.31-34-57 Percona XtraDB Cluster (GPL), Release rel34, Revision 7359e4f, WSREP version 31.45, wsrep_31.45

Copyright (c) 2009-2020 Percona LLC and/or its affiliates
Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

The cw-bundle.yaml (cluster-wide deployment), which is responsible for the percona-operator deployed in pxc-operator namespace is running default image version, which is:

    spec:
      serviceAccountName: percona-xtradb-cluster-operator
      containers:
        - name: percona-xtradb-cluster-operator
          image: percona/percona-xtradb-cluster-operator:1.6.0

Hope someone will find those information useful.

Thanks again for help and support.

1 Like