1

I am using K8S version 19.

I tried to install second nginx-ingress controller on my server (I have already one for Linux so I tried to install for Windows as well)

helm install nginx-ingress-win ingress-nginx/ingress-nginx 
-f internal-ingress.yaml 
--set controller.nodeSelector."beta\.kubernetes\.io/os"=windows 
--set defaultBackend.nodeSelector."beta\.kubernetes\.io/os"=windows 
--set controller.admissionWebhooks.patch.nodeSelector."beta\.kubernetes\.io/os"=windows 
--set tcp.9000="default/frontarena-ads-win-test:9000"

This failed with "Error: failed pre-install: timed out waiting for the condition".

So I have run helm uninstall to remove that chart

helm uninstall nginx-ingress-win
release "nginx-ingress-win" uninstalled

But I am getting Validation Webhook Pod created constantly

kubectl get pods
NAME                                                      READY   STATUS              RESTARTS   AGE

nginx-ingress-win-ingress-nginx-admission-create-f2qcx    0/1     ContainerCreating   0          41m

I delete pod with kubectl delete pod but it get created again and again.

I tried also kubectl delete -A ValidatingWebhookConfiguration nginx-ingress-win-ingress-nginx-admission but I am getting message not found for all combinations. How I can resolve this and how I can get rid off this? Thank you!!!

vel
  • 1,000
  • 1
  • 13
  • 35

1 Answers1

1

If this Pod is managed by a Deployment,StatefulSet,DaemonSet etc., it will be automatically recreated every time you delete it, so trying to remove a Pod in most situations makes not much sense.

If you want to check what controlls this Pod, run:

kubectl describe pod nginx-ingress-win-ingress-nginx-admission-create-f2qcx | grep Controlled

You would probably see some ReplicaSet, which is also managed by a Deployment or another object. Suppose I want to check what I should delete to get rid of my nginx-deployment-574b87c764-kjpf6 Pod. I can do this as follows:

$ kubectl describe pod nginx-deployment-574b87c764-kjpf6 | grep -i controlled
Controlled By:  ReplicaSet/nginx-deployment-574b87c764

then I need to run again kubectl describe on the name of the ReplicaSet we found:

$ kubectl describe rs nginx-deployment-574b87c764 | grep -i controlled
Controlled By:  Deployment/nginx-deployment

Finally we can see that it is managed by a Deployment named nginx-deployment and this is the resource we need to delete to get rid of our nginx-deployment-574b87c764-kjpf6 Pod.

mario
  • 9,858
  • 1
  • 26
  • 42
  • THANK YOU!!! You are real expert! In my case it was some job that was controlling this creation so I did `kubectl delete job nginx-ingress-win-ingress-nginx-admission-create` and it resolved the issue. But your explanation is great because you provided solution for general case that can serve for everyone!!! Amazing! – vel Mar 19 '21 at 18:51
  • can you maybe assist me with my second trouble as well please? Thank you https://stackoverflow.com/questions/66709259/kubernetes-cannot-have-windows-path-mounted-on-azure-file-share-linux-mountin – vel Mar 19 '21 at 18:51