{"id":13588011,"url":"https://github.com/ScientaNL/k8s-proxysql-cluster","last_synced_at":"2025-04-08T02:34:33.794Z","repository":{"id":43120225,"uuid":"159332407","full_name":"ScientaNL/k8s-proxysql-cluster","owner":"ScientaNL","description":"Kubernetes ProxySQL Cluster","archived":true,"fork":false,"pushed_at":"2023-05-16T08:44:50.000Z","size":134,"stargazers_count":31,"open_issues_count":8,"forks_count":21,"subscribers_count":10,"default_branch":"develop","last_synced_at":"2024-11-06T07:40:06.347Z","etag":null,"topics":["cluster","helm-chart","kubernetes","proxysql"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScientaNL.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-27T12:31:10.000Z","updated_at":"2024-08-19T13:35:44.000Z","dependencies_parsed_at":"2024-11-06T07:33:20.139Z","dependency_job_id":"bd0f9b8f-5880-45d2-87ca-cab124882dc5","html_url":"https://github.com/ScientaNL/k8s-proxysql-cluster","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScientaNL%2Fk8s-proxysql-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScientaNL%2Fk8s-proxysql-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScientaNL%2Fk8s-proxysql-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScientaNL%2Fk8s-proxysql-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScientaNL","download_url":"https://codeload.github.com/ScientaNL/k8s-proxysql-cluster/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247765093,"owners_count":20992235,"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":["cluster","helm-chart","kubernetes","proxysql"],"created_at":"2024-08-01T15:06:27.943Z","updated_at":"2025-04-08T02:34:33.543Z","avatar_url":"https://github.com/ScientaNL.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# k8s-proxysql-cluster\nContainer to run proxysql in cluster mode in kubernetes.\n\n## Usage\nBy default te the container acts as a normal proxysql instance. \nTo enable cluster mode the following is needed.\n\n#### Service\nthe container uses a service to discover if there are already master nodes up.\nThis service can be found in\n```\n/k8s/proxysql.service.yaml\n``` \nuse the following command to use the service in kubernetes\n```\nkubectl create -f ./k8s/proxysql.service.yaml\n``` \n\n#### Statefulset\nTo deploy the actual nodes a statefulset should be added to the kubernetes cluster\nThis statefulset can be found in\n```\n/k8s/proxysql.statefulset.yaml\n``` \nuse the following command to use the statefulset in kubernetes\n```\nkubectl create -f ./k8s/proxysql.statefulset.yaml\n``` \n\n## Helm Install\n\nYou can install using the helm repository using the following command:\n\n```bash\nhelm install --name db-proxy deploy/charts/proxysql-cluster \n```\n\n| Parameter | Description | Default |\n|----|-----------|-------------|\n| `image.repository` | `proxysql` image repo | `scienta/k8s-proxysql-cluster` |\n| `image.tag` | `proxysql` image tag | `1.0.0` |\n| `numReplicas` | Number of replicas to create in StatefulSet | `3` |\n| `proxysql.admin.username` | Admin username for `proxysql` | `admin` |\n| `proxysql.admin.password` | Admin password for `proxysql` | `admin` |\n| `proxysql.admin.iface` | Listen network for `proxysql` service | `0.0.0.0` |\n| `proxysql.admin.port` | Listen port for `proxysql` service | `6032` |\n| `proxysql.clusterAdmin.username` | Cluster user username used by `proxysql` nodes to sync | `cluster1` |\n| `proxysql.clusterAdmin.password` | Cluster user password used by `proxysql` nodes to sync | `secret1pass` |\n| `proxysql.queryCacheSizeMb` | (Optional) Query cache size | `nil` |\n| `proxysql.dataDir` | Directory to store `proxysql` tables, etc. | `/var/lib/proxysql` |\n| `proxysql.webEnabled` | Enable `proxysql` web dashboard | `true` |\n| `mysql.iface` | Listen network for `mysql` service connections | `0.0.0.0` |\n| `mysql.port` | Listen port fo `mysql` service connections | `3306` |\n| `mysql.monitor.username` | Monitor username on MySQL instances for `proxysql` health checks | `monitor` |\n| `mysql.monitor.password` | Monitor password on MySQL instances for `proxysql` health checks | `monitor` |\n| `mysql.admin.username` | Root / admin username on MySQL instances | `root` |\n| `mysql.admin.password` | Root / admin password on MySQL instances | `insecurepassword` |\n| `cronjob.enabled` | Enable k8s `CronJob` to set the default hostgroup to the backend having the least # databases | `false` |\n| `resources` | CPU / Memory Limits and Requests | `{}` |\n| `tolerations` | Pod tolerations | '{}' |\n\n## Workings\nWhen the container is run with the --k8s-cluster argument the following happens:\n- the container checks if there is a node available at the proxysql service\n- If no node is available this container becomes the first master node of the cluster\n    - The node deletes the proxysql server from the proxysql_servers table\n    - The node adds its own ip to its proxysql_servers table\n\n- Else the node wil join the existing master nodes\n    - The node's proxysql_servers table is synced with that of the existing master nodes\n    - The node adds its own ip to the proxysql_servers table of the node exposed by the proxysql service.\n    - The node deletes the proxysql service from the proxysql_servers table\n    \n- The cluster is up and running!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FScientaNL%2Fk8s-proxysql-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FScientaNL%2Fk8s-proxysql-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FScientaNL%2Fk8s-proxysql-cluster/lists"}