From 3363e407f935689d3140ca69bf59b6b0eadd9498 Mon Sep 17 00:00:00 2001 From: Marco Maurer Date: Tue, 4 Feb 2025 09:13:36 +0100 Subject: [PATCH] fix: Add ability to disable the commit-server Signed-off-by: Marco Maurer --- charts/argo-cd/README.md | 9 ++++++++- charts/argo-cd/README.md.gotmpl | 8 +++++++- .../templates/argocd-commit-server/deployment.yaml | 2 ++ .../templates/argocd-commit-server/networkpolicy.yaml | 2 +- .../argo-cd/templates/argocd-commit-server/service.yaml | 2 ++ .../templates/argocd-commit-server/serviceaccount.yaml | 3 ++- charts/argo-cd/values.yaml | 3 +++ 7 files changed, 25 insertions(+), 4 deletions(-) diff --git a/charts/argo-cd/README.md b/charts/argo-cd/README.md index d43fcd475..44bc79d75 100644 --- a/charts/argo-cd/README.md +++ b/charts/argo-cd/README.md @@ -1621,7 +1621,11 @@ If you use an External Redis (See Option 3 above), this Job is not deployed. | notifications.topologySpreadConstraints | list | `[]` (defaults to global.topologySpreadConstraints) | Assign custom [TopologySpreadConstraints] rules to the application controller | | notifications.triggers | object | `{}` | The trigger defines the condition when the notification should be sent | -## Commit server +## Commit server (Manifest Hydrator) + +The Argo CD Commit Server provides push access to git repositories for hydrated manifests. + +To read more about this component, please read [Argo CD Manifest Hydrator] and [Manifest Hydrator]. | Key | Type | Default | Description | |-----|------|---------|-------------| @@ -1632,6 +1636,7 @@ If you use an External Redis (See Option 3 above), this Job is not deployed. | commitServer.deploymentStrategy | object | `{}` | Deployment strategy to be added to the commit server Deployment | | commitServer.dnsConfig | object | `{}` | [DNS configuration] | | commitServer.dnsPolicy | string | `"ClusterFirst"` | Alternative DNS policy for commit server pods | +| commitServer.enabled | bool | `true` | Enable commit server | | commitServer.extraArgs | list | `[]` | commit server command line flags | | commitServer.extraEnv | list | `[]` | Environment variables to pass to the commit server | | commitServer.extraEnvFrom | list | `[]` (See [values.yaml]) | envFrom to pass to the commit server | @@ -1699,3 +1704,5 @@ Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/ [Applications in any namespace]: https://argo-cd.readthedocs.io/en/stable/operator-manual/app-any-namespace/#applications-in-any-namespace [Argo CD Extensions]: https://github.com/argoproj-labs/argocd-extensions?tab=readme-ov-file#deprecation-notice [Argo CD Extension Installer]: https://github.com/argoproj-labs/argocd-extension-installer +[Argo CD Manifest Hydrator]: https://argo-cd.readthedocs.io/en/stable/proposals/manifest-hydrator/ +[Manifest Hydrator]: https://github.com/argoproj/argo-cd/blob/master/docs/proposals/manifest-hydrator.md diff --git a/charts/argo-cd/README.md.gotmpl b/charts/argo-cd/README.md.gotmpl index 28f945e58..d2862792b 100644 --- a/charts/argo-cd/README.md.gotmpl +++ b/charts/argo-cd/README.md.gotmpl @@ -813,7 +813,11 @@ If you use an External Redis (See Option 3 above), this Job is not deployed. {{- end }} {{- end }} -## Commit server +## Commit server (Manifest Hydrator) + +The Argo CD Commit Server provides push access to git repositories for hydrated manifests. + +To read more about this component, please read [Argo CD Manifest Hydrator] and [Manifest Hydrator]. | Key | Type | Default | Description | |-----|------|---------|-------------| @@ -855,3 +859,5 @@ Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/ [Applications in any namespace]: https://argo-cd.readthedocs.io/en/stable/operator-manual/app-any-namespace/#applications-in-any-namespace [Argo CD Extensions]: https://github.com/argoproj-labs/argocd-extensions?tab=readme-ov-file#deprecation-notice [Argo CD Extension Installer]: https://github.com/argoproj-labs/argocd-extension-installer +[Argo CD Manifest Hydrator]: https://argo-cd.readthedocs.io/en/stable/proposals/manifest-hydrator/ +[Manifest Hydrator]: https://github.com/argoproj/argo-cd/blob/master/docs/proposals/manifest-hydrator.md diff --git a/charts/argo-cd/templates/argocd-commit-server/deployment.yaml b/charts/argo-cd/templates/argocd-commit-server/deployment.yaml index 1b970b7d4..306632b17 100644 --- a/charts/argo-cd/templates/argocd-commit-server/deployment.yaml +++ b/charts/argo-cd/templates/argocd-commit-server/deployment.yaml @@ -1,3 +1,4 @@ +{{- if .Values.commitServer.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -229,3 +230,4 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} dnsPolicy: {{ .Values.commitServer.dnsPolicy }} +{{- end }} diff --git a/charts/argo-cd/templates/argocd-commit-server/networkpolicy.yaml b/charts/argo-cd/templates/argocd-commit-server/networkpolicy.yaml index 0c31a6709..6ec0a6ac5 100644 --- a/charts/argo-cd/templates/argocd-commit-server/networkpolicy.yaml +++ b/charts/argo-cd/templates/argocd-commit-server/networkpolicy.yaml @@ -1,4 +1,4 @@ -{{- if .Values.global.networkPolicy.create }} +{{- if and .Values.commitServer.enabled .Values.global.networkPolicy.create }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: diff --git a/charts/argo-cd/templates/argocd-commit-server/service.yaml b/charts/argo-cd/templates/argocd-commit-server/service.yaml index 48e6200ff..1e6a915d7 100644 --- a/charts/argo-cd/templates/argocd-commit-server/service.yaml +++ b/charts/argo-cd/templates/argocd-commit-server/service.yaml @@ -1,3 +1,4 @@ +{{- if .Values.commitServer.enabled }} apiVersion: v1 kind: Service metadata: @@ -26,3 +27,4 @@ spec: targetPort: 8087 selector: {{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.commitServer.name) | nindent 4 }} +{{- end }} diff --git a/charts/argo-cd/templates/argocd-commit-server/serviceaccount.yaml b/charts/argo-cd/templates/argocd-commit-server/serviceaccount.yaml index ceed7aa7a..d0cf9e737 100644 --- a/charts/argo-cd/templates/argocd-commit-server/serviceaccount.yaml +++ b/charts/argo-cd/templates/argocd-commit-server/serviceaccount.yaml @@ -1,6 +1,7 @@ -{{- if .Values.commitServer.serviceAccount.create }} +{{- if and .Values.commitServer.enabled .Values.commitServer.serviceAccount.create }} apiVersion: v1 kind: ServiceAccount +automountServiceAccountToken: {{ .Values.commitServer.serviceAccount.automountServiceAccountToken }} metadata: name: {{ include "argo-cd.commitServer.serviceAccountName" . }} namespace: {{ include "argo-cd.namespace" . }} diff --git a/charts/argo-cd/values.yaml b/charts/argo-cd/values.yaml index f58bf98c6..388132fd0 100644 --- a/charts/argo-cd/values.yaml +++ b/charts/argo-cd/values.yaml @@ -3752,6 +3752,9 @@ notifications: # - on-sync-status-unknown commitServer: + # -- Enable commit server + enabled: true + # -- Commit server name name: commit-server