In order to deploy this EKS Enviroment:
- Do a
git clone https://github.com/jasonumiker/eks-school
to clone this project to your home directory - Ensure you have nodejs 10 or greater and python 3 or greater installed. On a Mac this is
brew install node
andbrew install python
- Install the CDK with a
sudo npm install -g --upgrade aws-cdk
- If you have a hosted zone,
export CDK_HOSTEDZONEID=<hostedzoneID from console>
,export CDK_HOSTEDZONENAME=<domainname.abc.xyz>
- Paste in the environment variables for temporary admin role access to an account
- Run
./bootstrap.sh
- Run
./deploy.sh
- If you had a hosted zone, go to https://codeserver.<domainname.abc.xyz> , otherwise, find the ALB address and go to it on http://
- The password is the instance id of EKSEnvironmentStack/CodeServerInstance (find in the EC2 console)
- Open a new Terminal (click the hamburger in the upper left) and run the command
aws eks update-kubeconfig --name cluster
- Run a
kubectl get nodes
to confirm everything is working - This project should have been git cloned to the bastion - cd to
eks-school
- Run
kubectl apply -f nyancat.yaml
to deploy a test workload - Wait a couple minutes then find the ALB address with a
kubectl get ingress -A
- Go to that address for some nyancat fun...
And then you're ready go go!
Note that because we are accessing VS Code through a insecure HTTP you need to insert into this by going Shift+Insert instead of Ctrl-V. On the Macbook Insert is Fn+Return so it is Shift+Fn+Return.
The above instructions get you working from a cloud-based VS Code Bastion. Alternatively, the stack has an output with an aws eks update-kubeconfig
command that inclues a --role-arn
in it. If you run that on your laptop where the AWS CLI is working with an administrative role then that will set up your ~/.kube/config in a way that kubectl will work that way too (as this EKS is Public and Private).
If you'd like to use the Lens IDE then get it from https://github.com/lensapp/lens/releases and run it from the terminal after you have gotten it to a point where kubectl works (so it can see the environment variables you pasted in with our temporary credentials).