Conversation
Greptile SummaryThis PR adds minimal Kubernetes cluster test tooling for three cloud providers — AWS EKS Auto Mode, Azure AKS Automatic, and GCP GKE Autopilot — under Key observations:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant U as User
participant CS as create_cluster.sh
participant CP as Cloud Provider API
participant K as kubectl
participant DS as delete_cluster.sh
U->>CS: ./create_cluster.sh
CS->>CP: Create VPC/Network (GKE only)
CP-->>CS: Network ready
CS->>CP: Create cluster (eksctl / az aks / gcloud)
CP-->>CS: Cluster ready
CS->>CP: Get credentials (kubeconfig)
CP-->>CS: kubeconfig updated
CS-->>U: Cluster live
U->>K: kubectl apply -f inflate.yaml
K->>CP: Schedule Deployment (1 replica)
CP-->>K: Node provisioned, pod running
U->>K: kubectl get pods / nodes
K-->>U: Pod + node status
U->>K: kubectl delete -f inflate.yaml
K->>CP: Remove Deployment
CP-->>K: Node scaled down
U->>DS: ./delete_cluster.sh
DS->>CP: Delete cluster (--wait / synchronous)
CP-->>DS: Cluster deleted
DS->>CP: Delete residual firewall rules (GKE only)
CP-->>DS: Firewall rules removed
DS->>CP: Delete VPC/Network (GKE only)
CP-->>DS: Network deleted
DS-->>U: Teardown complete
Last reviewed commit: d695247 |
| gcloud compute firewall-rules list \ | ||
| --filter="network=${NETWORK_NAME} AND name~'^gke-'" \ | ||
| --format="value(name)" \ | ||
| --project "${PROJECT_ID}" |
There was a problem hiding this comment.
GKE Autopilot gk3- firewall rules may not be caught by this filter
GKE Autopilot (as opposed to Standard) sometimes creates firewall rules with a gk3- prefix (the "3" denoting the Autopilot generation) rather than the classic gke- prefix. The current filter name~'^gke-' would miss those rules, leaving them attached to the network and potentially causing the subsequent gcloud compute networks delete to fail.
Consider broadening the prefix filter to match both known prefixes:
| gcloud compute firewall-rules list \ | |
| --filter="network=${NETWORK_NAME} AND name~'^gke-'" \ | |
| --format="value(name)" \ | |
| --project "${PROJECT_ID}" | |
| gcloud compute firewall-rules list \ | |
| --filter="network=${NETWORK_NAME} AND (name~'^gke-' OR name~'^gk3-')" \ | |
| --format="value(name)" \ | |
| --project "${PROJECT_ID}" |
Summary
Testing