fix(eks-lifecycle): 00-auth.sh kubectl reachability check inside admin subshell - #405
Conversation
…n subshell 2026-05-16 cold-start recreate live run の Phase 9 で 60-flux-bootstrap.sh が 'Cluster not reachable. Setting CLUSTER_EXISTS=false' で誤判定し exit、 manual bypass で workaround した bug の正式 fix。 旧 code: aws eks update-kubeconfig は subshell 内で admin creds 使うが、 kubectl get nodes は subshell 外で実行され、 親 shell の operator IAM principal (= panicboat user 等) で kubectl exec plugin (= aws eks get-token) が動作。 operator が EKS aws-auth に未登録のケース (= access_entries に eks-admin role のみ登録) で 401 → CLUSTER_REACHABLE=false の誤判定。 新 code: aws eks update-kubeconfig + kubectl get nodes を同 subshell に 集約 (= 両者 admin creds で実行)。 subshell 終了後 CLUSTER_REACHABLE 判定 のみ親 shell で実施。 Signed-off-by: panicboat <panicboat@gmail.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
2026-05-16 cold-start recreate live run の Phase 9 で `60-flux-bootstrap.sh` が `Cluster not reachable. Setting CLUSTER_EXISTS=false` で誤判定し exit した bug の fix。
Symptom
`60-flux-bootstrap.sh` が cluster 起動済の状態で `CLUSTER_EXISTS=false` 判定 → `Cluster not reachable. Run make eks-recreate-aws ENV=production first.` で exit 1。 live run では script bypass で manual に hydrate / kubectl apply / Flux setup を実行する workaround を取った。
Root cause
`00-auth.sh` の cluster reachability check:
```bash
(
AWS_*_KEY = admin creds
aws eks update-kubeconfig ...
) && CLUSTER_REACHABLE="true" || CLUSTER_REACHABLE="false"
if [ "$CLUSTER_REACHABLE" = "true" ] && kubectl get nodes >/dev/null 2>&1; then
```
Fix
`aws eks update-kubeconfig` + `kubectl get nodes` を同 subshell に集約:
```bash
(
AWS_*_KEY = admin creds
if aws eks update-kubeconfig ... && \
kubectl get nodes >/dev/null 2>&1; then
exit 0
fi
exit 1
) && CLUSTER_REACHABLE="true" || CLUSTER_REACHABLE="false"
if [ "$CLUSTER_REACHABLE" = "true" ]; then
ok "Cluster reachable via admin role"
...
```
両者 admin creds で実行 + subshell 終了後 CLUSTER_REACHABLE 判定のみ親 shell。
Test plan
Related