Skip to content

Instantly share code, notes, and snippets.

@r3code
Last active April 2, 2021 10:27
Show Gist options
  • Save r3code/e3c588a94a1c4fb86965c1f4d4f1c295 to your computer and use it in GitHub Desktop.
Save r3code/e3c588a94a1c4fb86965c1f4d4f1c295 to your computer and use it in GitHub Desktop.
Execute command in Kubernetis Pod
ENV_NAME=some_branch
POD_NAME=`kubectl get pods -n $ENV_NAME | grep pod_name_part- | head -n 1 | awk '{print $1}'`; print $POD_NAME
kubectl exec -n $ENV_NAME $POD_NAME -- /app/appctl arg1 arg2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment