{"id":21928606,"url":"https://github.com/nuvious/homelabkubernetes","last_synced_at":"2026-05-05T06:33:27.035Z","repository":{"id":156727775,"uuid":"595498439","full_name":"nuvious/HomelabKubernetes","owner":"nuvious","description":"A set of ansible playbooks for deploying microk8s or k3s to x86 or arm clusters.","archived":false,"fork":false,"pushed_at":"2024-09-04T13:37:01.000Z","size":32,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-20T08:14:53.875Z","etag":null,"topics":["ansible","k3s","k3s-cluster","kubernetes","kubernetes-cluster","microk8s"],"latest_commit_sha":null,"homepage":"","language":null,"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/nuvious.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":"2023-01-31T07:49:06.000Z","updated_at":"2024-09-04T13:37:06.000Z","dependencies_parsed_at":"2023-11-15T06:29:12.713Z","dependency_job_id":"7ea32f1d-70d9-4a8c-95a6-8afb07b780b0","html_url":"https://github.com/nuvious/HomelabKubernetes","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/nuvious%2FHomelabKubernetes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuvious%2FHomelabKubernetes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuvious%2FHomelabKubernetes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nuvious%2FHomelabKubernetes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nuvious","download_url":"https://codeload.github.com/nuvious/HomelabKubernetes/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244955009,"owners_count":20537874,"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":["ansible","k3s","k3s-cluster","kubernetes","kubernetes-cluster","microk8s"],"created_at":"2024-11-28T22:27:03.456Z","updated_at":"2026-05-05T06:33:26.998Z","avatar_url":"https://github.com/nuvious.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# K3S and K8S Deployment Playbooks\n\nThis is just a set of ansible playbooks for deploying either k3s or k8s to\nx86/amd64 or amd64 hosts.\n\n## Pre-Requisites\n\n- Kubectl\n  - Install per official documentation [here](https://kubernetes.io/docs/tasks/tools/).\n- Ansible\n  - Install per official documentation [here](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html).\n- Target Hosts\n  - Must have a target user with sudo access\n  - (Strongly Recommended) SSH keys onboarded to target user on target hosts\n\n## K3S on x86/amd64\n\n### Modify Hosts\n\nThese playbooks use the group names server and agent to distinguish between\nserver and agent nodes in the cluster. Create these groups in\n`/etc/ansible/hosts` [per ansible documentation](https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html)\nor copy and rename hosts/example.yml and update accordingly. Here's an example:\n\n```yaml\nall:\n  hosts:\n    kube00:\n      ansible_host: 192.168.1.60\n      ansible_ssh_private_key_file: /home/k3s/.ssh/id_rsa\n      ansible_user: k3s\n    kube01:\n      ansible_host: 192.168.1.61\n      ansible_ssh_private_key_file: /home/k3s/.ssh/id_rsa\n      ansible_user: k3s\n    kube02:\n      ansible_host: 192.168.1.62\n      ansible_ssh_private_key_file: /home/k3s/.ssh/id_rsa\n      ansible_user: k3s\n\nserver:\n  hosts:\n    kube00:\n\nagent:\n  hosts:\n    kube01:\n    kube02:\n\n```\n\n### Deploy\n\n```bash\nansible-playbook -i hosts/example.yml k3s-deploy.yml\nmkdir -p ~/.kube\nmv ~/.kube/config ~/.kube/config_backup # If you have an existing kube config\nsudo bash -c \"mv /root/k3s-config $HOME/.kube/config \u0026\u0026 chown $USER:$USER $HOME/.kube/config\"\n```\n\nYou should be able to run `kubectl get nodes` to see your nodes after this\n\n```bash\n$ kubectl get nodes\nNAME                   STATUS   ROLES                  AGE   VERSION\nkube00   Ready    control-plane,master   45s   v1.25.5+k3s2\nkube02   Ready    \u003cnone\u003e                 25s   v1.25.5+k3s2\nkube01   Ready    \u003cnone\u003e                 22s   v1.25.5+k3s2\n```\n\n### Remove\n\n```bash\nansible-playbook -i hosts/example.yml k3s-remove.yml\n```\n\n## K8S on x86/amd64\n\n### Modify Hosts\n\nThese playbooks use the group names server and agent to distinguish between\nserver and agent nodes in the cluster. Create these groups in\n`/etc/ansible/hosts` [per ansible documentation](https://docs.ansible.com/ansible/latest/inventory_guide/intro_inventory.html)\nor copy and rename hosts/example.yml and update accordingly. Here's an example:\n\n```yaml\nall:\n  hosts:\n    kube00:\n      ansible_host: 192.168.1.60\n      ansible_ssh_private_key_file: /home/k8s/.ssh/id_rsa\n      ansible_user: k8s\n    kube01:\n      ansible_host: 192.168.1.61\n      ansible_ssh_private_key_file: /home/k8s/.ssh/id_rsa\n      ansible_user: k8s\n    kube02:\n      ansible_host: 192.168.1.62\n      ansible_ssh_private_key_file: /home/k8s/.ssh/id_rsa\n      ansible_user: k8s\n\nserver:\n  hosts:\n    kube00:\n\nagent:\n  hosts:\n    kube01:\n    kube02:\n\n```\n\n### Deploy\n\n```bash\nansible-playbook -i hosts/example.yml microk8s-deploy.yml\nmkdir -p ~/.kube\nmv ~/.kube/config ~/.kube/config_backup # If you have an existing kube config\nsudo bash -c \"mv /root/k8s-config $HOME/.kube/config \u0026\u0026 chown $USER:$USER $HOME/.kube/config\"\n```\n\nYou should be able to run `kubectl get nodes` to see your nodes after this:\n\n```bash\n$ kubectl get nodes\nNAME                   STATUS   ROLES    AGE     VERSION\nkube00.bearden.local   Ready    \u003cnone\u003e   5m41s   v1.26.0\nkube02.bearden.local   Ready    \u003cnone\u003e   3m23s   v1.26.0\nkube01.bearden.local   Ready    \u003cnone\u003e   3m3s    v1.26.0\n```\n\n### Remove\n\n```bash\nansible-playbook -i hosts/example.yml microk8s-remove.yml\n```\n\n## Other Useful Playbooks Included\n\n### Update Playbook\n\nJust a simple playbook to update debian based distributions. Example usage:\n\n```bash\n# Will execute against 'all' in inventory\nansible-playbook -i hosts/hosts_file.yml site_update.yml\n\n# Will execute against a specific group in inventory\nansible-playbook -i hosts/hosts_file.yml --extra-vars \"hosts=creality\" site_update.yml\n```\n\n## Misc Notes for Contributors\n\n### Suppress Warnings\n\n```bash\nexport ANSIBLE_PYTHON_INTERPRETER=auto_silent\n```\n\n### File Structure\n\nFile structure derrived from the recommended\n[Directory Layout](https://docs.ansible.com/ansible/2.8/user_guide/playbooks_best_practices.html#directory-layout)\ndocumentation from [Ansible Best Practices](https://docs.ansible.com/ansible/2.8/user_guide/playbooks_best_practices.html#best-practices).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuvious%2Fhomelabkubernetes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnuvious%2Fhomelabkubernetes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnuvious%2Fhomelabkubernetes/lists"}