Skip to content

Commit

Permalink
feat(argo-cd): Move argocd-cm and argocd-rbac-cm to config section (a…
Browse files Browse the repository at this point in the history
…rgoproj#1528)

Signed-off-by: Petr Drastil <[email protected]>
  • Loading branch information
pdrastil authored Oct 25, 2022
1 parent 24de82b commit c8f7efb
Show file tree
Hide file tree
Showing 8 changed files with 170 additions and 154 deletions.
6 changes: 4 additions & 2 deletions charts/argo-cd/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
appVersion: v2.4.15
description: A Helm chart for Argo CD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 5.6.8
version: 5.7.0
home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
sources:
Expand All @@ -22,4 +22,6 @@ dependencies:
condition: redis-ha.enabled
annotations:
artifacthub.io/changes: |
- "[Changed]: DRY cleanup of metrics templates"
- "[Added]: Configuration sections configs.cm and configs.rbac"
- "[Deprecated]: Generic configuration via server.config"
- "[Deprecated]: Argo RBAC configuration via server.rbacConfig"
19 changes: 13 additions & 6 deletions charts/argo-cd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,14 @@ NAME: my-release
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| configs.clusterCredentials | list | `[]` (See [values.yaml]) | Provide one or multiple [external cluster credentials] |
| configs.cm."admin.enabled" | string | `"true"` | Enable local admin user |
| configs.cm."application.instanceLabelKey" | string | Defaults to app.kubernetes.io/instance | The name of tracking label used by Argo CD for resource pruning |
| configs.cm."exec.enabled" | string | `"false"` | Enable exec feature in Argo UI |
| configs.cm."server.rbac.log.enforce.enable" | string | `"false"` | Enable logs RBAC enforcement |
| configs.cm."timeout.hard.reconciliation" | string | `"0"` | Timeout to refresh application data as well as target manifests cache |
| configs.cm."timeout.reconciliation" | string | `"180s"` | Timeout to discover if a new manifests version got published to the repository |
| configs.cm.annotations | object | `{}` | Annotations to be added to argocd-cm configmap |
| configs.cm.create | bool | `true` | Create the argocd-cm configmap for [Declarative setup] |
| configs.credentialTemplates | object | `{}` | Repository credentials to be used as Templates for other repos |
| configs.credentialTemplatesAnnotations | object | `{}` | Annotations to be added to `configs.credentialTemplates` Secret |
| configs.gpgKeys | object | `{}` (See [values.yaml]) | [GnuPG](https://argo-cd.readthedocs.io/en/stable/user-guide/gpg-verification/) keys to add to the key ring |
Expand All @@ -390,6 +398,11 @@ NAME: my-release
| configs.params."server.staticassets" | string | `"/shared/app"` | Directory path that contains additional static assets |
| configs.params."server.x.frame.options" | string | `"sameorigin"` | Set X-Frame-Options header in HTTP responses to value. To disable, set to "". |
| configs.params.annotations | object | `{}` | Annotations to be added to the argocd-cmd-params-cm ConfigMap |
| configs.rbac."policy.csv" | string | `''` (See [values.yaml]) | File containing user-defined policies and role definitions. |
| configs.rbac."policy.default" | string | `""` | The name of the default role which Argo CD will falls back to, when authorizing API requests (optional). If omitted or empty, users may be still be able to login, but will see no apps, projects, etc... |
| configs.rbac.annotations | object | `{}` | Annotations to be added to argocd-rbac-cm configmap |
| configs.rbac.create | bool | `true` | Create the argocd-rbac-cm configmap with ([Argo CD RBAC policy]) definitions. If false, it is expected the configmap will be created by something else. Argo CD will not work if there is no configmap created with the name above. |
| configs.rbac.scopes | string | `"[groups]"` | OIDC scopes to examine during rbac enforcement (in addition to `sub` scope). The scope value can be a string, or a list of strings. |
| configs.repositories | object | `{}` | Repositories list to be used by applications |
| configs.repositoriesAnnotations | object | `{}` | Annotations to be added to `configs.repositories` Secret |
| configs.secret.annotations | object | `{}` | Annotations to be added to argocd-secret |
Expand Down Expand Up @@ -586,9 +599,6 @@ NAME: my-release
| server.certificate.renewBefore | string | `""` | How long before the currently issued certificate's expiry cert-manager should renew the certificate. Value must be in units accepted by Go time.ParseDuration |
| server.certificate.secretName | string | `"argocd-server-tls"` | The name of the Secret that will be automatically created and managed by this Certificate resource |
| server.clusterAdminAccess.enabled | bool | `true` | Enable RBAC for local cluster deployments |
| server.config | object | See [values.yaml] | [General Argo CD configuration] |
| server.configAnnotations | object | `{}` | Annotations to be added to Argo CD ConfigMap |
| server.configEnabled | bool | `true` | Manage Argo CD configmap (Declarative Setup) |
| server.containerPort | int | `8080` | Configures the server port |
| server.containerSecurityContext | object | `{}` | Servers container-level security context |
| server.env | list | `[]` | Environment variables to pass to Argo CD server |
Expand Down Expand Up @@ -659,9 +669,6 @@ NAME: my-release
| server.podAnnotations | object | `{}` | Annotations to be added to server pods |
| server.podLabels | object | `{}` | Labels to be added to server pods |
| server.priorityClassName | string | `""` | Priority class for the Argo CD server |
| server.rbacConfig | object | `{}` | Argo CD rbac config ([Argo CD RBAC policy]) |
| server.rbacConfigAnnotations | object | `{}` | Annotations to be added to Argo CD rbac ConfigMap |
| server.rbacConfigCreate | bool | `true` | Whether or not to create the configmap. If false, it is expected the configmap will be created by something else. Argo CD will not work if there is no configMap created with the name above. |
| server.readinessProbe.failureThreshold | int | `3` | Minimum consecutive failures for the [probe] to be considered failed after having succeeded |
| server.readinessProbe.initialDelaySeconds | int | `10` | Number of seconds after the container has started before [probe] is initiated |
| server.readinessProbe.periodSeconds | int | `10` | How often (in seconds) to perform the [probe] |
Expand Down
8 changes: 7 additions & 1 deletion charts/argo-cd/templates/NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ DEPRECATED option repoServer.logFormat - Use configs.params.repoServer.log.forma
{{- if .Values.repoServer.logLevel }}
DEPRECATED option repoServer.logLevel - Use configs.params.repoServer.log.level
{{- end }}
{{- if or .Values.server.config .Values.server.configEnabled .Values.server.configAnnotations }}
DEPRECATED option server.config - Use configs.cm
{{- end }}
{{- if or .Values.server.rbacConfig .Values.server.rbacConfigCreate .Values.server.rbacConfigAnnotations }}
DEPRECATED option server.rbacConfig - Use configs.rbac
{{- end }}
{{- if .Values.controller.service }}
REMOVED option controller.service - Use controller.metrics
{{- end }}
Expand All @@ -52,7 +58,7 @@ In order to access the server UI you have the following options:
- Set the `configs.params."server.insecure"` in the values file and terminate SSL at your ingress: https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#option-2-multiple-ingress-objects-and-hosts


{{ if eq (index .Values.server.config "admin.enabled") "true" -}}
{{ if eq (index (coalesce .Values.server.config .Values.configs.cm) "admin.enabled") "true" -}}
After reaching the UI the first time you can login with username: admin and the random password generated during the installation. You can find the password by running:

kubectl -n {{ .Release.Namespace }} get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
Expand Down
14 changes: 7 additions & 7 deletions charts/argo-cd/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -161,19 +161,19 @@ Create the name of the notifications bots slack service account to use
{{/*
Argo Configuration Preset Values (Incluenced by Values configuration)
*/}}
{{- define "argo-cd.config.presets" -}}
{{- if .Values.configs.styles }}
{{- define "argo-cd.config.cm.presets" -}}
{{- if .Values.configs.styles -}}
ui.cssurl: "./custom/custom.styles.css"
{{- end }}
{{- end -}}
{{- end -}}

{{/*
Merge Argo Configuration with Preset Configuration
*/}}
{{- define "argo-cd.config" -}}
{{- if .Values.server.configEnabled -}}
{{- toYaml (mergeOverwrite (default dict (fromYaml (include "argo-cd.config.presets" $))) .Values.server.config) }}
{{- end -}}
{{- define "argo-cd.config.cm" -}}
{{- $config := coalesce .Values.server.config (omit .Values.configs.cm "create" "annotations") -}}
{{- $preset := include "argo-cd.config.cm.presets" . | fromYaml | default dict -}}
{{- mergeOverwrite $preset $config | toYaml }}
{{- end -}}

{{/*
Expand Down
6 changes: 3 additions & 3 deletions charts/argo-cd/templates/argocd-configs/argocd-cm.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{- if .Values.server.configEnabled }}
{{- if (coalesce .Values.server.configEnabled .Values.configs.cm.create) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-cm
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "cm") | nindent 4 }}
{{- with .Values.server.configAnnotations }}
{{- with (coalesce .Values.server.configAnnotations .Values.configs.cm.annotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
data:
{{- include "argo-cd.config" $ | nindent 2 }}
{{- include "argo-cd.config.cm" . | nindent 2 }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/argo-cd/templates/argocd-configs/argocd-rbac-cm.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{{- if .Values.server.rbacConfigCreate }}
{{- if (coalesce .Values.server.rbacConfigCreate .Values.configs.rbac.create) }}
apiVersion: v1
kind: ConfigMap
metadata:
name: argocd-rbac-cm
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.server.name "name" "rbac-cm") | nindent 4 }}
{{- with .Values.server.rbacConfigAnnotations }}
{{- with (coalesce .Values.server.rbacConfigAnnotations .Values.configs.rbac.annotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- with .Values.server.rbacConfig }}
{{- with (coalesce .Values.server.rbacConfig (omit .Values.configs.rbac "create" "annotations")) }}
data:
{{- toYaml . | nindent 2 }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-cd/templates/argocd-server/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ rules:
- pods/log
verbs:
- get
{{- if eq (index .Values.server.config "exec.enabled") "true" }}
{{- if eq (index (coalesce .Values.server.config .Values.configs.cm) "exec.enabled") "true" }}
- apiGroups:
- ""
resources:
Expand Down
Loading

0 comments on commit c8f7efb

Please sign in to comment.