We have rancher managed RKE2 clusters with nginx-i...
# rke2
c
We have rancher managed RKE2 clusters with nginx-ingress. For a long time we've enabled use-forwarded-headers and disable-access-log by adding them to "cluster configuration" -> "additional manifests" in R2 UI. This no longer works (R2.14.2, RKE2 1.34.9). It's added to the yaml ("edit yaml"), but not applied to the rke2-ingress-nginx helmchartconfig. If I edit the helmchartconfig (or configmap), they get reset somehow. Is this a bug, or is there a different way to apply these settings?
Copy code
kind: HelmChartConfig
metadata:
  name: rke2-ingress-nginx
  namespace: kube-system
spec:
  valuesContent: |-
    controller:
      config:
        use-forwarded-headers: "true"
        disable-access-log: "true"
c
well you shouldn’t EVER edit the configmap directly… all you should ever modify is HelmChartConfig. Newer releases of Rancher have native support for rke2-ingress-nginx. Instead of putting your config in Additional Manifest, you should select ingress-nginx in the UI and configure it there, or put your values under
.spec.rkeConfig.chartValues.rke2-ingress-nginx
if you are editing as yaml.
.spec.rkeConfig.chartValues is where Rancher puts values for things that it has UI for. If you try to deploy a conflicting set of values via HelmChartConfig Additional Manifest, yours will get dropped
c
That worked, thanks a lot. I haven't been able to find this change in behaviour documented anywhere, nor how to set such options in rancher. Changing the cm directly was a crutch until we found a persistent way. Changing the helmchartconfig in the cluster didn't work any better, it got reset by rancher.
c
its not a change in behavior. its always done this, its just that rancher didn’t have a chartValues slot for ingress before. now it does
in general if there is a UI slot for an add-on (cpi, csi, cni, ingress, or so on) you need to use spec.rkeConfig.chartValues for that. additional manifests are only safe for things that Rancher isn’t also managing.
I think you can just drop arbitrary stuff into chartValues, instead of doing a whole additional manifest. but, test that first.
c
I'd say something that worked before stops working means it is a change in behaviour, but ok. 🙂 I did: for cluster "edit config", below the ingress choice, "show advanced", then under controller.config :
Copy code
config:
    disable-access-log: true
    use-forwarded-headers: true
This gets then added to the "edit as yaml" spec.rkeConfig.chartValues.rke2-ingress-nginx.controller, propagated to the nginx-ingress configmap, and then to the actual nginx config.