{"id":22941274,"url":"https://github.com/thejaxon/kontainer8","last_synced_at":"2025-08-12T21:31:48.074Z","repository":{"id":48515933,"uuid":"387597666","full_name":"theJaxon/Kontainer8","owner":"theJaxon","description":"Creating a kubernetes kubeadm cluster using Vagrant machines as nodes and Containerd as a container runtime","archived":false,"fork":false,"pushed_at":"2023-07-18T09:54:21.000Z","size":69,"stargazers_count":20,"open_issues_count":0,"forks_count":14,"subscribers_count":2,"default_branch":"main","last_synced_at":"2023-07-18T10:43:11.369Z","etag":null,"topics":["ansible","kubeadm","kubernetes-cluster","vagrant"],"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/theJaxon.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}},"created_at":"2021-07-19T21:24:35.000Z","updated_at":"2023-07-18T10:43:11.369Z","dependencies_parsed_at":"2023-02-14T16:02:35.838Z","dependency_job_id":null,"html_url":"https://github.com/theJaxon/Kontainer8","commit_stats":null,"previous_names":[],"tags_count":3,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theJaxon%2FKontainer8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theJaxon%2FKontainer8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theJaxon%2FKontainer8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theJaxon%2FKontainer8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theJaxon","download_url":"https://codeload.github.com/theJaxon/Kontainer8/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229709203,"owners_count":18111385,"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","kubeadm","kubernetes-cluster","vagrant"],"created_at":"2024-12-14T13:38:30.473Z","updated_at":"2024-12-14T13:38:30.924Z","avatar_url":"https://github.com/theJaxon.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kontainer8\n\n![Kubeadm](https://img.shields.io/badge/-Kubeadm%201.26.0-326CE5?style=for-the-badge\u0026logo=Kubernetes\u0026logoColor=white)\n![Vagrant](https://img.shields.io/badge/-Vagrant-1563FF?style=for-the-badge\u0026logo=Vagrant\u0026logoColor=white)\n![Ansible](https://img.shields.io/badge/-ansible-C9284D?style=for-the-badge\u0026logo=ansible\u0026logoColor=white)\n![Ubuntu](https://img.shields.io/badge/-ubuntu%2022.04-E95420?style=for-the-badge\u0026logo=ubuntu\u0026logoColor=white)\n\n\n![Ingress](https://img.shields.io/badge/nginx-ingress%20controller-269539?style=for-the-badge\u0026logo=Nginx)\n![Locl-path-provisioner](https://img.shields.io/badge/Dynamic%20provisioning-local%20path%20provisioner-0075A8?style=for-the-badge\u0026logo=Rancher)\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [Kontainer8](#kontainer8)\n    - [Vagrant Machines details](#vagrant-machines-details)\n    - [How to use](#how-to-use)\n    - [Locally building images](#locally-building-images)\n    - [Accessing the Ingress from the Host OS](#accessing-the-ingress-from-the-host-os)\n    - [Extras](#extras)\n    - [Useful Resources](#useful-resources)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\nCreating a kubernetes cluster using Vagrant machines as nodes and `Containerd` as a container runtime\n- This role is just an automation for the steps of aCloudGuru CKS Lesson **Building a Kubernetes Cluster**\n- Parts of the roles are also borrowed from my previous projects for creating K8s cluster\n    - [Kluster](https://github.com/theJaxon/Kluster)\n    - [K8s-Vagrant](https://github.com/theJaxon/K8s-Vagrant)\n- Vagrant [ansible local provisioner](https://www.vagrantup.com/docs/provisioning/ansible_local) is used to execute the roles on the target hosts\n\n- Kubernetes version to be used can be modified by [changing the fact](https://github.com/theJaxon/Kontainerd/blob/main/kontainerd/tasks/prerequisites.yml#L40) inside kontainerd role \n```yaml\n- set_fact:\n    k8s_version: 1.24.0-00 # Change to whatever desired version\n```\n---\n\n### Vagrant Machines details\n\n|  Machine |    Address    |         FQDN         |\n|:--------:|:-------------:|:--------------------:|\n|  master | 192.168.100.11 |  master master.com |\n| worker | 192.168.100.10 | worker worker.com |\n\n---\n\n### How to use\n```bash\n# Clone the repo\ngit clone https://github.com/theJaxon/Kontainer8.git\n\ncd Kontainer8\n\n# Start the machines \nvagrant up \n\n# SSH into any of the machines \nvagrant ssh \u003c master | worker \u003e\n```\n\n---\n\n### Locally building images\n\n- Start by installing podman\n```bash\nexport image_name=jenkins-local\n\n# Assuming there's a Dockerfile in the current working directory\npodman build --tag $image_name .\n\n# Save the image into tar file\npodman save $image_name -o $image_name.tar\n\n# Use ctr to import the image \nsudo ctr -n=k8s.io images import $image_name.tar\n\n# Verify that the image is now available for k8s to use \nsudo crictl image ls\n\n\u003e localhost/jenkins-local\n``` \n\n---\n\n### Accessing the Ingress from the Host OS\n\n- Nginx Ingress controller is configured to use **nodeport 30000** so that we end up with a fixed port number for the controller\n- Using the controller as a proxy can be done by calling any of the 2 machines \n```bash\ncurl --proxy http://192.168.100.10:30000 http://jellyfin.media/web/index.html\ncurl --proxy http://192.168.100.11:30000 http://jellyfin.media/web/index.html\n```\n- On the host OS one can take advantage of Firefox by setting the proxy to point to the ingress controller \n\n![Firefox_proxy](https://github.com/theJaxon/Kontainer8/blob/main/etc/Firefox_Proxy.jpg)\n\n- You can take this one step further and install a plugin like [Proxy Toggle](https://addons.mozilla.org/en-US/firefox/addon/proxy-toggle-button/) to easily use the controller and revert back to the regular browser settings\n- Once the Ingress controller is set up as the proxy, you can reach the needed services using the configured ingress\n![Jellyfin](https://github.com/theJaxon/Kontainer8/blob/main/etc/Jellyfin.jpg)\n\n\n\n---\n\n### Extras\n- Extras role defines additional resources that will be deployed to the kubernetes cluster, it's responsible for creating 2 new namespaces\n  1. ingress-nginx - where nginx ingress controller will be deployed\n  2. local-path-storage - where local path provisioner will be deployed (local path is the default storage class)\n\n---\n\n- One of the quirks i've faced was with installing kubernetes packages (kubeadm, kubectl and kubelet), the problem has to do with the order so i started first by installing `kubelet` which in turn installed kubectl (and this was breaking the installation since it was installing latest kubectl version not the version i'm specifying) so upon continuing the task another attempt to install kubectl is made with a downgraded version thus ansible errors. \n- The workaround was to change the sequence and start by installing the desired kubectl version \n\n---\n\n### Useful Resources\n- [ justmeandopensource/kubernetes - vagrant-provisioning ](https://github.com/justmeandopensource/kubernetes/tree/master/vagrant-provisioning)\n- [Upgrading an existing cluster with kubeadm](https://kubernetes.io/docs/tasks/administer-cluster/coredns/#migrating-to-coredns)\n- [Manually Loading Container Images with containerD](https://blog.scottlowe.org/2020/01/25/manually-loading-container-images-with-containerd/)\n- [Local Path Provisioner](https://github.com/rancher/local-path-provisioner)\n- [Kubernetes nginx Ingress Controller](https://kubernetes.github.io/ingress-nginx/deploy/baremetal/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthejaxon%2Fkontainer8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthejaxon%2Fkontainer8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthejaxon%2Fkontainer8/lists"}