{"id":18755978,"url":"https://github.com/osama-yusuf/kubernetes-init-cluster","last_synced_at":"2026-04-08T23:34:15.342Z","repository":{"id":162116711,"uuid":"541313399","full_name":"Osama-Yusuf/Kubernetes-init-cluster","owner":"Osama-Yusuf","description":"Initialize k8s cluster with bash, ansible, AWS, \u0026 terraform","archived":false,"fork":false,"pushed_at":"2024-02-22T23:07:46.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-16T18:20:08.912Z","etag":null,"topics":["ansible","aws","bash-script","kubernetes","terraform"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Osama-Yusuf.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":"2022-09-25T21:24:28.000Z","updated_at":"2024-03-26T14:25:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"ce59b812-9431-49bc-8c6f-0167f15faa70","html_url":"https://github.com/Osama-Yusuf/Kubernetes-init-cluster","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Osama-Yusuf/Kubernetes-init-cluster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osama-Yusuf%2FKubernetes-init-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osama-Yusuf%2FKubernetes-init-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osama-Yusuf%2FKubernetes-init-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osama-Yusuf%2FKubernetes-init-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Osama-Yusuf","download_url":"https://codeload.github.com/Osama-Yusuf/Kubernetes-init-cluster/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Osama-Yusuf%2FKubernetes-init-cluster/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31579056,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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","aws","bash-script","kubernetes","terraform"],"created_at":"2024-11-07T17:34:45.015Z","updated_at":"2026-04-08T23:34:15.325Z","avatar_url":"https://github.com/Osama-Yusuf.png","language":"Shell","funding_links":["https://paypal.me/OsamaYusuf","https://www.buymeacoffee.com/OsamaYusuf"],"categories":[],"sub_categories":[],"readme":"# Kubernetes Init Cluster\n**Kubernetes-init-cluster** is a **BASH** script that can be used to provision 3 instances on aws with bash \u0026 terraform then initialize the infrastructure using ansible playbooks.\n\nYou can take a look at the [GitHub project page](https://github.com/Osama-Yusuf/Kubernetes-init-cluster).\n\n---\n\n## Getting started:\n\n### Prerequisites:\n\u003c!-- - [Terraform](https://www.terraform.io/downloads.html) --\u003e\n\u003c!-- - [Ansible](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html) --\u003e\n\u003c!-- - [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html) --\u003e\n\u003c!-- - [AWS Account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/) --\u003e\n- Terraform\n   ```\n   source \u003c(curl -s https://raw.githubusercontent.com/Osama-Yusuf/Linux-Apps-Installation-Scripts/main/DevOps/terraform.sh)\n   ```\n- Ansible\n   ```\n   sudo apt-add-repository ppa:ansible/ansible\n   sudo apt update\n   sudo apt install ansible\n   ```\n- AWS CLI\n   ```\n   curl \"https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip\" -o \"awscliv2.zip\" \u0026\u0026 unzip awscliv2.zip\n   sudo ./aws/install \u0026\u0026 rm -rf aws awscliv2.zip\n   ```\n- [AWS Account](https://aws.amazon.com/premiumsupport/knowledge-center/create-and-activate-aws-account/)\n   - [Create an IAM User](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_users_create.html)\n   - [Configure the AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html)\n\n### Install:\n```\ngit clone https://github.com/Osama-Yusuf/Kubernetes-init-cluster.git\ncd Kubernetes-init-cluster \u0026\u0026 chmod +x hostname.sh \n```\n\n### Usage:\n```\n./hostname.sh [OPTION]\n   -y  Provision infra with terraform, else you will be prompted for ips, keys, etc.\n   -d  Delete all files created by hostname.sh (ansible, inventory, etc.) else you will use them if they exist\nExample: ./hostname.sh -y -d\n```\n\n---\n\n## What it does:\n\n### 1. Provisions 3 \"t2.medium\" ec2's using terraform\n- #### Creates a key if not exists\n- #### query default vpc \u0026 security group ids\n- #### query ubuntu 20.04 ami in current region\n- #### Then It creates 3 ec2's by for-looping these strings (master, worker1, worker2)\n\n### 2. Then it initializes the cluster using bash script \u0026 ansible playbooks by:\n- #### creating inventory file and hosts file to be copied to all nodes in the cluster \n- #### and install \u0026 initialize kubeadm \u0026 kubectl with k8s_init.sh script also copied to all nodes and then executed using ansible playbook\n- #### then it creates kubeadm token file on the master node\n- #### then it copies the token to the worker nodes and executes it\n- #### after that the playbook apply the calico network plugin\n\n### After execution 3 instances will be up \u0026 running on aws (master, worker1, \u0026 worker2) initialized with kubeadm \u0026 kubectl \n### Then it will ssh into master node for you to start working/studying k8s\n\n---\n\n## Tested Environments\n\n* Ubuntu 20.04.\n\n   If you have successfully tested this script on others systems or platforms please let me know!\n\n---\n\n## Support\n\n If you want to support this project, please consider donating:\n * PayPal: https://paypal.me/OsamaYusuf\n * Buy me a coffee: https://www.buymeacoffee.com/OsamaYusuf\n * ETH: 0x507bF8931b534a81Ced18FDf8fc5BE4Daf08332B\n\n---\n\n* `By Osama-Yusuf`\n* `Thanks for reading`\n\n-------\n##### Report bugs for \"Kubernetes-Init-Cluster\"\n* `osama9mohamed5@gmail.com`\nThis project is tested with BrowserStack\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosama-yusuf%2Fkubernetes-init-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fosama-yusuf%2Fkubernetes-init-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fosama-yusuf%2Fkubernetes-init-cluster/lists"}