{"id":17275830,"url":"https://github.com/viveksinghggits/cluster-setup","last_synced_at":"2025-10-24T14:45:49.629Z","repository":{"id":39626018,"uuid":"347692778","full_name":"viveksinghggits/cluster-setup","owner":"viveksinghggits","description":"Basic commands that can be run to create a three node kubeadm kubernetes cluster.","archived":false,"fork":false,"pushed_at":"2022-08-28T21:11:01.000Z","size":134,"stargazers_count":24,"open_issues_count":0,"forks_count":67,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-27T22:02:48.128Z","etag":null,"topics":["kubeadm","kubeadm-cluster","kubernetes"],"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/viveksinghggits.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-03-14T16:40:30.000Z","updated_at":"2025-03-16T18:42:20.000Z","dependencies_parsed_at":"2022-09-15T22:02:18.717Z","dependency_job_id":null,"html_url":"https://github.com/viveksinghggits/cluster-setup","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/viveksinghggits%2Fcluster-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viveksinghggits%2Fcluster-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viveksinghggits%2Fcluster-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viveksinghggits%2Fcluster-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viveksinghggits","download_url":"https://codeload.github.com/viveksinghggits/cluster-setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844231,"owners_count":21170536,"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":["kubeadm","kubeadm-cluster","kubernetes"],"created_at":"2024-10-15T08:57:18.314Z","updated_at":"2025-10-24T14:45:44.591Z","avatar_url":"https://github.com/viveksinghggits.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- [![IMAGE ALT TEXT HERE](kluster.png)](https://youtu.be/HoQFPkEzgfQ) --\u003e\n\n\u003ca href=\"https://youtu.be/HoQFPkEzgfQ\"\u003e\u003ccenter\u003e\u003cimg align=\"center\" width=\"60%\" src=\"kluster.png\"\u003e\u003cbr\u003e\u003c/center\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\u003e :warning: **This document would not work on Lastest Ubuntu 22.04**: We get into https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/#known-issues\n\n## Setting up three node Kubernetes cluster\n\nFirst of all, we should have three instances created that can connect over the public network. It doesn't matter how those instances are created, for example, they can either be Digital Ocean `droplets` or `AWS EC2` instances.\n\n### SSH into all the instances\n\nOnce you are into those instances, the commands that are mentioned below should be run on all the instances\n\n#### Commands to run on all the nodes\n\n```\n# Get sudo working\nsudo -l\n\n# update packages and their version\nsudo apt-get update \u0026\u0026 sudo apt-get upgrade -y\n\n# install curl and apt-transport-https\nsudo apt-get update \u0026\u0026 sudo apt-get install -y apt-transport-https curl\n\n# add key to verify releases\ncurl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -\n\n# add kubernetes apt repo\ncat \u003c\u003cEOF | sudo tee /etc/apt/sources.list.d/kubernetes.list\ndeb https://apt.kubernetes.io/ kubernetes-xenial main\nEOF\n\n# install kubelet, kubeadm and kubectl\nsudo apt-get update\nsudo apt-get install -y kubelet kubeadm kubectl\n\n# install docker\nsudo apt-get install docker.io\n\n# apt-mark hold is used so that these packages will not be updated/removed automatically\nsudo apt-mark hold kubelet kubeadm kubectl\n```\n\nAfter the above commands are successfully run on all the worker nodes. Below steps can be followed to initialize the Kubernetes cluster.\n\n#### On Leader Node\n\nRun the below command on the node that you want to make the leader node. Please make sure you replace the correct IP of the node with `IP-of-Node`\n\n```\nexport MASTER_IP=\u003cIP-of-Node\u003e\nkubeadm init --apiserver-advertise-address=${MASTER_IP} --pod-network-cidr=10.244.0.0/16\n```\n\n#### Join worker nodes to the Leader node\n\nOnce the command `kubeadm init` is completed on the leader node, below we would get a command like below in the output of `kubeadm init` that can be run on worker nodes to make them join the leader node.\n\n```\nkubeadm join 206.189.134.39:6443 --token dxxfoj.a2zzwbfrjejzir4h \\\n    --discovery-token-ca-cert-hash sha256:110e853989c2401b1e54aef6e8ff0393e05f18d531a75ed107cf6c05ca4170eb\n```\n\n### Install CNI plugin\n\nThe below command can be run on the leader node to install the CNI plugin\n\n```\nkubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml\n```\n\n### Setting up Kubeconfig file\n\nAfter successful completion of `kubeadm init` command, like we got the `kubeadm join` command, we would also get details about how we can set up `kubeconfig` file.\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviveksinghggits%2Fcluster-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviveksinghggits%2Fcluster-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviveksinghggits%2Fcluster-setup/lists"}