{"id":17686317,"url":"https://github.com/shihanng/kubebm","last_synced_at":"2026-04-29T23:32:13.077Z","repository":{"id":84061090,"uuid":"152965779","full_name":"shihanng/kubebm","owner":"shihanng","description":"A demo repository to show how to setup Kubenetes on bare-metal machine","archived":false,"fork":false,"pushed_at":"2018-10-19T04:54:26.000Z","size":23,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-25T12:07:17.454Z","etag":null,"topics":["ansible","bare-metal","kubernetes","vagrant"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shihanng.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-14T11:14:20.000Z","updated_at":"2018-10-23T00:58:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"87ef8e65-30b3-496f-8edf-9ba421f46acf","html_url":"https://github.com/shihanng/kubebm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shihanng/kubebm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihanng%2Fkubebm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihanng%2Fkubebm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihanng%2Fkubebm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihanng%2Fkubebm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shihanng","download_url":"https://codeload.github.com/shihanng/kubebm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shihanng%2Fkubebm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32448399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"ssl_error","status_checked_at":"2026-04-29T22:10:49.234Z","response_time":110,"last_error":"SSL_read: 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":["ansible","bare-metal","kubernetes","vagrant"],"created_at":"2024-10-24T10:44:31.109Z","updated_at":"2026-04-29T23:32:13.061Z","avatar_url":"https://github.com/shihanng.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"A simple demo to setup Kubernetes on bare-metal (and also on VM via [Vagrant](https://www.vagrantup.com/).\n\n# Requirements\n\n-  [Ubuntu 18.04.1 LTS (Bionic Beaver)](http://releases.ubuntu.com/18.04/). The [Vagrantfile](./vagrant/Vagrantfile) is based on this distribution.\n-  [Ansible](https://www.ansible.com/)\n\nFor VMs we need:\n\n- [Vagrant](https://www.vagrantup.com/)\n- [vagrant-rsync-back](https://github.com/smerrill/vagrant-rsync-back) to obtain the `KUBECONFIG` file from the master node.\n\n```\n$ vagrant plugin install vagrant-rsync-back\n```\n\n# Setup\n\n## Provisioning\n\n### Bare-metal\n\nExecute Ansible playbook to provision the machine.\n\n```\ncd ansible\nexport PRIV_KEY=\"\"\nansible-playbook --diff --check -vv provision.yml --private-key=\"${PRIV_KEY}\" --ask-become-pass\n```\n\n### VM\n\nUse Vagrant.\n\n```\ncd vagrant\nvagrant up\n```\n\n## Initialize the Kubernetes master for both bare-metal and VM.\n\n1. SSH into the master node and setup Kubernetes master with `kubeadm`.\n\n```\n# export IP_ADDR=\"\" # For Vagrant, this should be 192.168.50.110\n# kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=\"${IP_ADDR}\"\n```\n\n2. Copy the `/etc/kubernetes/admin.conf` file and use that with `kubectl` to talk with kubernetes. We can use the `KUBECONFIG` environment variable for this. For Vagrant this can be done with:\n\n```\n# cp -i /etc/kubernetes/admin.conf /vagrant/config\n# chown vagrant:vagrant /vagrant/config\n```\n\nOn the host, run the follwing under the `vagrant/` directory to copy the config file to host\n\n```\n$ vagrant rsync-back\n$ ls kubernetes\nconfig\n```\n\n## Install networking.\n\n### For bare-metal:\n```\n$ kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/bc79dd1505b0c8681ece4de4c0d86c5cd2643275/Documentation/kube-flannel.yml\n```\n\n### For Vagrant's VM use the `kube-flannel.yml` in the `vagrant/` directory.\n```\n$ kubectl apply -f kube-flannel.yml\n```\n\n## Setting up single-host cluster.\n\nTaint the master node so that we can use the master as single-host cluster.\n\n```\n$ kubectl taint nodes --all node-role.kubernetes.io/master-\n```\n\n## Adding worker node to cluster.\n\nWhen we have more machines to join the the cluster, we can generate the join command within the master node and use the resulting `kubeadm join` command in the worker node to add it into the cluster.\n\n```\n# kubeadm token create --print-join-command\nkubeadm join \u003cIP-ADDR\u003e --token \u003cSECRET\u003e --discovery-token-ca-cert-hash \u003cHASH\u003e\n```\n\n# References\n- [A. Ellis, Kubernetes on bare-metal in 10 minutes](https://blog.alexellis.io/kubernetes-in-10-minutes/)\n- [A. Ellis, Your instant Kubernetes cluster](https://blog.alexellis.io/your-instant-kubernetes-cluster/)\n- [Creating a single master cluster with kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshihanng%2Fkubebm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshihanng%2Fkubebm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshihanng%2Fkubebm/lists"}