Skip to content

Fix kubectl-in-curlimages/curl: use DNS name instead of command substitution - #397

Draft
dgkanatsios with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-review-comment-suggestion
Draft

Fix kubectl-in-curlimages/curl: use DNS name instead of command substitution#397
dgkanatsios with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-review-comment-suggestion

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown

curlimages/curl doesn't ship kubectl, so $(kubectl get svc my-app-svc -o jsonpath="{.spec.clusterIP}") inside that pod silently fails. The canary exercise also needs to run the curl from inside the cluster since ClusterIP isn't reachable from the host.

Changes

  • c.pod_design.md: Replace the broken host-shell while/curl/kubectl get svc pattern with a self-contained throwaway pod that curls the service by DNS name:
# Before
while sleep 0.1; do curl $(kubectl get svc my-app-svc -o jsonpath="{.spec.clusterIP}"); done

# After
kubectl run curl --image=curlimages/curl --rm -it --restart=Never -- \
  sh -c 'while sleep 0.1; do curl my-app-svc; done'

Using the in-cluster DNS name (my-app-svc) eliminates the need for kubectl inside the pod entirely.

Copilot AI changed the title [WIP] Fix the code according to review comment Fix kubectl-in-curlimages/curl: use DNS name instead of command substitution Aug 3, 2026
Copilot AI requested a review from dgkanatsios August 3, 2026 04:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants