{"id":19052952,"url":"https://github.com/kayvansol/kubernetes","last_synced_at":"2026-04-14T15:31:32.301Z","repository":{"id":224813784,"uuid":"764295648","full_name":"kayvansol/Kubernetes","owner":"kayvansol","description":"On-Premises Multi Master Kubernetes Cluster Deployment with HAProxy via Ansible and kubeadm","archived":false,"fork":false,"pushed_at":"2024-03-29T17:48:52.000Z","size":778,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-12T15:12:21.324Z","etag":null,"topics":["ansible","calico-cni","cri-docker","docker","haproxy","kubeadm","kubectl","kubelet","kubernetes","linux","ubuntu"],"latest_commit_sha":null,"homepage":"https://medium.com/@kayvan.sol2/deploying-kubernetes-on-permises-cluster-133e3030720d","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/kayvansol.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":"2024-02-27T20:30:21.000Z","updated_at":"2025-01-15T07:40:36.000Z","dependencies_parsed_at":"2024-03-27T23:21:44.223Z","dependency_job_id":"63392bab-4f37-48de-ac88-7bd970b15d36","html_url":"https://github.com/kayvansol/Kubernetes","commit_stats":null,"previous_names":["kayvansol/ansibles"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kayvansol/Kubernetes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FKubernetes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FKubernetes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FKubernetes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FKubernetes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kayvansol","download_url":"https://codeload.github.com/kayvansol/Kubernetes/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kayvansol%2FKubernetes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31803181,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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","calico-cni","cri-docker","docker","haproxy","kubeadm","kubectl","kubelet","kubernetes","linux","ubuntu"],"created_at":"2024-11-08T23:28:33.544Z","updated_at":"2026-04-14T15:31:32.273Z","avatar_url":"https://github.com/kayvansol.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/kubernetes.gif?raw=true)\n\nThis repository is for deploying kubernetes on-permises cluster (bare-metal servers). \n\nThe kubernetes folder contains the files for preparing server to install kubernetes cluster or join to the cluster.\n\nPlease run the following script on all servers :\n\n```\n sudo ansible servers -m ping -i inventory.ini -u root\n \n sudo ansible-playbook -i inventory.ini Kubernetes/ServerPrepare.yml -u root\n```\n\nKubernetes Cluster :\n\nThe control-plane nodes addresses are :\n\n    192.168.56.120\n    192.168.56.121\n    192.168.56.122\n\nThe worker nodes addresses are :\n\n    192.168.56.123\n    192.168.56.124\n\nThe vms hosted on virtualbox are like the below schema :\n\n![alt text](https://raw.githubusercontent.com/kayvansol/Ingress/main/pics/vmnet.png?raw=true)\n\nHAProxy server (Load Balancer for kube apiserver) address is : \n```\n192.168.56.118 \n```\n\nhaproxy.cfg :\n\n    stats enable\n    (frontend bind to 192.168.56.118:6443)\n    (backend  bind to 192.168.56.120:6443  192.168.56.121:6443  192.168.56.122:6443)\n\nFor starting a Kubernetes cluster, follow the below lines :\n\nRun below scripts only on 192.168.56.120 :\n\n```\nsudo kubeadm init  --control-plane-endpoint=\"192.168.56.118:6443\"   \n      --upload-certs  --apiserver-advertise-address=192.168.56.120\n      --pod-network-cidr=192.168.0.0/16  \n      --cri-socket=unix:///var/run/cri-dockerd.sock  \n      --ignore-preflight-errors=all \n```\n\nAnd below code for all nodes :\n\n```\nmkdir -p $HOME/.kube\nsudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config\nsudo chown $(id -u):$(id -g) $HOME/.kube/config\n```\n\nInstall Calico network policy for on-premises deployments, 50 nodes or less :\n```\ncurl https://raw.githubusercontent.com/projectcalico/calico/v3.27.2/manifests/calico.yaml -O\n\nkubectl apply -f calico.yaml\n```\n\nand run the below on other servers to join to the cluster :\n\nOn control-plane (e.g. 192.168.56.122) :\n\n```\nkubeadm join 192.168.56.118:6443 --token c4c6wt.2rzubblajmxx7wf1 \\\n     --discovery-token-ca-cert-hash sha256:91877d933445148c650e5fa11acca05d455fe1e9e53cd33f8497ad06a2126142 \\\n     --control-plane --certificate-key 2e8c3d0a1f2d4aec3e4ccb09a0dd6f43756344269c0b414cdd83c0ef02c0293d \\\n     --apiserver-advertise-address=192.168.56.122 \n     --cri-socket=unix:///var/run/cri-dockerd.sock \n     --ignore-preflight-errors=all\n```\nOn worker nodes :\n```\nkubeadm join 192.168.56.118:6443 --token  c4c6wt.2rzubblajmxx7wf1 \\\n     --discovery-token-ca-cert-hash sha256:91877d933445148c650e5fa11acca05d455fe1e9e53cd33f8497ad06a2126142 \\\n     --cri-socket=unix:///var/run/cri-dockerd.sock \n     --ignore-preflight-errors=all\n```\n\nand at final step enjoy from your cluster :\n\n```\nkubectl get nodes -o wide\n\nkubectl get pod -A\n```\n![alt text](https://github.com/kayvansol/Ansibles/blob/main/Images/1.jpeg?raw=true)\n\n![alt text](https://github.com/kayvansol/Ansibles/blob/main/Images/2.jpeg?raw=true)\n\nHAProxy Stats :\n\n![alt text](https://github.com/kayvansol/Ansibles/blob/main/Images/3.jpeg?raw=true)\n\nhaproxy.cfg :\n\n![alt text](https://github.com/kayvansol/Ansibles/blob/main/Images/4.jpeg?raw=true)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayvansol%2Fkubernetes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkayvansol%2Fkubernetes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkayvansol%2Fkubernetes/lists"}