I want to install nginx-controller in my Kubernetes cluster. I setup my master node at one server, and worker node at another server. I am using Ubuntu 20.04.
I followed the link (https://github.com/kubernetes/ingress-nginx/blob/main/deploy/static/provider/cloud/1.23/deploy.yaml) and use ‘kubectl apply -f file_name.yaml‘ to install the controller.
When I get the pods, it showed:
ubuntu@masternode:~/hello_deploy$ kubectl get pod -n ingress-nginx
NAME READY STATUS RESTARTS AGE
ingress-nginx-admission-create-lrzll 1/1 Running 0 27s
ingress-nginx-admission-patch-x46xh 1/1 Running 0 27s
ingress-nginx-controller-7575567f98-s9968 0/1 ContainerCreating 0 27s
However, when I checked the pod, it showed:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 14m default-scheduler Successfully assigned ingress-nginx/ingress-nginx-controller-7575567f98-s9968 to workernode
Warning FailedMount 109s (x14 over 14m) kubelet MountVolume.SetUp failed for volume "webhook-cert" : secret "ingress-nginx-admission" not found
Warning FailedMount 45s (x6 over 12m) kubelet Unable to attach or mount volumes: unmounted volumes=[webhook-cert], unattached volumes=[webhook-cert kube-api-access-n2xrb]: timed out waiting for the condition
There is another error message I saw also:
Unable to attach or mount volumes: unmounted volumes=[webhook-cert], unattached volumes=[webhook-cert kube-api-access-n2xrb]: timed out waiting for the condition
Can anyone tell me what is the reason for this to happen? Any method/ setting to solve these problems?
Thanks.
2
Answers
Hello, hope you are enjoying your Kubernetes journey,
I deployed the manifest from https://github.com/kubernetes/ingress-nginx/blob/main/deploy/static/provider/cloud/1.23/deploy.yaml
and it worked well for me. (I am using a kind (kubernetes in docker) cluster).
However a lot of people seems to get the same issue (cf here https://github.com/kubernetes/ingress-nginx/issues/5932)
in the above link (github issue 5932), people have solved their problems either by:
Hope this will solve your problem, (you can also check your volume provisioner configuration ? )
Bguess.
I handled it by creating a copy from ingress-nginx-admission-token-xxxxxx secret with the new name:
ingress-nginx-admission
and then delete controller pod to recreate it.steps:
kubectl edit secret ingress-nginx-admission-token-xxxxx -n ingress-nginx
ingress-nginx-admission
kubectl apply -f /tmp/<yml-file>