From a25cfd221cd8093cd79282413b2201c9a1e789d9 Mon Sep 17 00:00:00 2001 From: loreleimccollum-work <66749079+loreleimccollum-work@users.noreply.github.com> Date: Thu, 13 May 2021 01:36:13 -0400 Subject: [PATCH] feat: Support custom rules for the Application Controller Cluster Role (#730) * feat: Support custom rules for the Application Controller Cluster Role Signed-off-by: Lorelei McCollum * Add newline at end of file Signed-off-by: Lorelei McCollum --- CONTRIBUTING.md | 6 ++++++ charts/argo-cd/Chart.yaml | 2 +- .../argocd-application-controller/clusterrole.yaml | 6 +++++- charts/argo-cd/values.yaml | 7 +++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b64861bb..f4c7d89c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -22,6 +22,12 @@ helm delete argo-cd --purge kubectl delete crd -l app.kubernetes.io/part-of=argocd ``` +Pre-requisites: +``` +helm repo add redis-ha https://dandydeveloper.github.io/charts/ +helm dependency update +``` + Minimally: ``` diff --git a/charts/argo-cd/Chart.yaml b/charts/argo-cd/Chart.yaml index 584ef6e2..07d6fb7b 100644 --- a/charts/argo-cd/Chart.yaml +++ b/charts/argo-cd/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: 2.0.0 description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes. name: argo-cd -version: 3.2.3 +version: 3.2.4 home: https://github.com/argoproj/argo-helm icon: https://raw.githubusercontent.com/argoproj/argo/master/docs/assets/argo.png keywords: diff --git a/charts/argo-cd/templates/argocd-application-controller/clusterrole.yaml b/charts/argo-cd/templates/argocd-application-controller/clusterrole.yaml index 3426c9c8..bd6ff8aa 100644 --- a/charts/argo-cd/templates/argocd-application-controller/clusterrole.yaml +++ b/charts/argo-cd/templates/argocd-application-controller/clusterrole.yaml @@ -6,6 +6,9 @@ metadata: labels: {{- include "argo-cd.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }} rules: +{{- if .Values.controller.clusterRoleRules.enabled }} +{{- toYaml .Values.controller.clusterRoleRules.rules | nindent 2 }} +{{ else }} - apiGroups: - '*' resources: @@ -16,4 +19,5 @@ rules: - '*' verbs: - '*' -{{- end }} \ No newline at end of file +{{- end }} +{{- end }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index dc04e3eb..ef68a320 100755 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -183,6 +183,13 @@ controller: ## Enable if you would like to grant rights to ArgoCD to deploy to the local Kubernetes cluster. clusterAdminAccess: enabled: true + ## Enable Custom Rules for the Application Controller's Cluster Role resource + ## Enable this and set the rules: to whatever custom rules you want for the Cluster Role resource. + ## Defaults to off + clusterRoleRules: + enabled: false + rules: [] + ## Dex dex: