Home/Refreshers/Containers on GKE and EKS: refresher
Containers on GKE and EKS
What each cloud records about a cluster, how to keep a node, and what to rely on when you cannot reach it.
| GKE | EKS | |
|---|---|---|
| Audit log | Changes on; reads off | All off until switched on |
| Keep a node | Autoscaler annotation, cordon | Termination and scale-in protection, annotation, cordon |
| No node access | Autopilot: do not cordon | Fargate and Auto Mode |
| Managed detection | Container Threat Detection | GuardDuty EKS Protection, Runtime Monitoring |
Commands
| GKE: exec in the audit log | gcloud logging read 'protoPayload.methodName=~"io.k8s.core.v1.pods.exec"' |
| GKE: a node's disks | gcloud compute instances describe <node> --zone <zone> --format='value(disks[].source)' |
| EKS: turn the audit log on | aws eks update-cluster-config --name <cluster> --logging '{"clusterLogging":[{"types":["audit"],"enabled":true}]}' |
| EKS: protect a node | aws ec2 modify-instance-attribute --instance-id <id> --disable-api-termination |
Watch out
- Autopilot repairs a node cordoned for about 10 minutes.
- Termination protection does not stop an Auto Scaling group. Add scale-in protection.
- On Fargate, the pod's storage is deleted when it stops.
Check it worked
A test exec shows in the audit log with the user, and a captured node survives an autoscaler cycle.