Allow chart to be deployed and only ship CRDs

This commit is contained in:
Tim Priestnall 2023-10-17 10:57:20 +01:00
parent df9ee892b5
commit 67494a64ad
99 changed files with 205 additions and 7 deletions

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.createAggregateRoles }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
@ -83,3 +84,4 @@ rules:
- update
- watch
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $config := .Values.controller.clusterAdminAccess | default dict -}}
{{- if hasKey $config "enabled" | ternary $config.enabled .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
@ -22,3 +23,4 @@ rules:
- '*'
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $config := .Values.controller.clusterAdminAccess | default dict -}}
{{- if hasKey $config "enabled" | ternary $config.enabled .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
@ -15,3 +16,4 @@ subjects:
name: {{ include "argo-cd.controllerServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.controller.metrics.enabled }}
apiVersion: v1
kind: Service
@ -32,3 +33,4 @@ spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.global.networkPolicy.create }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
@ -18,3 +19,4 @@ spec:
policyTypes:
- Ingress
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.controller.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
@ -25,3 +26,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.controller.metrics.enabled .Values.controller.metrics.rules.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
@ -22,3 +23,4 @@ spec:
rules:
{{- toYaml .Values.controller.metrics.rules.spec | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
@ -35,3 +36,4 @@ rules:
verbs:
- create
- list
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
@ -13,3 +14,4 @@ subjects:
- kind: ServiceAccount
name: {{ template "argo-cd.controllerServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.controller.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
@ -17,3 +18,4 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.controller.metrics.enabled .Values.controller.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
@ -45,3 +46,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: apps/v1
kind: StatefulSet
metadata:
@ -338,3 +339,4 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
dnsPolicy: {{ .Values.controller.dnsPolicy }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.applicationSet.certificate.enabled -}}
apiVersion: cert-manager.io/v1
kind: Certificate
@ -37,3 +38,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.applicationSet.enabled }}
apiVersion: apps/v1
kind: Deployment
@ -315,3 +316,4 @@ spec:
{{- end }}
dnsPolicy: {{ .Values.applicationSet.dnsPolicy }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.applicationSet.enabled .Values.applicationSet.metrics.enabled }}
apiVersion: v1
kind: Service
@ -32,3 +33,4 @@ spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.applicationSet.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.applicationSet.enabled .Values.global.networkPolicy.create (or .Values.applicationSet.metrics.enabled .Values.applicationSet.webhook.ingress.enabled) }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
@ -24,3 +25,4 @@ spec:
policyTypes:
- Ingress
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.applicationSet.enabled .Values.applicationSet.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
@ -25,3 +26,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.applicationSet.name) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.applicationSet.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
@ -87,3 +88,4 @@ rules:
- update
- watch
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.applicationSet.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
@ -15,3 +16,4 @@ subjects:
name: {{ template "argo-cd.applicationSetServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.applicationSet.enabled }}
apiVersion: v1
kind: Service
@ -24,3 +25,4 @@ spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.applicationSet.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.applicationSet.enabled .Values.applicationSet.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
@ -17,3 +18,4 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.applicationSet.enabled }}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.applicationSet.metrics.enabled .Values.applicationSet.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
@ -47,3 +48,4 @@ spec:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.applicationSet.name "name" "metrics") | nindent 6 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.applicationSet.enabled .Values.applicationSet.webhook.ingress.enabled -}}
{{- $servicePort := .Values.applicationSet.service.portName -}}
{{- $paths := .Values.applicationSet.webhook.ingress.paths -}}
@ -71,3 +72,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end -}}
{{- end -}}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if (hasKey .Values.server "configEnabled") | ternary .Values.server.configEnabled .Values.configs.cm.create }}
apiVersion: v1
kind: ConfigMap
@ -15,3 +16,4 @@ metadata:
data:
{{- include "argo-cd.config.cm" . | trim | nindent 2 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.configs.params.create }}
apiVersion: v1
kind: ConfigMap
@ -15,3 +16,4 @@ metadata:
data:
{{- include "argo-cd.config.params" . | trim | nindent 2 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.configs.cmp.create }}
apiVersion: v1
kind: ConfigMap
@ -23,3 +24,4 @@ data:
{{- toYaml $cmp_plugin_config | nindent 6 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.dex.enabled .Values.dex.certificateSecret.enabled }}
apiVersion: v1
kind: Secret
@ -23,3 +24,4 @@ data:
tls.crt: {{ .Values.dex.certificateSecret.crt | b64enc | quote }}
tls.key: {{ .Values.dex.certificateSecret.key | b64enc | quote }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: v1
kind: ConfigMap
metadata:
@ -15,3 +16,4 @@ metadata:
data:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.notifications.enabled .Values.notifications.cm.create }}
apiVersion: v1
kind: ConfigMap
@ -26,3 +27,4 @@ data:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.notifications.enabled .Values.notifications.secret.create }}
apiVersion: v1
kind: Secret
@ -21,3 +22,4 @@ stringData:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if (hasKey .Values.server "rbacConfigCreate") | ternary .Values.server.rbacConfigCreate .Values.configs.rbac.create }}
apiVersion: v1
kind: ConfigMap
@ -17,3 +18,4 @@ data:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.repoServer.certificateSecret.enabled }}
apiVersion: v1
kind: Secret
@ -23,3 +24,4 @@ data:
tls.crt: {{ .Values.repoServer.certificateSecret.crt | b64enc | quote }}
tls.key: {{ .Values.repoServer.certificateSecret.key | b64enc | quote }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.configs.secret.createSecret }}
apiVersion: v1
kind: Secret
@ -47,3 +48,4 @@ data:
{{- end }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.server.certificateSecret.enabled (not .Values.server.certificate.enabled) }}
apiVersion: v1
kind: Secret
@ -20,3 +21,4 @@ data:
tls.crt: {{ .Values.server.certificateSecret.crt | b64enc | quote }}
tls.key: {{ .Values.server.certificateSecret.key | b64enc | quote }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: v1
kind: ConfigMap
metadata:
@ -21,3 +22,4 @@ data:
{{- with .Values.configs.ssh.extraHosts }}
{{- . | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.configs.styles }}
apiVersion: v1
kind: ConfigMap
@ -10,3 +11,4 @@ data:
custom.styles.css: |
{{- .Values.configs.styles | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: v1
kind: ConfigMap
metadata:
@ -21,3 +22,4 @@ data:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- range .Values.configs.clusterCredentials }}
---
apiVersion: v1
@ -33,3 +34,4 @@ stringData:
config: |
{{- required "A valid .Values.configs.clusterCredentials[].config entry is required!" .config | toRawJson | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and (or .Values.externalRedis.username .Values.externalRedis.password) (not .Values.externalRedis.existingSecret) }}
apiVersion: v1
kind: Secret
@ -21,3 +22,4 @@ data:
redis-password: {{ . | b64enc }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- range $repo_cred_key, $repo_cred_value := .Values.configs.credentialTemplates }}
---
apiVersion: v1
@ -19,3 +20,4 @@ data:
{{ $key }}: {{ $value | toString | b64enc }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- range $repo_key, $repo_value := .Values.configs.repositories }}
---
apiVersion: v1
@ -19,3 +20,4 @@ data:
{{ $key }}: {{ $value | b64enc }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.notifications.enabled }}
apiVersion: apps/v1
kind: Deployment
@ -159,3 +160,4 @@ spec:
{{- end }}
dnsPolicy: {{ .Values.notifications.dnsPolicy }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.notifications.enabled .Values.notifications.metrics.enabled }}
apiVersion: v1
kind: Service
@ -32,3 +33,4 @@ spec:
port: {{ .Values.notifications.metrics.port }}
targetPort: metrics
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.notifications.enabled .Values.global.networkPolicy.create .Values.notifications.metrics.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
@ -18,3 +19,4 @@ spec:
policyTypes:
- Ingress
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.notifications.enabled .Values.notifications.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
@ -25,3 +26,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.notifications.name) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.notifications.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
@ -43,3 +44,4 @@ rules:
verbs:
- get
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.notifications.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
@ -15,3 +16,4 @@ subjects:
name: {{ template "argo-cd.notificationsServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.notifications.enabled .Values.notifications.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
@ -17,3 +18,4 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.notifications.enabled .Values.notifications.metrics.enabled .Values.notifications.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
@ -48,3 +49,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.notifications.name "name" "metrics") | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $config := .Values.repoServer.clusterAdminAccess | default dict -}}
{{- if hasKey $config "enabled" | ternary $config.enabled .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
@ -22,3 +23,4 @@ rules:
- '*'
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $config := .Values.repoServer.clusterAdminAccess | default dict -}}
{{- if hasKey $config "enabled" | ternary $config.enabled .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
@ -15,3 +16,4 @@ subjects:
name: {{ include "argo-cd.repoServerServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@ -396,3 +397,4 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
dnsPolicy: {{ .Values.repoServer.dnsPolicy }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.repoServer.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
@ -39,3 +40,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.repoServer.metrics.enabled }}
apiVersion: v1
kind: Service
@ -32,3 +33,4 @@ spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.repoServer.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.global.networkPolicy.create }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
@ -40,3 +41,4 @@ spec:
policyTypes:
- Ingress
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.repoServer.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
@ -25,3 +26,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.repoServer.name) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.repoServer.serviceAccount.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
@ -11,3 +12,4 @@ rules:
{{toYaml .Values.repoServer.rbac }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.repoServer.serviceAccount.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
@ -15,3 +16,4 @@ subjects:
name: {{ template "argo-cd.repoServerServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: v1
kind: Service
metadata:
@ -22,3 +23,4 @@ spec:
targetPort: repo-server
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.repoServer.name) | nindent 4 }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.repoServer.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
@ -17,3 +18,4 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.repoServer.metrics.enabled .Values.repoServer.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
@ -45,3 +46,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.repoServer.name "name" (printf "%s-metrics" .Values.repoServer.name)) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.server.ingressGrpc.enabled .Values.server.ingressGrpc.isAWSALB -}}
apiVersion: v1
kind: Service
@ -23,3 +24,4 @@ spec:
sessionAffinity: None
type: {{ .Values.server.ingressGrpc.awsALB.serviceType }}
{{- end -}}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.certificate.enabled -}}
apiVersion: cert-manager.io/v1
kind: Certificate
@ -41,3 +42,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $config := .Values.server.clusterAdminAccess | default dict -}}
{{- if hasKey $config "enabled" | ternary $config.enabled .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
@ -60,3 +61,4 @@ rules:
{{/* supports triggering workflows from UI */}}
- create
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $config := .Values.server.clusterAdminAccess | default dict -}}
{{- if hasKey $config "enabled" | ternary $config.enabled .Values.createClusterRoles }}
apiVersion: rbac.authorization.k8s.io/v1
@ -15,3 +16,4 @@ subjects:
name: {{ include "argo-cd.serverServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end -}}

2
charts/argo-cd/templates/argocd-server/deployment.yaml Executable file → Normal file
View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@ -450,3 +451,4 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
dnsPolicy: {{ .Values.server.dnsPolicy }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.GKEbackendConfig.enabled }}
apiVersion: {{ include "argo-cd.apiVersions.cloudgoogle" . }}
kind: BackendConfig
@ -9,3 +10,4 @@ metadata:
spec:
{{- toYaml .Values.server.GKEbackendConfig.spec | nindent 2 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.GKEfrontendConfig.enabled }}
apiVersion: networking.gke.io/v1beta1
kind: FrontendConfig
@ -9,3 +10,4 @@ metadata:
spec:
{{- toYaml .Values.server.GKEfrontendConfig.spec | nindent 2 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.GKEmanagedCertificate.enabled }}
apiVersion: networking.gke.io/v1
kind: ManagedCertificate
@ -10,3 +11,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.autoscaling.enabled }}
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
@ -39,3 +40,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.server.ingressGrpc.enabled (not .Values.server.ingressGrpc.isAWSALB) -}}
{{- $servicePort := ternary .Values.server.service.servicePortHttps .Values.server.service.servicePortHttp .Values.server.ingressGrpc.https -}}
{{- $paths := .Values.server.ingressGrpc.paths -}}
@ -71,3 +72,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end -}}
{{- end -}}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.ingress.enabled -}}
{{- $servicePort := ternary .Values.server.service.servicePortHttps .Values.server.service.servicePortHttp .Values.server.ingress.https -}}
{{- $paths := .Values.server.ingress.paths -}}
@ -88,3 +89,4 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end -}}
{{- end -}}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.metrics.enabled }}
apiVersion: v1
kind: Service
@ -32,3 +33,4 @@ spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.global.networkPolicy.create }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
@ -15,3 +16,4 @@ spec:
policyTypes:
- Ingress
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.route.enabled -}}
apiVersion: route.openshift.io/v1
kind: Route
@ -25,3 +26,4 @@ spec:
insecureEdgeTerminationPolicy: {{ .Values.server.route.termination_policy | quote }}
wildcardPolicy: None
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
@ -25,3 +26,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
@ -53,3 +54,4 @@ rules:
verbs:
- create
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
@ -13,3 +14,4 @@ subjects:
- kind: ServiceAccount
name: {{ template "argo-cd.serverServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
apiVersion: v1
kind: Service
metadata:
@ -54,3 +55,4 @@ spec:
{{- with .Values.server.service.sessionAffinity }}
sessionAffinity: {{ . }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.server.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
@ -17,3 +18,4 @@ metadata:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.server.metrics.enabled .Values.server.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
@ -45,3 +46,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.server.name "name" (printf "%s-metrics" .Values.server.name)) | nindent 6 }}
{{- end }}
{{- end -}}

2
charts/argo-cd/templates/dex/deployment.yaml Executable file → Normal file
View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.dex.enabled }}
apiVersion: apps/v1
kind: Deployment
@ -205,3 +206,4 @@ spec:
{{- end }}
dnsPolicy: {{ .Values.dex.dnsPolicy }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.global.networkPolicy.create .Values.dex.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
@ -30,3 +31,4 @@ spec:
policyTypes:
- Ingress
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.dex.enabled .Values.dex.pdb.enabled }}
apiVersion: policy/v1
kind: PodDisruptionBudget
@ -25,3 +26,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.dex.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
@ -17,3 +18,4 @@ rules:
- list
- watch
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.dex.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
@ -15,3 +16,4 @@ subjects:
name: {{ template "argo-cd.dexServiceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if .Values.dex.enabled }}
apiVersion: v1
kind: Service
@ -34,3 +35,4 @@ spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.dex.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.dex.enabled .Values.dex.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
@ -14,3 +15,4 @@ metadata:
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.dex.metrics.enabled .Values.dex.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
@ -45,3 +46,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.dex.name "name" .Values.dex.name) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{ range .Values.extraObjects }}
---
{{ if typeIs "string" . }}
@ -6,3 +7,4 @@
{{- tpl (toYaml .) $ }}
{{- end }}
{{ end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.global.networkPolicy.create .Values.global.networkPolicy.defaultDenyIngress }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
@ -11,3 +12,4 @@ spec:
policyTypes:
- Ingress
{{- end }}
{{- end -}}

2
charts/argo-cd/templates/redis/deployment.yaml Executable file → Normal file
View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $redisHa := index .Values "redis-ha" -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) -}}
apiVersion: apps/v1
@ -146,3 +147,4 @@ spec:
{{- end }}
dnsPolicy: {{ .Values.redis.dnsPolicy }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $redisHa := (index .Values "redis-ha") -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) .Values.redis.metrics.enabled -}}
apiVersion: v1
@ -33,3 +34,4 @@ spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $redisHa := (index .Values "redis-ha") -}}
{{- if and .Values.global.networkPolicy.create .Values.redis.enabled (not $redisHa.enabled) }}
apiVersion: networking.k8s.io/v1
@ -35,3 +36,4 @@ spec:
policyTypes:
- Ingress
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $redisHa := index .Values "redis-ha" -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) .Values.redis.pdb.enabled }}
apiVersion: policy/v1
@ -26,3 +27,4 @@ spec:
matchLabels:
app.kubernetes.io/name: {{ include "argo-cd.name" . }}-{{ .Values.redis.name }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $redisHa := (index .Values "redis-ha") -}}
{{- if and .Values.redis.enabled (not $redisHa.enabled) -}}
apiVersion: v1
@ -24,3 +25,4 @@ spec:
selector:
{{- include "argo-cd.selectorLabels" (dict "context" . "name" .Values.redis.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- if and .Values.redis.enabled .Values.redis.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
@ -14,3 +15,4 @@ metadata:
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 4 }}
{{- end }}
{{- end -}}

View file

@ -1,3 +1,4 @@
{{- if not .Values.crds.only -}}
{{- $redisHa := (index .Values "redis-ha") -}}
{{- if and (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") .Values.redis.enabled (not $redisHa.enabled) .Values.redis.metrics.enabled .Values.redis.metrics.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
@ -46,3 +47,4 @@ spec:
matchLabels:
{{- include "argo-cd.selectorLabels" (dict "context" . "component" .Values.redis.name "name" .Values.redis.name) | nindent 6 }}
{{- end }}
{{- end -}}

View file

@ -28,6 +28,8 @@ openshift:
## Custom resource configuration
crds:
# -- Only install CRDs
only: false
# -- Install and upgrade CRDs
install: true
# -- Keep CRDs on chart uninstall