iac.htora.dev · security templates

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.

GKEEKS
Audit logChanges on; reads offAll off until switched on
Keep a nodeAutoscaler annotation, cordonTermination and scale-in protection, annotation, cordon
No node accessAutopilot: do not cordonFargate and Auto Mode
Managed detectionContainer Threat DetectionGuardDuty EKS Protection, Runtime Monitoring

Commands

GKE: exec in the audit loggcloud logging read 'protoPayload.methodName=~"io.k8s.core.v1.pods.exec"'
GKE: a node's disksgcloud compute instances describe <node> --zone <zone> --format='value(disks[].source)'
EKS: turn the audit log onaws eks update-cluster-config --name <cluster> --logging '{"clusterLogging":[{"types":["audit"],"enabled":true}]}'
EKS: protect a nodeaws 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.

Read the full pageDownload PDF

Registry 0.23.0. Built 2026-11-17.

Made by Habibullah Tora. Source on GitHub. Code under the MIT licence, writing under CC BY 4.0.