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:
Wilson Mo 2020-06-28 17:43:27 +08:00 committed by GitHub
parent 47b5e20a88
commit e8212d6594
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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
```