Score:3

Ingress nginx-controller - failed for volume “webhook-cert”

in flag

I run:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.48.1/deploy/static/provider/aws/deploy.yaml

But it didn't work.

Events:
Type     Reason       Age                     From               Message
----     ------       ----                    ----               -------
  Normal   Scheduled    8m56s                   default-scheduler  Successfully assigned ingress-nginx/ingress-nginx-controller-68649d49b8-g5r58 to ip-10-40-0-32.ap-northeast-2.compute.internal
  Warning  FailedMount  8m56s (x2 over 8m56s)   kubelet            MountVolume.SetUp failed for volume "webhook-cert" : secret "ingress-nginx-admission" not found
  Normal   Killing      7m56s                   kubelet            Container controller failed liveness probe, will be restarted
  Normal   Pulled       7m45s (x2 over 8m54s)   kubelet            Container image "k8s.gcr.io/ingress-nginx/controller:v0.48.1@sha256:e9fb216ace49dfa4a5983b183067e97496e7a8b307d2093f4278cd550c303899" already present on machine
  Normal   Created      7m45s (x2 over 8m54s)   kubelet            Created container controller
  Normal   Started      7m45s (x2 over 8m53s)   kubelet            Started container controller
  Warning  Unhealthy    7m16s (x7 over 8m36s)   kubelet            Liveness probe failed: HTTP probe failed with statuscode: 500
  Warning  Unhealthy    3m46s (x30 over 8m36s)  kubelet            Readiness probe failed: HTTP probe failed with statuscode: 500

logs...

Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
{"level":"info",
"msg":"patching webhook configurations 'ingress-nginx-admission' mutating=false, validating=true, failurePolicy=Fail",
"source":"k8s/k8s.go:39",
"time":"2021-08-17T18:08:40Z"
}
{"err":"the server could not find the requested resource",
"level":"fatal",
"msg":"failed getting validating webhook",
"source":"k8s/k8s.go:48","time":"2021-08-17T18:08:40Z"
}

I tried changing the deployment's --ingress-class=nginx to --ingress-class=nginx2, or installing v0.35, or trying:

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx /controller-v0.48.1/deploy/static/provider/baremetal/deploy.yaml

But the same error repeats.

Environment:

  • kubeadm version: v1.22.0
  • docker version: 20.10.7
  • os: ubuntu
  • AWS EC2 instance
Score:0
cn flag
MountVolume.SetUp failed for volume "webhook-cert" : secret "ingress-nginx-admission" not found

As you can see in Events there is missing secret "ingress-nginx-admission". This is probably because you used outdated yaml.
You can deploy nginx controler for AWS from here or just use helm.

NETWORK LOAD BALANCER (NLB)

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.3/deploy/static/provider/aws/deploy.yaml

  1. Download the deploy.yaml template wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.1.3/deploy/static/provider/aws/nlb-with-tls-termination/deploy.yaml
  2. Edit the file and change the VPC CIDR in use for the Kubernetes cluster: proxy-real-ip-cidr: XXX.XXX.XXX/XX
  3. Change the AWS Certificate Manager (ACM) ID as well: arn:aws:acm:us-west-2:XXXXXXXX:certificate/XXXXXX-XXXXXXX-XXXXXXX-XXXXXXXX
  4. Deploy the manifest: kubectl apply -f deploy.yaml
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.