- Small test Kubernetes environment built on AWS EKS using Terraform
-
Have an AWS account with your access and secret key ready and exported to local env variables
-
e.g. export AWS_ACCESS_KEY_ID="$myID" && export AWS_SECRET_ACCESS_KEY="$myKEY"
-
Download + install terraform
-
Download + install kubectl
-
Download + install heptio-authenticator-aws
-
sudo su
-
clone repo
-
cd .. cluster
-
terraform init
-
terraform plan
-
terraform apply
Now the cluster will build. This will take approx 10 minutes.
-
mkdir ~/.kube/
-
touch ~/.kube/config
-
terraform output kubeconfig > ~/.kube/config
-
kubectl get pods
If everything is installed and setup correctly you should ge the message 'No resources found.'
-
terraform output config-map-aws-auth > aws-auth.yaml
-
kubectl apply -f aws-auth.yaml
-
kubectl get nodes
-
cd ../kubernetes/
-
terraform init
-
terraform plan
-
terraform apply
-
kubectl get service -n demo-service -o wide
-
kubectl get pods -n demo-service
-
kubectl get service -n demo-service
To verify
- curl http://$EXTERNAL-IP(ELB provided in the get service output):8080
There is currently no free tier for EKS. Current usage rates are $0.20 per hour.
Next will add steps to setup monitoring (access kube dashboard + grafana graphs for metrics)