Set of scripts to run Percona software in OpenShift / Kubernetes / Google Cloud Kubernetes Engine
If you find a bug in Percona Docker Images or one of the related projects, you should submit a report to that project's JIRA issue tracker.
Your first step should be to search the existing set of open tickets for a similar report. If you find that someone else has already reported your problem, then you can upvote that report to increase its visibility.
If there is no existing report, submit a report following these steps:
An excellent resource is Elika Etemad's article on filing good bug reports..
As a general rule of thumb, please try to create bug reports that are:
The best way to deploy the software suite is to use propose Helm charts.
if you plan to use PMM monitoring
To start pmm-server, from helm/helm-pmm-server execute:
helm install --name monitoring ./helm/helm-pmm-server
It will expose a public IP address for the access
kubectl get service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
monitoring-service LoadBalancer 10.31.242.113 35.233.168.128 80:32516/TCP 10m
Basic deployment
helm install --name cluster1 ./helm/helm-server
By default will deploy proxysql in from of nodes and pmm-client on each node
kubectl get service
NAME READY STATUS RESTARTS AGE
cluster1-node-0 2/2 Running 0 5m
cluster1-node-1 2/2 Running 0 4m
cluster1-node-2 2/2 Running 0 3m
cluster1-proxysql-0 2/2 Running 0 5m
monitoring-0 1/1 Running 0 1h
Connect to ProxySQL admin:
kubectl exec -it cluster1-proxysql-0 -c proxysql -- mysql -h127.0.0.1 -P6032 -uadmin -padmin
Connect to PXC via ProxySQL from a client application:
kubectl run -i --tty percona-client --image=percona:5.7 --restart=Never -- bash -il
root@percona-client:/# mysql -hcluster1-proxysql -uroot -psecr3t
helm install --name rs1 . -f values.yaml --set kind=replicaset
PMM-Server and pmm-clients require to run under user:0 (root), which is complicated in OpenShift. So the proper way to start a helm release is:
helm install --name dep1 . -f values.yaml --set pmm.enabled=false,platform=openshift
Or edit values.yaml to change pmm.enabled and platform
To performa backups you need
backup-volume.yaml for your needsxtrabackup-job.yaml file, to perform backup run: kubectl apply -f xtrabackup-job.yamlTo start the cluster from the backup
cluster1-node-0.cluster1-nodes-2018-06-18-17-26Before deployments you need to create passwords (secrets) which will be used to access Percona Server / Percona XtraDB Cluster. We provide file https://github.com/Percona-Lab/percona-openshift/blob/master/deploy/secret.yaml as an example. Please use your own secure passwords!
Use base64 to encode a password for secret.yaml : echo -n 'securepassword' | base64.
Used base64 -d to decode a password from secret.yaml : echo YmFja3VwX3Bhc3N3b3Jk | base64 -d.
The proposed depoyments were tested on Kubernetes 1.9 / OpenShift Origin 3.9. The earlier versions may not work.
The deployments assume you have a default StorageClass which will provide Persistent Volumes. If not, you need to create PersistentVolume manually.
Deployment pxc.yaml will create a StatefulSet with N nodes (defined in replicas: 3)
Pay attention to the service name, defined in name: pxccluster1
TODO:
Deployment proxysql-pxc.yaml will create ProxySQL service and automatically configure to handle a traffic to Percona XtraDB Cluster service.
The service to handled is defined in line: - -service=pxccluster1
TODO:
The deployments support a custom MySQL config.
You can customize mysql-configmap.yaml to add any configuration lines you may need.
Next command will create a ConfigMap: kubectl create -f mysql-configmap.yaml. The ConfigMap must be created before any deployments.
For OpenShift replace kubectl with oc
kubectl get nodeskubectl get podskubectl create -f replica-set.yamlkubectl delete -f replica-set.yamlwatch kubectl get podskubectl describe po/rsnode-0kubectl logs -f rsnode-0kubectl logs -f rsnode-1 -c clone-mysql kubectl exec rsnode-0 -it -- bashkubectl exec rsnode-0 -it -- mysql -uroot -proot_passwordkubectl exec proxysql-0 -it -- mysql -uadmin -padmin -h127.0.0.1 -P6032Oneliner to prepare sysbench-tpcc database
kubectl run sysbench1 --image=perconalab/sysbench --restart=Never --env="LUA_PATH=/sysbench/sysbench-tpcc/?.lua" --command -- sysbench-tpcc/tpcc.lua --mysql-host=cluster1-node-0.cluster1-nodes --mysql-user=root --mysql-password=secr3t --scale=10 --mysql-db=sbtest --db-driver=mysql --force-pk=1 prepare
Content type
Image
Digest
Size
123.3 MB
Last updated
over 7 years ago
docker pull perconalab/proxysql-openshift