If you are studying Kubernetes and having a hard time running Minikube on an EC2 Instance, you are not alone. I had a hard time doing it when it was my first time.
Below are the steps (and some comments) that I took to help me run Minikube on my EC2 Instance.
Installation of Minikube on EC2 Ubuntu
1. Run a public EC2 Server with the following setup
|AMI||Ubuntu Server 18.04 LTS (HVM), SSD Volume Type|
|Instance Type||t3.micro (2 vCPU, 1GB Memory)|
|Storage||8 GB (gp2)|
|Tags||– Key: Name
– Value: Minikube
|Security Group||Name: Minikube Security Group
Later we will be editing this.
|Key Pair||Create your own keypair.
You will need this to SSH to your EC2 Instance
Update: I changed the Instance Type from t2.micro (1 vCPU) to t3.micro (2 vCPU). An update to Minikube required a minimum of 2 vCPUs. The error when running with t2.micro was
Requested cpu count 1 is less than the minimum allowed of 2.
t3.micro is no longer in the Free Tier, make sure to stop or terminate the instance after you are done testing to avoid a huge AWS bill.
Thank you to everyone in the comments section who pointed this change.
2. SSH into your created EC2 Instance using your keypair.
ssh ubuntu@<ipv4_public_ip> -i <keypair>.pem
3. Install kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
4. Install Docker
sudo apt-get update && \ sudo apt-get install docker.io -y
Minikube requires Docker. Continue reading Running Minikube in AWS EC2 (Ubuntu)