Recently I tried to configure rancher-monitoring with the latest version of Flux2 and due to their update with Kustomize v4 (Breaking changes in Flux due to Kustomize v4 · Issue #1522 · fluxcd/flux2 · GitHub) when you have a duplicate YAML keys it blocks the deploy, in my case of the Helm Chart.
Checking the rancher-monitoring chart, I detected a duplicate key in the resource ClusterRole with name monitoring-edit, I attach the render of this part of the chart:
# Source: rancher-monitoring/templates/rancher-monitoring/clusterrole.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: monitoring-edit labels: app.kubernetes.io/managed-by: Helm app.kubernetes.io/instance: RELEASE-NAME app.kubernetes.io/version: "100.0.0_up16.6.0" app.kubernetes.io/part-of: rancher-monitoring chart: rancher-monitoring-100.0.0_up16.6.0 release: "RELEASE-NAME" heritage: "Helm" rbac.authorization.k8s.io/aggregate-to-edit: "true" **rules:** **rules:** - apiGroups: - monitoring.coreos.com resources: - alertmanagers - prometheuses - prometheuses/finalizers - alertmanagers/finalizers verbs: - 'get' - 'list' - 'watch' - apiGroups: - monitoring.coreos.com resources: - thanosrulers - thanosrulers/finalizers - servicemonitors - podmonitors - prometheusrules - podmonitors - probes - alertmanagerconfigs verbs: - '*'
You can check this rendering the template with this following command:
helm template <name of repo>/rancher-monitoring
Like you can see there is a duplicate rules: key, I tried to check if there is a repo with this code to commit PR but I didn´t found it, would be awesome if this fix is deployed in the next release.
Thanks for all, I love rancher and all their apps.
If you need more info about this problem it´s a pleasure to help you.