{"id":19522387,"url":"https://github.com/akashkatakam/k8s","last_synced_at":"2026-04-05T21:05:40.402Z","repository":{"id":75902604,"uuid":"239634045","full_name":"akashkatakam/k8s","owner":"akashkatakam","description":"Ansible playbooks to bootstrap kubernetes HA cluster on AWS","archived":false,"fork":false,"pushed_at":"2020-04-03T22:59:27.000Z","size":46,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T14:16:29.793Z","etag":null,"topics":["ansible","containers","devops","docker","kops","kubernetes","linux","orchestration"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":false,"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/akashkatakam.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":"2020-02-10T23:19:46.000Z","updated_at":"2020-05-01T02:40:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"736d06d2-78db-4b7b-a337-5f067c89985f","html_url":"https://github.com/akashkatakam/k8s","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/akashkatakam%2Fk8s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashkatakam%2Fk8s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashkatakam%2Fk8s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/akashkatakam%2Fk8s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/akashkatakam","download_url":"https://codeload.github.com/akashkatakam/k8s/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240771905,"owners_count":19854982,"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":["ansible","containers","devops","docker","kops","kubernetes","linux","orchestration"],"created_at":"2024-11-11T00:38:46.265Z","updated_at":"2025-12-30T22:48:12.968Z","avatar_url":"https://github.com/akashkatakam.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s\n\n## Team Information\n\n| Name | NEU ID | Email Address |\n| --- | --- | --- |\n| Akash Katakam | 001400025 | katakam.a@husky.neu.edu |\n| Ravi Kiran    | 001439467 | lnu.ra@husky.neu.edu |\n| Veena Iyer    | 001447061 | iyer.v@husky.neu.edu|\n\n## Pre-requisites\nYou need to configure the following first before using this playbook:\n1. Add AWS credentials of member accounts-  KOPS\n3. Create S3 bucket for KOPS State Store\n4. Generate new SSH key for connecting to bastion node\n\n\n### 1. Create IAM users\nCreate a new IAM user in each member accounts having console as well as programmatic access. Attach followig policies to these users:\n\n1. AdministratorAccess\n2. AmazonRoute53FullAccess\n3. AmazonS3FullAccess\n4. IAMFullAccess\n5. AmazonEC2FullAccess\n6. AmazonVPCFullAccess\n\n\u003e Note: Make sure you download the Access Keys file (*.csv) for each user. These keys will be used to setup profiles in the next step.\n\n### 2. Setting up AWS profiles of member accounts\nOpen `~/.aws/credentials` in any text editor. It should look like the following:\n```\n[kops]\naws_access_key_id = \u003caws-access-key-id-of-root-account\u003e\naws_secret_access_key = \u003caws-secret-access-key-for-root-account\u003e\n\n```\n\nAppend credentials of your member accounts, and tag them with profile names. In our case, it is `dev` and `prod`, which represent our different environments.\n\n```ini\n[kops]\naws_access_key_id = \u003caws-access-key-id-for-root-account\u003e\naws_secret_access_key = \u003caws-secret-access-key-for-root-account\u003e\n\n[dev]\naws_access_key_id = \u003caws-access-key-id-for-dev-account\u003e\naws_secret_access_key = \u003caws-secret-access-key-for-dev-account\u003e\n\n[prod]\naws_access_key_id = \u003caws-access-key-id-for-prod-account\u003e\naws_secret_access_key = \u003caws-secret-access-key-for-prod-account\u003e\n```\n\n### 3. Create DNS hosted zones\n\u003eNote: It is assumed that you have a DNS Hosted Zone in your root account, from the course CSYE6225\n\nFor kops/k8s we need to have a domain/hosted zone. Create public DNS hosted zones using the AWS Route 53 service for each of your member accounts. Name these Hosted Zones as follows:\n\n`\u003cenvironment\u003e.\u003cdomain-name\u003e`. \n\nIn our case: `k8s.dev.\u003cdomain-name\u003e` and `k8s.prod.\u003cdomain-name\u003e`\n\n### 4. Create S3 bucket for KOPS State Store\n\nCreate an S3 bucket in `us-east-1` region for each of your member accounts.\n\n`k8s.\u003cenvironment\u003e.\u003cdomain-name\u003e-state-store`\n\nIn our case: `dev.\u003cdomain-name\u003e-state-store` and `prod.\u003cdomain-name\u003e-state-store`\n\n### 6. Generate new SSH key for connecting to bastion host\n\nCreate a new SSH key using the following command:\n\n```sh\nssh-keygen rsa -C \"your_email_id\"\n\n```\n\n## Create/Delete Kubernetes cluster\n\nRun the playbook `webservers.yml` in the root of the repository with extra variables (some are required).\n\n```sh\nansible-playbook webservers.yal --extra-vars \"\u003cvariable-key\u003e=\u003cvariable-value\u003e\"\n\n```\n### **Given below is the list of accepted variables.**\n\n| Key | Required | Default | Values |\n| --- | --- | --- | --- |\n| command | Yes |  | String - start \\| delete |\n| kops_state_store | Yes |  | String - ARN of the s3 bucket. Eg. s3://s3bucketname |\n| cluster_name | Yes |  | String - Name of the cluster created. Eg. cluster.example.com |\n| dns_zone_id | Yes (if command=start) |  | String - DNS ZONE ID of the private hosted zone (Can be found in Route 53) |\n| public_dns_zone_id | Yes | | String - DNS ZONE ID of the public hosted zone (Can be found in Route 53) |\n| public_domain_name | Yes | | String - Name of your domain |\n| node_count | No | 3 | Number - Number of worker nodes |\n| ssh_path | No |  | String - Path of the public SSH key previously generated |\n| master_count | No | 3 | Number - Number of Master Nodes |\n| node_size | No | t2.medium | String - Type of EC2 Instance |\n| master_size | No | t2.medium | String - Type of EC2 Instance |\n| topology | No | private | String - public \\| private |\n| networking | No | weave | String - Networking mode to use. kubenet \\| classic \\| external \\| kopeio-vxlan (or kopeio) \\| weave \\| flannel-vxlan (or flannel) \\| flannel-udp \\| calico \\| canal \\| kube-router \\| romana \\| amazon-vpc-routed-eni \\| cilium \\| cni. |\n| bastion | No | true | Boolean - true \\| false |\n| dns | No | private | String - public \\| private |\n| cloud | No | aws | String - gce \\| aws \\| vsphere \\| openstack |\n| profile | No | dev | String - AWS named profile in `~/.aws/credentials` |\n| k8s_version | No | 1.13.0 | String - Kubernetes Version |\n\n\n### To create a Kubernetes Cluster use the following\n\nRun the following command in the root of the project\n\n```\nansible-playbook webservers.yml -e \"command=start clustername=\u003cname-of-your-cluster\u003e state_store=s3://\u003cname-of-your-s3-bucket\u003e node_count=2 node_size=t2.micro master_size=t2.micro dns_zone_id=\u003chosted-zone-id\u003e profile=\u003caws-profile\u003e k8s_version=\u003cversion\u003e ssh_path=\u003cssh_key\u003e region=\u003cregion\u003e\"\n```\n### To connect to the bastion node, use the ssh key passed in the previous command:- \n```sh\nssh -o \"IdentitiesOnly=yes\" -i /path/to/key admin@\"DNSNameOfLoadBalancer\"\n```\n\n### To delete a Kubernetes Cluster use the following\nRun the following command in the root of the project\n\n```\nansible-playbook webservers.yml -e \"command=stop clustername=\u003cname-of-your-cluster\u003e state_store=s3://\u003cname-of-your-s3-bucket\u003e node_count=2 node_size=t2.micro master_size=t2.micro dns_zone_id=\u003chosted-zone-id\u003e profile=\u003caws-profile\u003e k8s_version=\u003cversion\u003e ssh_path=\u003cssh_key\u003e region=\u003cregion\u003e\"\n```\n\n### To ssh into bastion node\n\n```sh\nssh -i \u003cYourPrivateKey\u003e ec2-user@\u003cPublic Dns Ip\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashkatakam%2Fk8s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakashkatakam%2Fk8s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakashkatakam%2Fk8s/lists"}