{"id":19837289,"url":"https://github.com/hamidgholami/k8s-lab","last_synced_at":"2025-05-01T18:30:36.191Z","repository":{"id":44919778,"uuid":"370004591","full_name":"hamidgholami/k8s-lab","owner":"hamidgholami","description":"Kubernetes Labratory","archived":false,"fork":false,"pushed_at":"2023-09-22T10:32:59.000Z","size":47,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T16:49:10.218Z","etag":null,"topics":["cncf","devops","devops-tools","k3s","k3s-architecture","k3s-cluster","k3s-minicluster","k8s","k8s-cluster","k8s-learn","kubernetes","kubernetes-cluster","kubernetes-labs","kubernetes-learning","sre"],"latest_commit_sha":null,"homepage":"","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamidgholami.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-23T08:58:11.000Z","updated_at":"2024-05-03T17:51:52.000Z","dependencies_parsed_at":"2023-09-23T07:51:55.290Z","dependency_job_id":null,"html_url":"https://github.com/hamidgholami/k8s-lab","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/hamidgholami%2Fk8s-lab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidgholami%2Fk8s-lab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidgholami%2Fk8s-lab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidgholami%2Fk8s-lab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamidgholami","download_url":"https://codeload.github.com/hamidgholami/k8s-lab/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251924587,"owners_count":21665998,"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":["cncf","devops","devops-tools","k3s","k3s-architecture","k3s-cluster","k3s-minicluster","k8s","k8s-cluster","k8s-learn","kubernetes","kubernetes-cluster","kubernetes-labs","kubernetes-learning","sre"],"created_at":"2024-11-12T12:14:00.734Z","updated_at":"2025-05-01T18:30:35.869Z","avatar_url":"https://github.com/hamidgholami.png","language":"Jinja","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lightweight Kubernetes Labratory\n\n[![Twitter Follow](https://img.shields.io/twitter/follow/045_hamid?label=geekestan\u0026style=plastic\u0026logo=twitter\u0026color=blue)](https://twitter.com/geekestan)\n[![GitHub Follow](https://img.shields.io/github/followers/hamidgholami?label=hamidgholami\u0026style=plastic\u0026logo=github\u0026color=green)](https://github.com/hamidgholami)\n[![Linkedin Badge](https://img.shields.io/badge/hamid--gholami-LinkedIn-blue?logo=linkedin)](https://www.linkedin.com/in/hamid-gholami/)\n[![Youtube Badge](https://img.shields.io/badge/-geekestan-red?style=plastic\u0026\u0026logo=youtube\u0026message=geekestan\u0026logoColor=white)](https://www.youtube.com/@geekestan)\n\n\nThis is a \u003cins\u003e3-node-cluster\u003c/ins\u003e Kubernetes that uses `k3s`. It can be very usefull for learning Kubernetes concepts easy and fast without struggling with installing kubernetes by `kubeadm` or `minikube`. Although learning methods of Kubernetes installation is definitely crucial, for first step and for learning vital and basic concepts of Kubernetes we need a lightweight and repeatable infrastructure.\n\n#### Requirement\nMake sure that following tools are installed on your host.\n\n1. Ansible\n2. Vagrant\n3. libvirt/KVM or virtualbox\n\n#### SSH configuration\nAdd the following configuration in `~/.ssh/config`\n```bash\nHost 10.0.0.*\n        Hostname %h\n\nHost 192.168.56.*                     \n        Hostname %h\n                                               \nMatch Host 10.0.0.*\n        User vagrant                 \n        Port 22\n        UserKnownHostsFile /dev/null     \n        StrictHostKeyChecking no\n        PasswordAuthentication no\n        IdentityFile $HOME/.vagrant.d/insecure_private_key\n        IdentitiesOnly yes                                                                     \n        LogLevel FATAL          \n                                               \nMatch Host 192.168.56.*\n        User vagrant                                                                           \n        Port 22                                                                                \n        UserKnownHostsFile /dev/null                                                           \n        StrictHostKeyChecking no\n        PasswordAuthentication no                                                              \n        IdentityFile $HOME/.vagrant.d/insecure_private_key\n        IdentitiesOnly yes                                                                     \n        LogLevel FATAL\n\n```\n#### How does it work?\nFill the variables in `vagrant_variables.yaml` and then execute the following command:\n```bash\nvagrant up\n```\n#### Kubeconfig\nFor executing `kubectl` from your machine rather than in master node (`node-1`), copy the kubectl configuration in your machine:\n```\nscp vagrant@\u003cnode-1-ip\u003e:~/.kube/config ~/.kube/config\n```\n#### Changing default storage pool directory\n[URL](https://serverfault.com/questions/840519/how-to-change-the-default-storage-pool-from-libvirt)\u003cbr/\u003e\nFor changing storage pool default path, the following commands can be used:\n```bash\nvirsh pool-list\nvirsh pool-destroy default\nvirsh pool-undefine default\nvirsh pool-define-as --name default --type dir --target /hdd/pool_ssd_nvm\nvirsh pool-autostart default\nvirsh pool-start default\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidgholami%2Fk8s-lab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamidgholami%2Fk8s-lab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidgholami%2Fk8s-lab/lists"}