This is a shortened version of the Get Started.
- No manual operation from the Management Console.
- CFn stacks merged into one.
- 2 public subnets and 2 private subnets (with NAT gateways).
- Worker nodes launch into private subnets.
- Renamed some files and resources.
- Download
kubectl
andheptio-authenticator-aws
to current directory. - Upgrade to latest AWS CLI.
$ aws cloudformation deploy --template-file cfn.yml --capabilities CAPABILITY_IAM --stack-name eks-example
$ aws cloudformation describe-stacks --stack-name eks-example --query Stacks[0].Outputs
Edit k8s-config.yml
and k8s-configmap-aws.yml
.
Then, set KUBECONFIG
.
$ export KUBECONFIG=k8s-config.yml
$ ./kubectl apply -f k8s-configmap-aws.yml
$ ./kubectl get nodes
NAME STATUS ROLES AGE VERSION
ip-10-0-12-27.us-west-2.compute.internal Ready <none> 26s v1.10.3
ip-10-0-9-187.us-west-2.compute.internal Ready <none> 29s v1.10.3
Cool.
For instance, WordPress.
Before claiming a persistent volume, you need to define an EBS storage class and set it default.
$ ./kubectl apply -f k8s-storageclass-ebs-gp2.yml
$ ./kubectl get storageclass
NAME PROVISIONER AGE
gp2 (default) kubernetes.io/aws-ebs 13s
$ ./kubectl create secret generic mysql-pass --from-literal=password=THEMOSTSECUREPASSWORDEVER
$ ./kubectl create -f https://github.com/kubernetes/website/raw/master/content/en/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/mysql-deployment.yaml
This operation creates an EBS volume for persistent volume.
$ ./kubectl create -f https://github.com/kubernetes/website/raw/master/content/en/docs/tutorials/stateful-application/mysql-wordpress-persistent-volume/wordpress-deployment.yaml
And this operation creates a load balancer.
$ ./kubectl describe services wordpress
Ta-da!
You can access the load balancer's DNS name and you'll see the WP initial setting page!
$ ./kubectl delete secret mysql-pass
$ ./kubectl delete deployment -l app=wordpress
$ ./kubectl delete service -l app=wordpress
$ ./kubectl delete pvc -l app=wordpress
$ aws cloudformation delete-stack --stack-name eks-example