{"id":31654181,"url":"https://github.com/glueops/gluekube","last_synced_at":"2026-05-22T12:09:00.400Z","repository":{"id":281404004,"uuid":"945142987","full_name":"GlueOps/GlueKube","owner":"GlueOps","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-09T12:27:30.000Z","size":282,"stargazers_count":1,"open_issues_count":35,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-03-09T17:45:32.398Z","etag":null,"topics":["allow-auto-merge"],"latest_commit_sha":null,"homepage":"","language":"Jinja","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/GlueOps.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-08T18:54:23.000Z","updated_at":"2026-03-09T12:10:07.000Z","dependencies_parsed_at":"2025-04-08T22:35:42.865Z","dependency_job_id":"7d976210-3aee-46df-8af5-1ba3ce893bf1","html_url":"https://github.com/GlueOps/GlueKube","commit_stats":null,"previous_names":["glueops/ansible-kubeadm","glueops/gluekube"],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/GlueOps/GlueKube","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlueOps%2FGlueKube","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlueOps%2FGlueKube/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlueOps%2FGlueKube/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlueOps%2FGlueKube/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GlueOps","download_url":"https://codeload.github.com/GlueOps/GlueKube/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GlueOps%2FGlueKube/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30466570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T11:00:43.441Z","status":"ssl_error","status_checked_at":"2026-03-13T11:00:23.173Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["allow-auto-merge"],"created_at":"2025-10-07T11:44:20.302Z","updated_at":"2026-03-13T12:02:23.999Z","avatar_url":"https://github.com/GlueOps.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Prerequisite\n\nthis arhcitecture need at least:\n\n- 1 LoadBalancers\n- 1 master node\n- 1 worker node\n  \n\nfor system level, you need to do:\n\n- install ansible\n- pip install jmespath\n- install the below ansible collections\n\nansible.netcommon                        7.1.0\nansible.posix                            2.0.0\nansible.utils                            5.1.2\ncommunity.crypto                         2.24.0\ncommunity.docker                         4.3.1\ncommunity.general                        10.3.0\nhetzner.hcloud                           4.2.2\nkubernetes.core                          5.1.0\n\n## Scenario # 1 (You have VMs)\n\ncreate a folder `keys` in **the same level as ansible folder**. If you have already created VMs, copy the private keys into the `keys` folder and replace the `ansible_ssh_private_key_file` inside `hosts.yaml` with each VM private key.\n\nhere is an example of the `hosts.yaml` format:\n\n```yaml\n\nall:\n  children:\n    loadbalancer:\n      hosts:\n        lb-node-1:\n          ansible_host: IP\n          ansible_user: haproxyadmin\n          ip: PRIVATE_IP\n          ansible_ssh_private_key_file: ../keys/lb_node\n\n        lb-node-2:\n          ansible_host: IP\n          ansible_user: haproxyadmin\n          ip: PRIVATE_IP\n          ansible_ssh_private_key_file: ../keys/lb_node\n\n        lb-node-3:\n          ansible_host: IP\n          ansible_user: haproxyadmin\n          ip: PRIVATE_IP\n          ansible_ssh_private_key_file: ../keys/lb_node\n\n    masters:\n      hosts:\n        master-node-1:\n          ansible_host: IP\n          ansible_user: cluster\n          ip: PRIVATE_IP\n          ansible_ssh_private_key_file: ../keys/master_node\n          extra:\n            taints:\n              - node-role.kubernetes.io/control-plane:NoSchedule-\n    workers:\n      hosts:\n        worker-node-1:\n          ansible_host: IP\n          ansible_user: cluster\n          ip: PRIVATE_IP\n          ansible_ssh_private_key_file: ../keys/worker_node\n          extra:\n            taints:\n              - glueops.dev/role=glueops-platform:NoSchedule\n\n```\n\nthen test if ansible can ssh into all the hosts using:\n\n`ansible all -i inventory/hosts.yaml -m ping`\n\n## Scenario # 2 (else)\n\nIf you didn't create VMs, you can run the terraform file `main.tf` to  create ones.\n\nfirst, you need to create ssh-keys, you either create an ssh-key for each (loadbalancer,master,worker) Vms or single ssh-key for all Vms\n\nto create an ssh-key run the following:\n\n`ssh-keygen -o -a 100 -t ed25519 -f vm_node`\n\nthen move into terraform folder and because we're using hetzner to create Vms, create a file .tfvars and add the following:\n\n```bash\n  hcloud_token = \"XXXXXX\"\n  public_key = \"the_public_key_you_copied\" \n\n```\n\nfinally run\n\n```bash\n    terraform init\n    terraform apply -var-file .tfvars\n\n```\n\nIf terraform finished succesfully a `hosts.yaml` file will be created under `ansible/inventory`\n\n# Install Kubernetes\n\nNow after you got `hosts.yaml`\n\nmove into the `ansible` folder and run the following commands\n\n`export ANSIBLE_ROLES_PATH=$PWD/roles`\n`export ANSIBLE_HOST_KEY_CHECKING=False`\n\ncreate a file `.env` and add  the following secrets:\n\n`RANDOM_TOKEN`: the format of token must be like the following: abcdef.abcdef0123456789\n\n`CERTIFICATE_KEY`: The certificate key is a hex encoded string that is an AES key of size 32 bytes. you can use [https://www.electricneutron.com/encryption-key-generator/] and choose AES 256 bit(HEX).\n\nthen to allow ansible noticing the .env file, we need to export it like the following: `export $(grep -v '^#' .env | xargs)`\n\nthen test if ansible can ssh into all the hosts using:\n\n`ansible all -i inventory/hosts.yaml -m ping`\n\nif all the hosts pinged just fine, start creating the cluster by running:\n\n`ansible-playbook -i inventory/hosts.yaml playbooks/setup-cluster.yaml`\n\nafter the playbook run successfully, you will see a kubeconfig file in `ansible/playbooks/.kube/config`\n\n# Scale Nodes\n\nwe treat the `hosts.yaml` as the source of truth to our resources, so to **scale up or down** the nodes, it will be enough to modify the hosts.yaml file\n\nexample, the current `hosts.yaml` is:\n\n```yaml\n\nworkers:\n    hosts:\n        worker-node-1:\n            ansible_host: 138.199.157.195\n            ansible_user: cluster\n            ip: 10.0.0.21\n            ansible_ssh_private_key_file: ../keys/worker_node\n            extra:\n              taints:\n                  - glueops.dev/role=glueops-platform:NoSchedule\n\n        worker-node-2:\n            ansible_host: 138.199.163.163\n            ansible_user: cluster\n            ip: 10.0.0.22\n            ansible_ssh_private_key_file: ../keys/worker_node\n            extra:\n              taints:\n                  - glueops.dev/role=glueops-platform:NoSchedule\n\n```\n\nIf we need to scale it up, we can just add another worker node\n\n```yaml\nworkers:\n  hosts:\n    worker-node-1:\n      ansible_host: 138.199.157.195\n      ansible_user: cluster\n      ip: 10.0.0.21\n      ansible_ssh_private_key_file: ../keys/worker_node\n      extra:\n          taints:\n              - glueops.dev/role=glueops-platform:NoSchedule\n\n    worker-node-2:\n      ansible_host: 138.199.163.163\n      ansible_user: cluster\n      ip: 10.0.0.22\n      ansible_ssh_private_key_file: ../keys/worker_node\n      extra:\n          taints:\n              - glueops.dev/role=glueops-platform:NoSchedule\n\n    worker-node-3:\n      ansible_host: 138.199.163.164\n      ansible_user: cluster\n      ip: 10.0.0.23\n      ansible_ssh_private_key_file: ../keys/worker_node\n      extra:\n          taints:\n              - glueops.dev/role=glueops-platform:NoSchedule\n\n```\n\nor to scale down we remove the desired worker node\n\n```yaml\n\nworkers:\n    hosts:\n        worker-node-1:\n            ansible_host: 138.199.157.195\n            ansible_user: cluster\n            ip: 10.0.0.21\n            ansible_ssh_private_key_file: ../keys/worker_node\n            extra:\n              taints:\n                  - glueops.dev/role=glueops-platform:NoSchedule\n\n```\n\n**Note:** you can both scale up and down at the same time, but if you do it, we will run the scale up first then scale down\n\n**Note:** the number of control-plane nodes need to be odd number \n\nNow to run the syncing process, use the following command:\n\n`ansible-playbook  -i inventory/hosts.yaml playbooks/sync-resources.yaml`\n\nyou will prompted with following message:\n\n```txt\nok: [master-node-1] =\u003e {\n    \"msg\": [\n        \"Nodes to remove: '[]'.\",\n        \"Nodes to add '['worker-node-3']'.\"\n    ]\n}\n\nTASK [master : pause] ****************************************************************************************************************************************************************************************************************************************\n[master : pause]\nDo you want to apply the above changes? (Y/n):\n\n```\n\nafter you accept changes the kubernetes cluster will scale up/down depends on your desired state, also it will **update the loadbalancer haproxyconfig** file to the desired workloads\n\nto verify, run :\n\n```bash\n    export KUBECONFIG=$PWD/playbooks/.kube/config\n    kubectl get nodes\n```\n\n# Upgrade Cluster\n\n## Rotate Certs\n\n`ansible-playbook  -i inventory/hosts.yaml playbooks/rotate-certs.yaml`\n\n\n## Upgrade Version\n\nthis will update the whole cluster versions\n\nfirst you need to change the `kubernetes_version` and `kubernetes_package_version` to the desired version, then apply:\n\n`ansible-playbook  -i inventory/hosts.yaml playbooks/upgrade-cluster.yaml`\n\n\n## OS Security Patch\n\nto patch os with the security patches run :\n`ansible-playbook  -i inventory/hosts.yaml playbooks/os-patch.yaml`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglueops%2Fgluekube","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglueops%2Fgluekube","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglueops%2Fgluekube/lists"}