diff --git a/charts/argo/templates/server-clusterrole.yaml b/charts/argo/templates/server-clusterrole.yaml new file mode 100644 index 00000000..80992780 --- /dev/null +++ b/charts/argo/templates/server-clusterrole.yaml @@ -0,0 +1,82 @@ +{{- if .Values.server.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-role +rules: +- apiGroups: + - "" + resources: + - pods + - pods/exec + verbs: + - create + - get + - list + - watch + - update + - patch + - delete +- apiGroups: + - "" + resources: + - configmaps + verbs: + - get + - watch + - list +- apiGroups: + - "" + resources: + - persistentvolumeclaims + verbs: + - create + - delete +- apiGroups: + - argoproj.io + resources: + - workflows + - workflows/finalizers + verbs: + - get + - list + - watch + - update + - patch + - delete + - create +- apiGroups: + - argoproj.io + resources: + - workflowtemplates + - workflowtemplates/finalizers + verbs: + - get + - list + - watch +- apiGroups: + - "" + resources: + - serviceaccounts + verbs: + - get + - list +- apiGroups: + - argoproj.io + resources: + - cronworkflows + - cronworkflows/finalizers + verbs: + - get + - list + - watch + - update + - patch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - create +{{- end }} diff --git a/charts/argo/templates/server-configmap.yaml b/charts/argo/templates/server-configmap.yaml new file mode 100644 index 00000000..6140663a --- /dev/null +++ b/charts/argo/templates/server-configmap.yaml @@ -0,0 +1,50 @@ +{{- if .Values.server.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-{{ .Values.server.name }}-configmap + labels: + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: + config: | + {{- if .Values.server.instanceID.enabled }} + {{- if .Values.server.instanceID.useReleaseName }} + instanceID: {{ .Release.Name }} + {{- else }} + instanceID: {{ .Values.server.instanceID.explicitID }} + {{- end }} + {{- end }} + containerRuntimeExecutor: {{ .Values.server.containerRuntimeExecutor }} + artifactRepository: + {{- if or .Values.minio.install .Values.useDefaultArtifactRepo }} + {{- if .Values.artifactRepository.archiveLogs }} + archiveLogs: {{ .Values.artifactRepository.archiveLogs }} + {{- end }} + s3: + {{- if .Values.useStaticCredentials }} + accessKeySecret: + key: {{ .Values.artifactRepository.s3.accessKeySecret.key }} + name: {{ .Values.artifactRepository.s3.accessKeySecret.name | default (printf "%s-%s" .Release.Name "minio") }} + secretKeySecret: + key: {{ .Values.artifactRepository.s3.secretKeySecret.key }} + name: {{ .Values.artifactRepository.s3.secretKeySecret.name | default (printf "%s-%s" .Release.Name "minio") }} + {{- end }} + bucket: {{ .Values.artifactRepository.s3.bucket | default .Values.minio.defaultBucket.name }} + endpoint: {{ .Values.artifactRepository.s3.endpoint | default (printf "%s-%s" .Release.Name "minio:9000") }} + insecure: {{ .Values.artifactRepository.s3.insecure }} + {{- if .Values.artifactRepository.s3.keyPrefix }} + keyPrefix: {{ .Values.artifactRepository.s3.keyPrefix }} + {{- end }} + {{- end}} + {{- if .Values.server.metricsConfig.enabled }} + metricsConfig: +{{ toYaml .Values.server.metricsConfig | indent 6}}{{- end }} + {{- if .Values.server.telemetryConfig.enabled }} + telemetryConfig: +{{ toYaml .Values.server.telemetryConfig | indent 6}}{{- end }} + {{- if .Values.server.persistence }} + persistence: +{{ toYaml .Values.server.persistence | indent 6 }}{{- end }} +{{- end }} diff --git a/charts/argo/templates/server-crb.yaml b/charts/argo/templates/server-crb.yaml new file mode 100644 index 00000000..a406c373 --- /dev/null +++ b/charts/argo/templates/server-crb.yaml @@ -0,0 +1,25 @@ +{{- if .Values.server.enabled }} +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: {{ .Release.Name }}-{{ .Values.server.name}}-binding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-role +subjects: + - kind: ServiceAccount + name: {{ .Values.server.serviceAccount }} + namespace: {{ .Release.Namespace }} +{{- if .Values.server.workflowNamespaces }} +{{- $uiServiceAccount := .Values.server.serviceAccount }} +{{- $namespace := .Release.Namespace }} +{{- range $key := .Values.server.workflowNamespaces }} + {{- if not (eq $key $namespace) }} + - kind: ServiceAccount + name: {{ $uiServiceAccount }} + namespace: {{ $key }} + {{- end }} +{{- end }} +{{- end }} +{{- end }} diff --git a/charts/argo/templates/server-deployment.yaml b/charts/argo/templates/server-deployment.yaml new file mode 100644 index 00000000..9a6379a6 --- /dev/null +++ b/charts/argo/templates/server-deployment.yaml @@ -0,0 +1,68 @@ +{{- if .Values.server.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-{{ .Values.server.name}} + labels: + app: {{ .Release.Name }}-{{ .Values.server.name}} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + replicas: {{ .Values.server.replicas }} + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Values.server.name}} + release: {{ .Release.Name }} + template: + metadata: + labels: + app: {{ .Release.Name }}-{{ .Values.server.name}} + release: {{ .Release.Name }} + {{- if .Values.server.podLabels }} + {{ toYaml .Values.server.podLabels | nindent 8}} + {{- end }} + {{- if .Values.server.podAnnotations }} + annotations: +{{ toYaml .Values.server.podAnnotations | indent 8}}{{- end }} + spec: + serviceAccountName: {{ .Values.server.serviceAccount | quote }} + containers: + - name: server + image: "{{ .Values.images.namespace }}/{{ .Values.images.server }}:{{ default .Values.images.tag .Values.server.image.tag }}" + imagePullPolicy: {{ .Values.images.pullPolicy }} + command: [ "workflow-controller" ] + args: + - "--configmap" + - "{{ .Release.Name }}-{{ .Values.server.name}}-configmap" + - "--executor-image" + - "{{ .Values.images.namespace }}/{{ .Values.images.executor }}:{{ default .Values.images.tag .Values.executor.image.tag }}" + - "--loglevel" + - "{{ .Values.server.logging.level }}" + - "--gloglevel" + - "{{ .Values.server.logging.globallevel }}" + env: + - name: ARGO_NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + resources: + {{- toYaml .Values.server.resources | nindent 12 }} + {{- if .Values.server.metricsConfig.enabled }} + ports: + - containerPort: 8080 + {{- end }} + {{- with .Values.server.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.server.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.server.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/charts/argo/templates/server-sa.yaml b/charts/argo/templates/server-sa.yaml new file mode 100644 index 00000000..a7b03d93 --- /dev/null +++ b/charts/argo/templates/server-sa.yaml @@ -0,0 +1,6 @@ +{{- if .Values.server.enabled }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.server.serviceAccount }} +{{- end }} diff --git a/charts/argo/values.yaml b/charts/argo/values.yaml index c78cb075..6ad45dca 100644 --- a/charts/argo/values.yaml +++ b/charts/argo/values.yaml @@ -102,6 +102,45 @@ executor: # Overrides .images.tag if defined. tag: "" +server: + enabled: true + name: server + image: + tag: "" + # podAnnotations is an optional map of annotations to be applied to the server Pods + podAnnotations: {} + # Optional labels to add to the server pods + podLabels: {} + # podPortName: http + metricsConfig: + enabled: false + path: /metrics + port: 8080 + persistence: {} + telemetryConfig: + enabled: false + path: /telemetry + port: 8081 + serviceMonitor: + enabled: false + additionalLabels: {} + serviceAccount: argo + name: workflow-controller + workflowNamespaces: + - default + containerRuntimeExecutor: docker + instanceID: + # `instanceID.enabled` configures the controller to filter workflow submissions + # to only those which have a matching instanceID attribute. + enabled: false + # NOTE: If `instanceID.enabled` is set to `true` then either `instanceID.userReleaseName` + # or `instanceID.explicitID` must be defined. + # useReleaseName: true + # explicitID: unique-argo-controller-identifier + logging: + level: info + globallevel: "0" + ui: enabled: true # only show workflows where UI installed