traefik-helm-chart icon indicating copy to clipboard operation
traefik-helm-chart copied to clipboard

IngressClass not working with helm template

Open heruscode opened this issue 4 years ago • 4 comments

Hello, in chart version 9.10.1 was pushed a fix into IngressClass Resource #300

The problem is, if i try to helm template traefik/traefik --set ingressClass.enabled=true i get this error: <fail "\n\n ERROR: You must have atleast networking.k8s.io/v1beta1 to use ingressClass">

If i try to helm template traefik/traefik --set ingressClass.enabled=true --api-versions networking.k8s.io/v1beta1/IngressClass, it works.

The problem is, i cannot specify which --api-versions to use because we are using ArgoCD to manage our helm installs, and Argo by default only populates --api-versions with the Capabilities it can find.

I'm gonna use 9.10.0 for now, as it works.

Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.3", GitCommit:"1e11e4a2108024935ecfcb2912226cedeafd99df", GitTreeState:"clean", BuildDate:"2020-10-14T12:50:19Z", GoVersion:"go1.15.2", Compiler:"gc", Platform:"linux/amd64"}

Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.2", GitCommit:"f5743093fd1c663cb0cbc89748f730662345d44d", GitTreeState:"clean", BuildDate:"2020-09-16T13:32:58Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}

heruscode avatar Nov 16 '20 19:11 heruscode

Same issue with managed kubernetes in DigitalOcean (DOKS), also using ArgoCD to deploy Traefik 2.3.5. Tested with 1.18-2.do and 1.19-3do

Gallardo994 avatar Dec 16 '20 12:12 Gallardo994

Experiencing similar issue on ArgoCD 1.8.1 deploying Traefik chart 9.11.0. I can see in ArgoCD logs that --api-versions networking.k8s.io/v1 --api-versions networking.k8s.io/v1beta1 is passed to the helm template command, but not the specific resources within the api-version.

Helm docs seem to indicate that both the version and resource should be available through Capabilities.APIVersions. This seems like possibly a bug in ArgoCD for not presenting each resource within the apiversion.

mcavoyk avatar Dec 24 '20 00:12 mcavoyk

any update on this? I am also using ArgoCD to dpeloy traefik and getting same error

abhinav-khanna-1001 avatar Mar 06 '21 03:03 abhinav-khanna-1001

As an FYI, those experiencing with that issue may add some ingressClass.fallbackApiVersion to their values file -- k8s 1.19+ may set it to v1, previous versions would need to use v1beta1.

As I'm not sure how to reproduce the issue, I'll hold on to my PR ... Instead of checking for ingressClass presence in a given API, we should be able to solely rely on Kubernetes API version. Could anyone confirm or deny this issue was fixed, pulling from the following fork:

$ git clone -b fix-ingressclass https://github.com/Worteks/traefik-helm-chart
$ helm install traefik --dry-run --debug ./traefik-helm-chart/traefik --values /your/values.yml

Remove dry-run & debug to actually apply objects. If ArgoCD won't allow applying local charts, and that you have some HTTP server on your own, you should be able to package it, using:

$ helm package traefik/
$ mkdir my-repo-buildroot
$ mv ./traefik-X.Y.Z.tgz my-repo-buildroot/
$ helm repo index my-repo-buildroot --url https://my-repo-fqdn/subpath/for/helm/charts
$ scp -p my-repo-buildroot/* root@my-repo-fqdn:/var/www/subpath/for/helm/charts/

Let us know if that helps.

faust64 avatar Mar 08 '21 16:03 faust64

With PR #693, it will check only Kubernetes version.

mloiseleur avatar Oct 28 '22 09:10 mloiseleur