digitalis-io / k3s-on-prem-production

Playbooks needed to set up an on-premises K3s cluster and securize it
Apache License 2.0
157 stars 45 forks source link

Nginx Ingress Update Templates to Stable #6

Closed aldycool closed 2 years ago

aldycool commented 2 years ago

Hi,

considering now the nginx ingress has moved to stable in its latest version as described here, it has removed many of its "v1beta1" resources. Can you suggest on how to update the nginx templates in the roles/k3s-deploy/templates/ingress/*.j2 files? I've tried just only updating the k3s_version: v1.22.4+k3s1 and the nginx_ingress_version: 1.0.5 in the default's main.yml without modifying any of the templates, but it errors with: "failed to list *v1beta1.Ingress: the server could not find the requested resource", which is still looking for the deprecated v1beta1 resource. The official migration example here from the nginx ingress only lists basic examples, while the templates uses different approaches (such as PodSecurityPolicy, WebHook, etc) which I'm not yet familiar with. Thank you.

89luca89 commented 2 years ago

Hi @aldycool in the roles/k3s-deploy/templates/ingress/ folder there are the templates for the ingress files those are slightly modified manifests that I just took from the original nginx ingress

You can check with diff what differs from one of the ingresses (they are just renamed in a few spots in order to have 2 ingresses) and the official new one

aldycool commented 2 years ago

Hi @89luca89 ,

It turns out that because of we use two ingress controllers (external + internal), the new IngressClass resource require us to create two different IngressClass separately in each controllers, and then added with the existing ValidatingWebHookConfiguration resource, now leads to an unsolved problem listed here: https://github.com/kubernetes/ingress-nginx/issues/7546. I'm out of ideas right now, so its better to stay at the existing version for now (v1.20.5+k3s1 with nginx ingress version 0.45.0). I'll check back later on the thread to see if it has been resolved. Thank you for your help.

89luca89 commented 2 years ago

OK cool, maybe it is possible to experiment with trefil on this in the future