{"id":22870976,"url":"https://github.com/percona-lab/percona-openshift","last_synced_at":"2025-10-20T04:36:05.596Z","repository":{"id":33649981,"uuid":"131426936","full_name":"Percona-Lab/percona-openshift","owner":"Percona-Lab","description":"Set of scripts to run Percona software in OpenShift / Kubernetes","archived":false,"fork":false,"pushed_at":"2022-08-16T08:51:30.000Z","size":17792,"stargazers_count":54,"open_issues_count":3,"forks_count":39,"subscribers_count":35,"default_branch":"main","last_synced_at":"2025-05-05T22:18:44.687Z","etag":null,"topics":["hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Percona-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-28T16:43:16.000Z","updated_at":"2024-03-21T06:48:06.000Z","dependencies_parsed_at":"2022-09-06T01:40:57.511Z","dependency_job_id":null,"html_url":"https://github.com/Percona-Lab/percona-openshift","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fpercona-openshift","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fpercona-openshift/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fpercona-openshift/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Percona-Lab%2Fpercona-openshift/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Percona-Lab","download_url":"https://codeload.github.com/Percona-Lab/percona-openshift/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252584337,"owners_count":21771945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest"],"created_at":"2024-12-13T13:16:45.857Z","updated_at":"2025-10-20T04:36:05.527Z","avatar_url":"https://github.com/Percona-Lab.png","language":"Shell","readme":"# percona-openshift\nSet of scripts to run Percona software in OpenShift / Kubernetes / Google Cloud Kubernetes Engine\n\n## 🛑🛑🛑 Please consider using [Percona XtraDB Cluster Operator](https://github.com/Percona-Lab/percona-xtradb-cluster-operator)\n\n## Submitting Bug Reports\n\nIf you find a bug in Percona Docker Images or one of the related projects, you should submit a report to that project's [JIRA](https://jira.percona.com) issue tracker.\n\nYour first step should be [to search](https://jira.percona.com/issues/?jql=project%20%3D%20%22Cloud%20Dev%22) 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.\n\nIf there is no existing report, submit a report following these steps:\n\n1. [Sign in to Percona JIRA.](https://jira.percona.com/login.jsp) You will need to create an account if you do not have one.\n2. [Go to the Create Issue screen and select the relevant project.](https://jira.percona.com/secure/CreateIssueDetails!init.jspa?pid=12500\u0026issuetype=1\u0026priority=3)\n3. Fill in the fields of Summary, Description, Steps To Reproduce, and Affects Version to the best you can. If the bug corresponds to a crash, attach the stack trace from the logs.\n\nAn excellent resource is [Elika Etemad's article on filing good bug reports.](http://fantasai.inkedblade.net/style/talks/filing-good-bugs/).\n\nAs a general rule of thumb, please try to create bug reports that are:\n\n- *Reproducible.* Include steps to reproduce the problem.\n- *Specific.* Include as much detail as possible: which version, what environment, etc.\n- *Unique.* Do not duplicate existing tickets.\n- *Scoped to a Single Bug.* One bug per report.\n\n# Helm\nThe best way to deploy the software suite is to use propose Helm charts.\n\n## PMM-Server\nif you plan to use PMM monitoring\n\nTo start pmm-server, from helm/helm-pmm-server execute:\n\n    helm install monitoring ./helm/pmm-server\n\nIt will expose a public IP address for the access\n\n    kubectl get service\n```\nNAME                 TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)        AGE\nmonitoring-service   LoadBalancer   10.31.242.113   35.233.168.128   80:32516/TCP   10m\n```\n\n## Percona XtraDB Cluster\n\nBasic deployment\n\n    helm install --name cluster1 ./helm/helm-server\n\nBy default will deploy proxysql in from of nodes and pmm-client on each node\n\n    kubectl get service\n```\nNAME                  READY     STATUS    RESTARTS   AGE\ncluster1-node-0       2/2       Running   0          5m\ncluster1-node-1       2/2       Running   0          4m\ncluster1-node-2       2/2       Running   0          3m\ncluster1-proxysql-0   2/2       Running   0          5m\nmonitoring-0          1/1       Running   0          1h\n```\n\nConnect to ProxySQL admin:\n    \n    kubectl exec -it cluster1-proxysql-0 -c proxysql -- mysql -h127.0.0.1 -P6032 -uadmin -padmin\n\nConnect to PXC via ProxySQL from a client application:\n\n```\nkubectl run -i --tty percona-client --image=percona:5.7 --restart=Never -- bash -il\nroot@percona-client:/# mysql -hcluster1-proxysql -uroot -psecr3t    \n```\n\n## Master - N Slaves ReplicaSet\n\n### ReplicaSet is currently broken, ProxySQL is not supported ###\n\n     helm install --name rs1 . -f values.yaml  --set kind=replicaset\n\n# Helm with OpenShift\n\nPMM-Server and pmm-clients require to run under user:0 (root), which is complicated in OpenShift.\nSo the proper way to start a helm release is:\n\n    helm install --name dep1 . -f values.yaml  --set pmm.enabled=false,platform=openshift\nOr edit `values.yaml` to change `pmm.enabled` and `platform`\n\n# Backups\n\nTo performa backups you need\n1. Create a persistent backup volume. Adjust the file `backup-volume.yaml` for your needs\n2. Execute a backup job. Example is in `xtrabackup-job.yaml` file, to perform backup run: `kubectl apply -f xtrabackup-job.yaml`\n\n## Restore from backup\nTo start the cluster from the backup\n1. Make sure the cluster is not running\n2. Locate directory you want to restore from on the backup volume, e.g. `cluster1-node-0.cluster1-nodes-2018-06-18-17-26`\n3. Adjust and run backup-restore job https://github.com/Percona-Lab/percona-openshift/blob/master/deploy/xtrabackup-restore-job-pxc.yaml\n\n# Kubernetes deployments (without Helm)\n\n## MySQL Passwords\nBefore deployments you need to create passwords (secrets) which will be used to access Percona Server / Percona XtraDB Cluster.\nWe provide file https://github.com/Percona-Lab/percona-openshift/blob/master/deploy/secret.yaml as an example. **Please use your own secure passwords!**\n\nUse `base64` to encode a password for `secret.yaml` : `echo -n 'securepassword' | base64`.\n\nUsed `base64 -d` to decode a password from `secret.yaml` : `echo YmFja3VwX3Bhc3N3b3Jk | base64 -d`.\n\n\n## Considerations\nThe proposed depoyments were tested on Kubernetes 1.9 / OpenShift Origin 3.9. The earlier versions may not work.\n\nThe deployments assume you have a default `StorageClass` which will provide Persistent Volumes. If not, you need to create `PersistentVolume` manually.\n\n## Deployments\n\n### Percona XtraDB Cluster N nodes\nDeployment `pxc.yaml` will create a StatefulSet with N nodes (defined in `replicas: 3`)\nPay attention to the service name, defined in `name: pxccluster1`\n\nTODO:\n- [ ] Encrypted connections from clients to PXC Nodes\n- [ ] Encrypted connections between PXC Nodes\n\n### ProxySQL service over Percona XtraDB Cluster\n\nDeployment `proxysql-pxc.yaml` will create ProxySQL service and automatically configure to handle a traffic to Percona XtraDB Cluster service.\nThe service to handled is defined in line: `- -service=pxccluster1`\n\nTODO:\n- [ ] Encrypted connections from ProxySQL to PXC Nodes\n\n### A custom MySQL config. \nThe deployments support a custom MySQL config.\nYou can customize `mysql-configmap.yaml` to add any configuration lines you may need.\nNext command will create a ConfigMap: `kubectl create -f mysql-configmap.yaml`. The ConfigMap must be created before any deployments.\n\n### Further work\n- [ ] Provide depoloyments for PMM Server\n- [ ] Configure nodes with PMM Client\n- [ ] Provide a guidance how to create / restore from backups\n\n\n## Cheatsheet\n\nFor OpenShift replace `kubectl` with `oc`\n\n* List available nodes `kubectl get nodes`\n* List running pods `kubectl get pods`\n* Create deployment `kubectl create -f replica-set.yaml`\n* Delete deployment `kubectl delete -f replica-set.yaml`\n* Watch pods changing during deployment `watch kubectl get pods`\n* Diagnostic about a pod, in case of failure `kubectl describe po/rsnode-0`\n* Logs from pods `kubectl logs -f rsnode-0`\n* Logs from the particular container in pod `kubectl logs -f rsnode-1 -c clone-mysql`\n* Access to bash in container ` kubectl exec rsnode-0 -it -- bash`\n* Access to mysql in container `kubectl exec rsnode-0 -it -- mysql -uroot -proot_password`\n* Access to proxysql admin `kubectl exec proxysql-0 -it -- mysql  -uadmin -padmin -h127.0.0.1 -P6032`\n\n### Sysbench\n\nOneliner to prepare sysbench-tpcc database\n\n    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\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona-lab%2Fpercona-openshift","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpercona-lab%2Fpercona-openshift","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpercona-lab%2Fpercona-openshift/lists"}