AWS EC2 — Fully automated installation of Kubernetes cluster (master node) — User Data

  • Preparing prerequisites
  • Installing Docker
  • Be sure to understand, if you follow official Kubernetes documentation, in Ubuntu 20 it does not work, that is why, I did modification to script
  • Adding Kubernetes repositories
  • Turning off swap
  • Installing Kubernetes tools
  • next line is getting EC2 instance IP, for kubeadm to initiate cluster
  • Kubernetes cluster init
  • Installing network CNI, here are examples of Calico and Flannel, but you can replace with others
  • Do you need more nodes? Uncomment below
  • Uncomment to untaint master node
  • Uncomment to install helm
  • Cloud Formation Template — get it from Github
  1. Check it yourself , for example on https://www.base64encode.org/
  2. If you change something in User Data, you will need to replace User Data (between double quotes)
  3. You need to provide Security Group, Subnet, and KeyPair name
  4. AMI is for us-east-1 - change ami and/or EC2 instance type , if you need something different

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store