Testing Percona Distribution for MySQL Operator Locally with Kind
source link: https://www.percona.com/blog/testing-percona-distribution-for-mysql-operator-locally-with-kind/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
We have a quickstart guide for how to install Percona Distribution for MySQL Operator on minikube. Installing the minimal version works well as it is described in the guide. After that, we will have one HAproxy and one Percona XtraDB Cluster (PXC) node to work with.
Minikube provides Kubernetes locally. One can try using the provided local k8s to try the more advanced scenarios such as the one described here.
Following that guide, everything works well, until we get to the part of deploying a cluster with
Even after that, things seemingly work.
That is until the second pod is getting created. The creation of that pod will be stuck forever in a pending state.
When checking cluster1-pxc-1 pods with
the reason becomes clear.
Anti-affinity rules are specified for different pods in the cluster, which makes sense, normally – one would want to have the different PXC instances in different failure domains, so we can have actual fault tolerance. I could have made this one work by editing the anti-affinity rules in cr.yaml, which would have been suitable for testing purposes, but I was wondering if there is a better way to have a more complicated local k8s setup. Kind can give that, and it’s an ideal playground for following the second guide. Alternatively, the anti-affinity rules can be edited, but I wanted to have an easy test environment for a full setup.
In this example, I am using macOS and DockerDesktop for Mac, kind can be installed via homebrew.
This way I have one control and 3 worker nodes (running kubelet), a redundant control plane is also supported, but not needed for this testing. With this, the cluster can be created.
Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community
Each node will be a docker container.
From this point on, kubectl is configured, and we can follow the second guide for the Percona Distribution for MySQL Operator.
After that, we need to wait for a while for the cluster to come up.
After a few minutes, the cluster will be running as expected.
For that last check, I used the default password from secret.yaml. If you changed that, use the password it’s changed to.
Kind will work on macOS out of the box like this as a simple solution. In order to try Percona software in local playgrounds (on Linux or in a Linux virtual machine), you can also check anydbver, created and maintained by Nickolay Ihalainen.
At the end of the experiments, the kind k8s can be destroyed.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK