openkruise / charts

OpenKruise Helm Charts.
Apache License 2.0
9 stars 29 forks source link

Installing into a namespace other than kruise-system does not work because of hardcoded references to kruise-system #22

Closed martin2176 closed 1 year ago

martin2176 commented 1 year ago

What happened: I am using the documented option "installation.namespace" to install kruise into a namespace of my choice. However it doesn't work. Installation completes successfully but kruise's mutating webhooks doesn't work because there are 4 hardcoded references to namespace kruise-system which are not templated with the variable {{ .Values.installation.namespace }} Hence installation into a different namespace other than kruise-system breaks functionality because mutating web hook is referencing a service in kruise-system which doesnt exist.

--

What you expected to happen: Be able to install kruise using helm into a namespace other than default kruise-system and expect the kruise functionalities to work.

How to reproduce it (as minimally and precisely as possible): Run a dry-run of helm install and examine the output you will find the statefulset, webhookconfiguration have hardcoded references to kruise-system helm install kruise openkruise/kruise --version 1.2.0 --set featureGates="WorkloadSpread=true\,KruiseDaemon=false" --set installation.namespace=openkruise --dry-run > /tmp/1 cat /tmp/1 |grep kruise-system You will find 4 references where kruise-system is hardcoded Or you can go straight into the templates and search for kruise-system. you will find 4 hardcoded references to kruise-system which infact should have been "{{ .Values.installation.namespace }}" https://github.com/openkruise/charts/blob/master/versions/kruise/1.3.0/templates/webhookconfiguration.yaml https://github.com/openkruise/charts/blob/master/versions/kruise/1.3.0/templates/apps.kruise.io_statefulsets.yaml Anything else we need to know?: Easy enough to verify the bug by following steps above Environment: