Giter VIP home page Giter VIP logo

kubernetes-cluster-aws-setup's Introduction

aws-kubernetes-cluster-setup

Setup kubernets cluster on aws EC2 with terraform

Creating A Kubernetes Cluster with Kubeadm using Terraform and AWS EC2

Run in AWS Cloud9

git clone https://github.com/bolecodex/k8s.git
cd k8s/terraform-k8s-kubeadm-ec2-cluster
terraform init

Change the main.tf file to specify the cluster and key pair index

terraform apply --auto-approve
# Wait for around 5 minutes

SSH into the control plane and worker node

cd k8s/terraform-k8s-kubeadm-ec2-cluster
ssh -i ./k8s-kp-x.pem ubuntu@ec2-<ip-address>.compute-1.amazonaws.com

Use SSH Tools

# Download and install WindTerm https://github.com/kingToolbox/WindTerm

Add auto-completion and shortcuts in control plain nodes

vim ~/.bashrc
# Press Shift + g to go to the bottom of file, press o to enter insert mode. Copy the following four lines. 
source <(kubectl completion bash)
alias k=kubectl
export do="--dry-run=client -o yaml"
# PS1="\[\033[01;32m\]cp\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]$(__git_ps1 " (%s)" 2>/dev/null) $ "

# press Esc to exit insert mode, type :wq and the press enter
source ~/.bashrc
# rm -rf * # Optional: remove unnecessary files in home directory

Cleanup in AWS Cloud9

cd k8s/terraform-k8s-kubeadm-ec2-cluster
terraform destroy --auto-approve
# Wait for around 3 minutes

For CentOs version, please refer to code repo of the The AWS Way โ€” IaC in Action โ€” Creating A Kubernetes Cluster with Kubeadm using Terraform and AWS EC2 blog.

kubernetes-cluster-aws-setup's People

Contributors

shukui avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.