Get ingress-controller pod name
Add an option to find the ingress-controller pod name to exclude the admission pod The original "kubectl get pod" will sometime return the admission pod which is in completed status.
This commit is contained in:
parent
47b5e20a88
commit
e8212d6594
1 changed files with 1 additions and 1 deletions
|
@ -197,7 +197,7 @@ To detect which version of the ingress controller is running, exec into the pod
|
|||
|
||||
```console
|
||||
POD_NAMESPACE=ingress-nginx
|
||||
POD_NAME=$(kubectl get pods -n $POD_NAMESPACE -l app.kubernetes.io/name=ingress-nginx -o jsonpath='{.items[0].metadata.name}')
|
||||
POD_NAME=$(kubectl get pods -n $POD_NAMESPACE -l app.kubernetes.io/name=ingress-nginx --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}')
|
||||
|
||||
kubectl exec -it $POD_NAME -n $POD_NAMESPACE -- /nginx-ingress-controller --version
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue