basic example of AWS EKS
$ terraform apply
$ aws eks update-kubeconfig --name hello-eks
$ kubectl run nginx --image nginx
permissions to view resources https://docs.aws.amazon.com/eks/latest/userguide/view-kubernetes-resources.html#view-kubernetes-resources-permissions
$ kubectl apply -f https://s3.us-west-2.amazonaws.com/amazon-eks/docs/eks-console-full-access.yaml
TODO: figure out how to fix for k8s 1.22+
Docs: https://github.com/kubernetes/dashboard/releases
$ kubectl proxy
# enter token from TF output
$ kubectl apply -f k8s/kuard
$ kubectl port-forward service/kuard 8080:http
TODO: review and cleanup
See https://docs.aws.amazon.com/eks/latest/userguide/aws-load-balancer-controller.html
-
on each worker,
- kube-proxy listens on random port (31596)
- iptables rule configured to redirect from 31596 to every svc pod IP
- each has their own random probability
- but.. evens out based on math (rules execed sequentially)
- each has their own random probability
-
ELB has targets for each host's kube-proxy random port (31596). e.g., 4 targets
- requests to ELB distributed mostly evenly
- ELB request arrives at target, then may be re-routed to another host even if the target has svc pod available
-
each worker,
- kube-proxy listens on random port (31305)
- iptables rule similar
-
NLB health target is port 31612, bound to kube-proxy
- no iptables rules
- path /healthz
- remove /index.html from one pod
- health check doesn't detect it