Problem launching NGINX Ingress Controller in k0s cluster running in arch linux on wsl-2

I’m following the tutorial NGINX Ingress Controller - Documentation (k0sproject.io).

I would appreciate any pointers on what I’m doing wrong or best way to debug

In a newly created single node cluster I’m running:

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

after a while running:

kubectl get pods -n ingress-nginx

I see:

NAME READY STATUS RESTARTS AGE
ingress-nginx-admission-create-lqz5n 0/1 Completed 0 17h
ingress-nginx-controller-69748f55ff-mbskh 0/1 CrashLoopBackOff 281 (4m16s ago) 17h

Running:

kubectl logs -n ingress-nginx ingress-nginx-controller-69748f55ff-mbskh

I see:


NGINX Ingress controller
Release: v0.48.1
Build: 30809c066cd027079cbb32dccc8a101d6fbffdcb
Repository: GitHub - kubernetes/ingress-nginx: Ingress-NGINX Controller for Kubernetes
nginx version: nginx/1.20.1


I0520 12:40:56.945947 7 flags.go:211] “Watching for Ingress” class=“nginx”
W0520 12:40:56.945986 7 flags.go:216] Ingresses with an empty class will also be processed by this Ingress controller
W0520 12:40:56.946339 7 client_config.go:614] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
I0520 12:40:56.946472 7 main.go:241] “Creating API client” host=“https://10.96.0.1:443
I0520 12:40:56.950354 7 main.go:285] “Running in Kubernetes cluster” major=“1” minor=“27” git=“v1.27.1+k0s” state=“clean” commit=“4c9411232e10168d7b050c49a1b59f6df9d7ea4b” platform=“linux/amd64”
I0520 12:40:57.019041 7 main.go:105] “SSL fake certificate created” file=“/etc/ingress-controller/ssl/default-fake-certificate.pem”
I0520 12:40:57.020013 7 main.go:115] “Enabling new Ingress features available since Kubernetes v1.18”
W0520 12:40:57.021196 7 main.go:127] No IngressClass resource with name nginx found. Only annotation will be used.
I0520 12:40:57.030075 7 ssl.go:532] “loading tls certificate” path=“/usr/local/certificates/cert” key=“/usr/local/certificates/key”
I0520 12:40:57.043714 7 nginx.go:254] “Starting NGINX Ingress controller”
I0520 12:40:57.048841 7 event.go:282] Event(v1.ObjectReference{Kind:“ConfigMap”, Namespace:“ingress-nginx”, Name:“ingress-nginx-controller”, UID:“417d6b43-c46c-4e9c-8664-b11ce6004979”, APIVersion:“v1”, ResourceVersion:“930”, FieldPath:“”}): type: ‘Normal’ reason: ‘CREATE’ ConfigMap ingress-nginx/ingress-nginx-controller
E0520 12:40:58.145886 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource
E0520 12:40:59.516460 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource
E0520 12:41:02.596694 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource
E0520 12:41:07.066728 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource
E0520 12:41:13.920997 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource
E0520 12:41:34.369201 7 reflector.go:138] k8s.io/client-go@v0.20.2/tools/cache/reflector.go:167: Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource
I0520 12:41:53.146081 7 main.go:187] “Received SIGTERM, shutting down”
I0520 12:41:53.146129 7 nginx.go:372] “Shutting down controller queues”
E0520 12:41:53.146277 7 store.go:178] timed out waiting for caches to sync
I0520 12:41:53.146349 7 nginx.go:296] “Starting NGINX process”
I0520 12:41:53.146369 7 leaderelection.go:243] attempting to acquire leader lease ingress-nginx/ingress-controller-leader-nginx…
I0520 12:41:53.146743 7 queue.go:78] “queue has been shutdown, failed to enqueue” key=“&ObjectMeta{Name:initial-sync,GenerateName:,Namespace:,SelfLink:,UID:,ResourceVersion:,Generation:0,CreationTimestamp:0001-01-01 00:00:00 +0000 UTC,DeletionTimestamp:,DeletionGracePeriodSeconds:nil,Labels:map[string]string{},Annotations:map[string]string{},OwnerReferences:[]OwnerReference{},Finalizers:[],ClusterName:,ManagedFields:[]ManagedFieldsEntry{},}”
I0520 12:41:53.146809 7 nginx.go:316] “Starting validation webhook” address=“:8443” certPath=“/usr/local/certificates/cert” keyPath=“/usr/local/certificates/key”
I0520 12:41:53.154961 7 leaderelection.go:253] successfully acquired lease ingress-nginx/ingress-controller-leader-nginx
I0520 12:41:53.155018 7 status.go:84] “New leader elected” identity=“ingress-nginx-controller-69748f55ff-mbskh”
I0520 12:41:53.155669 7 queue.go:78] “queue has been shutdown, failed to enqueue” key=“&ObjectMeta{Name:sync status,GenerateName:,Namespace:,SelfLink:,UID:,ResourceVersion:,Generation:0,CreationTimestamp:0001-01-01 00:00:00 +0000 UTC,DeletionTimestamp:,DeletionGracePeriodSeconds:nil,Labels:map[string]string{},Annotations:map[string]string{},OwnerReferences:[]OwnerReference{},Finalizers:[],ClusterName:,ManagedFields:[]ManagedFieldsEntry{},}”
I0520 12:41:53.155994 7 status.go:204] “POD is not ready” pod=“ingress-nginx/ingress-nginx-controller-69748f55ff-mbskh” node=“mlwphpenvy360”
I0520 12:41:53.158186 7 status.go:132] “removing value from ingress status” address=[]
I0520 12:41:53.158224 7 nginx.go:380] “Stopping admission controller”
I0520 12:41:53.158252 7 nginx.go:388] “Stopping NGINX process”
E0520 12:41:53.158274 7 nginx.go:319] “Error listening for TLS connections” err=“http: Server closed”
2023/05/20 12:41:53 [notice] 47#47: signal process started

1 Like

Which version os k0s are you using?

Failed to watch *v1beta1.Ingress: failed to list *v1beta1.Ingress: the server could not find the requested resource

Kinda looks like the version of Nginx controller you’ve installed is using probably removed v1beta1 (networking.k8s.io/v1beta1 to be exact IIRC) version of Ingress kind.

You could try with newer version of the ingress controller

1 Like

I had the same problem.
I was able to resolve it by using the helm version of nginx-ingress-controller from here : Installation Guide - Ingress-Nginx Controller