Skip to content

Instantly share code, notes, and snippets.

@flrichar
Last active May 21, 2024 11:09
Show Gist options
  • Save flrichar/a8dbe833e516a5421da95cb200c50097 to your computer and use it in GitHub Desktop.
Save flrichar/a8dbe833e516a5421da95cb200c50097 to your computer and use it in GitHub Desktop.
Rancher Helm Install Error about Ingress is Misleading

rancher Ingress complaining about spec.rules[0].http.paths[0].pathType ?

This took a bit of digging to figure out. As it turns out, my lab ingress has evolved a little. This env may have had several ingress classes in the past.

  • alpha env behind a LB with Let's Encrypt enabled
  • the error is misleading, the api-resources are OK & pathType IS specified
  • helm install works OK but won't touch ingress, keeps status as failed
  • even backing up ingress to make it net-new fails
$ helm upgrade rancher rancher-prime/rancher -n cattle-system --reuse-values                                                                                                                                                
Error: UPGRADE FAILED: cannot patch "rancher" with kind Ingress: Ingress.networking.k8s.io "rancher" is invalid: spec.rules[0].http.paths[0].pathType: Required value: pathType must be specified    

Resolution

Add ingress.class=nginx to values.yaml and re-upgrade with helm upgrade -f values.yaml ...

Example ouput of helm get values -n cattle-system rancher ...

USER-SUPPLIED VALUES:
hostname: some-rancher.fqdn.com
ingress:
  class: nginx
... (continues)

Ask your consultant for more information regarding clusters that have been upgraded over longer periods of time.

@ChrisMcKee
Copy link

I had the same issue but it was literally that the value file now has the pathType in it; while my install didn't, so reusing caused the error.

ingress:
  enabled: true
  includeDefaultExtraAnnotations: true
  ingressClassName: ""
  # THIS BIT IS NEW
  # Certain ingress controllers will will require the pathType or path to be set to a different value.
  pathType: ImplementationSpecific
  path: "/"

@flrichar
Copy link
Author

flrichar commented May 17, 2024

Yea, it's obviously a result of my environment keeping the same ingress config over the course of many upgrades.
The chart itself has changed to ImplementationSpecific four years ago -

https://github.com/rancher/rancher/blob/release/v2.9/chart/templates/ingress.yaml#L57

It all might be a moot point as Ingress as we know it is frozen with things evolving into Gateway API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment