{"id":19583807,"url":"https://github.com/bodsch/ansible-k0s","last_synced_at":"2025-04-27T10:33:09.089Z","repository":{"id":37682480,"uuid":"493570675","full_name":"bodsch/ansible-k0s","owner":"bodsch","description":"Install and configure a kubernetes cluster using ansible and the vanilla upstream Kubernetes distro k0s. ","archived":false,"fork":false,"pushed_at":"2024-08-19T14:52:24.000Z","size":133,"stargazers_count":16,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-20T12:14:19.778Z","etag":null,"topics":["ansible","ansible-role","automation","k0s","kubernetes","kubernetes-cluster"],"latest_commit_sha":null,"homepage":"","language":"Python","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/bodsch.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":"2022-05-18T08:15:48.000Z","updated_at":"2024-08-19T14:52:28.000Z","dependencies_parsed_at":"2023-02-09T21:15:58.051Z","dependency_job_id":"4d73eacf-0812-42a5-8a8c-8f97a978a8ba","html_url":"https://github.com/bodsch/ansible-k0s","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-k0s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-k0s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-k0s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bodsch%2Fansible-k0s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bodsch","download_url":"https://codeload.github.com/bodsch/ansible-k0s/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224069628,"owners_count":17250451,"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","ansible-role","automation","k0s","kubernetes","kubernetes-cluster"],"created_at":"2024-11-11T07:44:54.254Z","updated_at":"2024-11-11T07:44:55.843Z","avatar_url":"https://github.com/bodsch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# Ansible Role:  `k0s`\n\nCreate a Kubernetes Cluster using Ansible.\n\nUse vanilla upstream Kubernetes distro [k0s](https://github.com/k0sproject/k0s).\n\nSimilar to [movd/k0s-ansible](https://github.com/movd/k0s-ansible), **but** better (i think so ;) )\n\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/bodsch/ansible-k0s/main.yml?logo=github\u0026branch=main)][ci]\n[![GitHub issues](https://img.shields.io/github/issues/bodsch/ansible-k0s?logo=github)][issues]\n[![GitHub release (latest by date)](https://img.shields.io/github/v/release/bodsch/ansible-k0s?logo=github)][releases]\n[![Ansible Downloads](https://img.shields.io/ansible/role/d/bodsch/k0s?logo=ansible)][galaxy]\n\n[ci]: https://github.com/bodsch/ansible-k0s/actions\n[issues]: https://github.com/bodsch/ansible-k0s/issues?q=is%3Aopen+is%3Aissue\n[releases]: https://github.com/bodsch/ansible-k0s/releases\n[galaxy]: https://galaxy.ansible.com/bodsch/k0s\n\n\nIf `latest` is set for `k0s_version`, the role tries to install the latest release version.  \n**Please use this with caution, as incompatibilities between releases may occur!**\n\nThe binaries are installed below `/usr/local/bin/k0s/${k0s_version}` and later linked to `/usr/bin`.  \nThis should make it possible to downgrade relatively safely.\n\nThe k0s archive is stored on the Ansible controller, unpacked and then the binaries are copied to the target system.\nThe cache directory can be defined via the environment variable `CUSTOM_LOCAL_TMP_DIRECTORY`.  \nBy default it is `${HOME}/.cache/ansible/k0s`.  \nIf this type of installation is not desired, the download can take place directly on the target system.  \nHowever, this must be explicitly activated by setting `k0s_direct_download` to `true`.\n\n## Requirements \u0026 Dependencies\n\nAnsible Collections\n\n- [bodsch.core](https://github.com/bodsch/ansible-collection-core)\n- [bodsch.scm](https://github.com/bodsch/ansible-collection-scm)\n\n```bash\nansible-galaxy collection install bodsch.core\nansible-galaxy collection install bodsch.scm\n```\nor\n```bash\nansible-galaxy collection install --requirements-file collections.yml\n```\n\n\n## Why better?\n\nThis Ansible role can be used atomically.  \nIf no changes are necessary, none will be made.\n\nAvoid `command` calls.  \nWherever possible, separate Ansible modules are used for this.\n\nOne role for all cases.\n\n\n## supported Operating systems\n\nTested on\n\n* ArchLinux\n* Debian based\n    - Debian 10 / 11 / 12\n    - Ubuntu 20.04 / 22.04 / 24.04\n\n\n## working implementation\n\nThe example of a working implementation can be viewed at [GitLab](https://gitlab.com/integration-tests/k0s).  \nA suitable infrastructure based on KVM and Terraform can be created in the repository.\n\nThere are some tests in `molecule` that could be used.\nFor reasons that are not clear to me, the tests in a docker container are not very meaningful.\nI have therefore extended the tests with the *Vagrant* driver.\n\nThere is a `Makefile` to start the tests:\n\n```shell\nmake test -e TOX_SCENARIO=multi-worker\n```\n\n\n```shell\nmake test -e TOX_SCENARIO=vagrant-multi-worker\n```\n\n\n## Contribution\n\nPlease read [Contribution](CONTRIBUTING.md)\n\n\n## Development,  Branches (Git Tags)\n\nThe `master` Branch is my *Working Horse* includes the \"latest, hot shit\" and can be complete broken!\n\nIf you want to use something stable, please use a [Tagged Version](https://github.com/bodsch/ansible-k0s/tags)!\n\n\n## usage\n\n```yaml\nk0s_version: 1.25.2+k0s.0\nk0s_release_download_url: https://github.com/k0sproject/k0s/releases\n\nk0s_system_user: k0s\nk0s_system_group: k0s\n\nk0s_config_dir: /etc/k0s\nk0s_data_dir: /var/lib/k0s\nk0s_libexec_dir: /usr/libexec/k0s\n\nk0s_direct_download: false\n\nk0s_worker_on_controller: false\nk0s_no_taints: false\n\nk0s_force: false\nk0s_debug: false\nk0s_verbose: false\n\nk0s_cluster_nodes:\n  initial_controller: \"\"\n  controllers: []\n  workers: []\n\nk0s_extra_arguments:\n  controller:\n    - --enable-metrics-scraper\n\nk0s_config_overwrites: {}\n\nk0s_token_expiry: \"15m\"\n\nk0s_artifacts_dir: \"{{ inventory_dir }}/artifacts\"\n```\n\n### `k0s_config_overwrites`\n\nExtension of the automatically created `k0s.yaml`\nThe structure must correspond to the created configuration. An example file can be viewed [here](./k0s_config.example).\n\n\n### single controller\n\n```yaml\nk0s_cluster_nodes:\n  initial_controller: controller-1.k0s.local\n  controllers: []\n  workers: []\n```\n\n\n### one controller with multi workers\n\n```yaml\nk0s_cluster_nodes:\n  initial_controller: controller-1.k0s.local\n  controllers: []\n  workers:\n    - worker-1.k0s.local\n    - worker-2.k0s.local\n    - worker-3.k0s.local\n```\n\n### multi controllers with multi workers\n\n```yaml\nk0s_cluster_nodes:\n  initial_controller: controller-1.k0s.local\n  controllers:\n    - controller-2.k0s.local\n    - controller-3.k0s.local\n  workers:\n    - worker-1.k0s.local\n    - worker-2.k0s.local\n    - worker-3.k0s.local\n```\n\n\n## Credits\n\n- [Moritz](https://github.com/movd)\n\n## other dokumentaions\n\n[Upgrading a k0s cluster in-place from single-master to HA](https://vadosware.io/post/upgrading-a-k0s-cluster-from-single-to-ha/#get-all-your-workloads-off-the-current-master-controllerworker-role-node)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodsch%2Fansible-k0s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbodsch%2Fansible-k0s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbodsch%2Fansible-k0s/lists"}