Open M0NsTeRRR opened 4 months ago
related to https://github.com/kubernetes-sigs/kustomize/issues/3815, https://github.com/kubernetes-sigs/kustomize/issues/5566
Use sed
at the transformer level to replace problematic strings in yaml.
Examples: https://github.com/panteparak/kustomize-sed-transformer
Checklist:
argocd version
.Describe the bug
After asking on CNCF Slack, I was recommended to create an issue here. Create an ApplicationSet with Git generator. A Kustomize resource deploys a Helm chart. The namespace is set in the ApplicationSet with
spec.template.spec.source.kustomize.namespace
andspec.template.spec.destination.namespace
. The Helm chart is deployed into the cluster. All resources are created in the correct namespace, but the ClusterRoleBinding for the service account references the ArgoCD namespace.To Reproduce
Here is a test case repository : https://github.com/M0NsTeRRR/argocd-namespace-issue. The problem is not associated with this particular repository. I have encountered it with Grafana mimir distributed Helm chart too. Here is a direct link to the Helm template : https://github.com/cloudnative-pg/charts/blob/main/charts/cloudnative-pg/templates/rbac.yaml#L375.
Expected behavior
The clusterrolebiding should reference the application namespace. I've found this issue that I could reproduces using the repository test case linked : https://github.com/kubernetes-sigs/kustomize/issues/5566. I don't know if I'm facing the same issue.
Screenshots
Version I've tested also with argocd 2.9.11
Logs
kubectl kustomize --enable-helm
from github repository test caseArgocd application controller
It stays in progressing, degraded.