skip to Main Content

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


  1. 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:

    • Restarting the Docker engine of the machine where Webhook is located (maybe because of a problem with docker’s network bridge)
    • Modifying "–ingress-class=nginx" to "–ingress-class=nginx2" in apply.yaml file so it was because there was an ingress class with the same name "nginx"
    • Trying it to another cluster (managed EKS, GKE, or if its tests you can use minikube or kind as I am)

    Hope this will solve your problem, (you can also check your volume provisioner configuration ? )

    Bguess.

    Login or Signup to reply.
  2. 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:

    1. kubectl edit secret ingress-nginx-admission-token-xxxxx -n ingress-nginx
    2. Change name attribute to ingress-nginx-admission
    3. Saving it, then it save the new yml file in your /tmp dir
    4. Apply new secret with kubectl apply -f /tmp/<yml-file>
    5. Delete controller pod to recreate it
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search