{"id":19257619,"url":"https://github.com/milesrack/kubernetes-setup","last_synced_at":"2026-05-09T07:41:03.958Z","repository":{"id":150960387,"uuid":"604257355","full_name":"milesrack/kubernetes-setup","owner":"milesrack","description":"A guide along with scripts I used for setting up a kubernetes cluster.","archived":false,"fork":false,"pushed_at":"2023-02-27T17:08:33.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-05T09:14:49.596Z","etag":null,"topics":["bash","cloud","cloud-computing","containerization","containers","k8s","kubernetes","kubernetes-cluster","kubernetes-node","kubernetes-setup"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/milesrack.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":"2023-02-20T17:05:55.000Z","updated_at":"2023-02-23T11:57:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"ef545309-55b0-4d19-aa24-b31f7e994728","html_url":"https://github.com/milesrack/kubernetes-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/milesrack%2Fkubernetes-setup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesrack%2Fkubernetes-setup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesrack%2Fkubernetes-setup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/milesrack%2Fkubernetes-setup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/milesrack","download_url":"https://codeload.github.com/milesrack/kubernetes-setup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240356098,"owners_count":19788512,"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":["bash","cloud","cloud-computing","containerization","containers","k8s","kubernetes","kubernetes-cluster","kubernetes-node","kubernetes-setup"],"created_at":"2024-11-09T19:10:50.590Z","updated_at":"2026-05-09T07:40:58.931Z","avatar_url":"https://github.com/milesrack.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kubernetes-setup\nA guide along with scripts I used for setting up a kubernetes cluster.\n\n## Overview\nWe will setup one master node and at least one worker node to creake a kubernetes cluster. From the master node we can deploy containerized applications that will distribute the workload across the worker nodes.\n\nBoth the master and worker nodes will have Ubuntu 22.04 Server installed.\n\n## Requirements\n- Ubuntu 22.04 Server (tested with this script)\n- \\\u003e= 2 GB RAM\n- \\\u003e= 2 CPUs\n\n## Master Node\nRun the setup script for the master node:\n```bash\nwget -q https://raw.githubusercontent.com/milesrack/kubernetes-setup/master/master-setup.sh -O - | bash\n```\n\nCopy the `kubeadm join` command in the output, this will allow worker nodes to join the cluster.\n\nIt may take a few minutes for all the pods to start running. We can view the running pods on the master node with the following command:\n```bash\nkubectl get pods -n kube-system\n```\n\n## Worker Nodes\nUse the following command to set the hostname:\n```bash\nsudo hostnamectl hostname node1\n```\n*If you are setting up multiple worker nodes, make sure each hostname is unique (eg. `node1`, `node2`, `node3`).*\n\nNow run the setup script for the worker nodes:\n```bash\nwget -q https://raw.githubusercontent.com/milesrack/kubernetes-setup/master/node-setup.sh -O - | bash\n```\n\nOnce the script has completed run the `kubeadm join` command generated by the master node:\n```bash\nsudo kubeadm join \u003cIP\u003e:6443 --token \u003cTOKEN\u003e --discovery-token-ca-cert-hash sha256:\u003chash\u003e\n```\n\n## Viewing Resources\nRun the following command on the master node to view nodes in the cluster:\n```bash\nkubectl get nodes\n```\n\nFor more verbose output (IP addresses, OS version, etc.):\n```bash\nkubectl get nodes -o wide\n```\n\nTo show resource usage of nodes in the cluster:\n```bash\nkubectl top nodes\n```\n\nTo show pods in the kubernetes system:\n```bash\nkubectl get pods -n kube-system\n```\n\nTo show resource usage of pods in the kubernetes system:\n```bash\nkubectl top pods -n kube-system\n```\n\n## Deploying Nginx\nRun the following commands on the master node to configure the nginx service:\n```bash\nwget -q https://raw.githubusercontent.com/milesrack/kubernetes-setup/master/deployment.yaml -O - | kubectl apply -f -\nwget -q https://raw.githubusercontent.com/milesrack/kubernetes-setup/master/service.yaml -O - | kubectl apply -f -\n```\n\nWe can view the newly created pods with:\n```bash\nkubectl get pods\n```\n\nTo show resource usage of the pods:\n```bash\nkubectl top pods\n```\n\nNavigate to `http://\u003cIP\u003e:32000/` in your browser to view the running nginx server. Replace `\u003cIP\u003e` with the IP address of any of the worker nodes.\n\n## Resources\n- https://devopscube.com/setup-kubernetes-cluster-kubeadm/\n- https://kubernetes.io/docs/setup/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesrack%2Fkubernetes-setup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmilesrack%2Fkubernetes-setup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmilesrack%2Fkubernetes-setup/lists"}