fix: use new-style labels

Signed-off-by: chgl <chgl@users.noreply.github.com>
This commit is contained in:
chgl 2021-04-26 21:43:36 +02:00
parent 86c8d2fac3
commit b652bdd757
21 changed files with 164 additions and 92 deletions

View file

@ -0,0 +1,5 @@
controller:
serviceMonitor:
enabled: true
metricsConfig:
enabled: true

View file

@ -0,0 +1,5 @@
workflow:
serviceAccount:
create: true # Specifies whether a service account should be created
rbac:
create: true # adds Role and RoleBinding for the above specified service account to be able to run workflows

View file

@ -1,16 +1,96 @@
{{/* vim: set filetype=mustache: */}} {{/* vim: set filetype=mustache: */}}
{{/*
Create argo workflows server name and version as used by the chart label.
*/}}
{{- define "argo-workflows.server.fullname" -}}
{{- printf "%s-%s" (include "argo-workflows.fullname" .) .Values.server.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create controller name and version as used by the chart label.
*/}}
{{- define "argo-workflows.controller.fullname" -}}
{{- printf "%s-%s" (include "argo-workflows.fullname" .) .Values.controller.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/* {{/*
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "name" -}} {{- define "argo-workflows.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end -}} {{- end }}
{{/* {{/*
Create a default fully qualified app name. Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}} */}}
{{- define "fullname" -}} {{- define "argo-workflows.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}} {{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "argo-workflows.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "argo-workflows.labels" -}}
helm.sh/chart: {{ include "argo-workflows.chart" .context }}
{{ include "argo-workflows.selectorLabels" (dict "context" .context "component" .component "name" .name) }}
app.kubernetes.io/managed-by: {{ .context.Release.Service }}
app.kubernetes.io/part-of: argo-workflows
{{- end }}
{{/*
Selector labels
*/}}
{{- define "argo-workflows.selectorLabels" -}}
{{- if .name -}}
app.kubernetes.io/name: {{ include "argo-workflows.name" .context }}-{{ .name }}
{{ end -}}
app.kubernetes.io/instance: {{ .context.Release.Name }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end }}
{{- end }}
{{/*
Create the name of the server service account to use
*/}}
{{- define "argo-workflows.serverServiceAccountName" -}}
{{- if .Values.server.createServiceAccount -}}
{{ default (include "argo-workflows.fullname" .) .Values.server.serviceAccount }}
{{- else -}}
{{ default "default" .Values.server.serviceAccount }}
{{- end -}}
{{- end -}}
{{/*
Create the name of the controller service account to use
*/}}
{{- define "argo-workflows.controllerServiceAccountName" -}}
{{- if .Values.controller.createServiceAccount -}}
{{ default (include "argo-workflows.fullname" .) .Values.controller.serviceAccount }}
{{- else -}}
{{ default "default" .Values.controller.serviceAccount }}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for ingress
*/}}
{{- define "argo-cd.ingress.apiVersion" -}}
{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "extensions/v1beta1" -}}
{{- else if semverCompare "<1.19-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "networking.k8s.io/v1" -}}
{{- end -}}
{{- end -}}

View file

@ -5,7 +5,7 @@ metadata:
annotations: annotations:
helm.sh/hook: pre-install helm.sh/hook: pre-install
helm.sh/hook-delete-policy: before-hook-creation helm.sh/hook-delete-policy: before-hook-creation
name: argo-aggregate-to-view name: argo-workflows-aggregate-to-view
labels: labels:
rbac.authorization.k8s.io/aggregate-to-view: "true" rbac.authorization.k8s.io/aggregate-to-view: "true"
rules: rules:
@ -33,7 +33,7 @@ metadata:
annotations: annotations:
helm.sh/hook: pre-install helm.sh/hook: pre-install
helm.sh/hook-delete-policy: before-hook-creation helm.sh/hook-delete-policy: before-hook-creation
name: argo-aggregate-to-edit name: argo-workflows-aggregate-to-edit
labels: labels:
rbac.authorization.k8s.io/aggregate-to-edit: "true" rbac.authorization.k8s.io/aggregate-to-edit: "true"
rules: rules:
@ -66,7 +66,7 @@ metadata:
annotations: annotations:
helm.sh/hook: pre-install helm.sh/hook: pre-install
helm.sh/hook-delete-policy: before-hook-creation helm.sh/hook-delete-policy: before-hook-creation
name: argo-aggregate-to-admin name: argo-workflows-aggregate-to-admin
labels: labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true" rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules: rules:

View file

@ -5,7 +5,9 @@ kind: Role
kind: ClusterRole kind: ClusterRole
{{- end }} {{- end }}
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.controller.name }} name: {{ template "argo-workflows.controller.fullname" . }}
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
rules: rules:
- apiGroups: - apiGroups:
- "" - ""

View file

@ -1,11 +1,9 @@
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.controller.name }}-configmap name: {{ template "argo-workflows.controller.fullname" . }}-configmap
labels: labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" "cm") | nindent 4 }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data: data:
config: | config: |
{{- if .Values.controller.instanceID.enabled }} {{- if .Values.controller.instanceID.enabled }}

View file

@ -5,7 +5,9 @@ kind: RoleBinding
kind: ClusterRoleBinding kind: ClusterRoleBinding
{{- end }} {{- end }}
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.controller.name }} name: {{ template "argo-workflows.controller.fullname" . }}
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
{{- if .Values.singleNamespace }} {{- if .Values.singleNamespace }}
@ -13,7 +15,7 @@ roleRef:
{{ else }} {{ else }}
kind: ClusterRole kind: ClusterRole
{{- end }} {{- end }}
name: {{ .Release.Name }}-{{ .Values.controller.name }} name: {{ template "argo-workflows.controller.fullname" . }}
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ .Values.controller.serviceAccount }} name: {{ .Values.controller.serviceAccount }}
@ -33,11 +35,13 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.controller.name }}-cluster-template name: {{ template "argo-workflows.controller.fullname" . }}-cluster-template
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole
name: {{ .Release.Name }}-{{ .Values.controller.name }}-cluster-template name: {{ template "argo-workflows.controller.fullname" . }}-cluster-template
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ .Values.controller.serviceAccount }} name: {{ .Values.controller.serviceAccount }}

View file

@ -2,12 +2,9 @@
apiVersion: policy/v1beta1 apiVersion: policy/v1beta1
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.controller.name}} name: {{ template "argo-workflows.controller.fullname" . }}
labels: labels:
app: {{ .Release.Name }}-{{ .Values.controller.name}} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec: spec:
{{- if .Values.controller.pdb.minAvailable }} {{- if .Values.controller.pdb.minAvailable }}
minAvailable: {{ .Values.controller.pdb.minAvailable }} minAvailable: {{ .Values.controller.pdb.minAvailable }}
@ -18,6 +15,5 @@ spec:
{{- end }} {{- end }}
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-{{ .Values.controller.name}} {{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
release: {{ .Release.Name }}
{{- end }} {{- end }}

View file

@ -1,23 +1,20 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.controller.name}} name: {{ template "argo-workflows.controller.fullname" . }}
labels: labels:
app: {{ .Release.Name }}-{{ .Values.controller.name}} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/version: {{ default .Chart.AppVersion .Values.controller.image.tag | quote }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec: spec:
replicas: {{ .Values.controller.replicas }} replicas: {{ .Values.controller.replicas }}
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-{{ .Values.controller.name}} {{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
release: {{ .Release.Name }}
template: template:
metadata: metadata:
labels: labels:
app: {{ .Release.Name }}-{{ .Values.controller.name}} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 8 }}
release: {{ .Release.Name }} app.kubernetes.io/version: {{ default .Chart.AppVersion .Values.controller.image.tag | quote }}
{{- if .Values.controller.podLabels }} {{- if .Values.controller.podLabels }}
{{ toYaml .Values.controller.podLabels | nindent 8}} {{ toYaml .Values.controller.podLabels | nindent 8}}
{{- end }} {{- end }}
@ -25,7 +22,7 @@ spec:
annotations: annotations:
{{ toYaml .Values.controller.podAnnotations | indent 8}}{{- end }} {{ toYaml .Values.controller.podAnnotations | indent 8}}{{- end }}
spec: spec:
serviceAccountName: {{ .Values.controller.serviceAccount | quote }} serviceAccountName: {{ template "argo-workflows.controllerServiceAccountName" . }}
{{- if .Values.controller.podSecurityContext }} {{- if .Values.controller.podSecurityContext }}
securityContext: securityContext:
{{- toYaml .Values.controller.podSecurityContext | nindent 8 }} {{- toYaml .Values.controller.podSecurityContext | nindent 8 }}
@ -37,7 +34,7 @@ spec:
command: [ "workflow-controller" ] command: [ "workflow-controller" ]
args: args:
- "--configmap" - "--configmap"
- "{{ .Release.Name }}-{{ .Values.controller.name}}-configmap" - "{{ template "argo-workflows.controller.fullname" . }}-configmap"
- "--executor-image" - "--executor-image"
- "{{ .Values.executor.image.registry }}/{{ .Values.executor.image.repository }}:{{ .Values.executor.image.tag | default .Chart.AppVersion }}" - "{{ .Values.executor.image.registry }}/{{ .Values.executor.image.repository }}:{{ .Values.executor.image.tag | default .Chart.AppVersion }}"
- "--loglevel" - "--loglevel"

View file

@ -1,6 +1,6 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: {{ .Values.controller.serviceAccount }} name: {{ template "argo-workflows.controllerServiceAccountName" . }}
annotations: annotations:
{{ toYaml .Values.controller.serviceAccountAnnotations | indent 4 }} {{ toYaml .Values.controller.serviceAccountAnnotations | indent 4 }}

View file

@ -2,12 +2,10 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.controller.name }} name: {{ template "argo-workflows.controller.fullname" . }}
labels: labels:
app: {{ .Release.Name }}-{{ .Values.controller.name}} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} app.kubernetes.io/version: {{ default .Chart.AppVersion .Values.controller.image.tag | quote }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.controller.serviceLabels }} {{- if .Values.controller.serviceLabels }}
{{ toYaml .Values.controller.serviceLabels | nindent 4}} {{ toYaml .Values.controller.serviceLabels | nindent 4}}
{{- end }} {{- end }}
@ -29,7 +27,7 @@ spec:
targetPort: {{ .Values.controller.telemetryConfig.port }} targetPort: {{ .Values.controller.telemetryConfig.port }}
{{- end }} {{- end }}
selector: selector:
app: {{ .Release.Name }}-{{ .Values.controller.name }} {{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 4 }}
sessionAffinity: None sessionAffinity: None
type: {{ .Values.controller.serviceType }} type: {{ .Values.controller.serviceType }}
{{- if and (eq .Values.controller.serviceType "LoadBalancer") .Values.controller.loadBalancerSourceRanges }} {{- if and (eq .Values.controller.serviceType "LoadBalancer") .Values.controller.loadBalancerSourceRanges }}

View file

@ -2,12 +2,9 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.controller.name }} name: {{ template "argo-workflows.controller.fullname" . }}
labels: labels:
app: {{ .Release.Name }}-{{ .Values.controller.name}} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- if .Values.controller.serviceMonitor.additionalLabels }} {{- if .Values.controller.serviceMonitor.additionalLabels }}
{{ toYaml .Values.controller.serviceMonitor.additionalLabels | indent 4 }} {{ toYaml .Values.controller.serviceMonitor.additionalLabels | indent 4 }}
{{- end }} {{- end }}
@ -28,6 +25,5 @@ spec:
- {{ .Release.Namespace }} - {{ .Release.Namespace }}
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-{{ .Values.controller.name}} {{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
release: {{ .Release.Name }}
{{- end }} {{- end }}

View file

@ -2,14 +2,14 @@
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
name: {{ .Release.Name }}-workflow name: {{ template "argo-workflows.fullname" . }}-workflow
{{- if .Values.workflow.namespace }} {{- if .Values.workflow.namespace }}
namespace: {{ .Values.workflow.namespace }} namespace: {{ .Values.workflow.namespace }}
{{- end }} {{- end }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: Role kind: Role
name: {{ .Release.Name }}-workflow name: {{ template "argo-workflows.fullname" . }}-workflow
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ .Values.workflow.serviceAccount.name }} name: {{ .Values.workflow.serviceAccount.name }}

View file

@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: Role kind: Role
metadata: metadata:
name: {{ .Release.Name }}-workflow name: {{ template "argo-workflows.fullname" . }}-workflow
{{- if .Values.workflow.namespace }} {{- if .Values.workflow.namespace }}
namespace: {{ .Values.workflow.namespace }} namespace: {{ .Values.workflow.namespace }}
{{- end }} {{- end }}

View file

@ -6,7 +6,9 @@ kind: Role
kind: ClusterRole kind: ClusterRole
{{- end }} {{- end }}
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.server.name }} name: {{ template "argo-workflows.server.fullname" . }}
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
rules: rules:
- apiGroups: - apiGroups:
- "" - ""
@ -115,7 +117,9 @@ rules:
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole kind: ClusterRole
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.server.name }}-cluster-template name: {{ template "argo-workflows.server.fullname" . }}-cluster-template
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
rules: rules:
- apiGroups: - apiGroups:
- argoproj.io - argoproj.io

View file

@ -6,7 +6,9 @@ kind: RoleBinding
kind: ClusterRoleBinding kind: ClusterRoleBinding
{{- end }} {{- end }}
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.server.name}} name: {{ template "argo-workflows.server.fullname" . }}
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
{{- if .Values.singleNamespace }} {{- if .Values.singleNamespace }}
@ -14,7 +16,7 @@ roleRef:
{{ else }} {{ else }}
kind: ClusterRole kind: ClusterRole
{{- end }} {{- end }}
name: {{ .Release.Name }}-{{ .Values.server.name}} name: {{ template "argo-workflows.server.fullname" . }}
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ .Values.server.serviceAccount }} name: {{ .Values.server.serviceAccount }}
@ -23,11 +25,13 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1 apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding kind: ClusterRoleBinding
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-template name: {{ template "argo-workflows.server.fullname" . }}-cluster-template
labels:
{{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: ClusterRole kind: ClusterRole
name: {{ .Release.Name }}-{{ .Values.server.name}}-cluster-template name: {{ template "argo-workflows.server.fullname" . }}-cluster-template
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ .Values.server.serviceAccount }} name: {{ .Values.server.serviceAccount }}

View file

@ -3,12 +3,9 @@
apiVersion: policy/v1beta1 apiVersion: policy/v1beta1
kind: PodDisruptionBudget kind: PodDisruptionBudget
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.server.name}} name: {{ template "argo-workflows.server.fullname" . }}
labels: labels:
app: {{ .Release.Name }}-{{ .Values.server.name}} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec: spec:
{{- if .Values.server.pdb.minAvailable }} {{- if .Values.server.pdb.minAvailable }}
minAvailable: {{ .Values.server.pdb.minAvailable }} minAvailable: {{ .Values.server.pdb.minAvailable }}
@ -19,7 +16,6 @@ spec:
{{- end }} {{- end }}
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-{{ .Values.server.name}} {{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 6 }}
release: {{ .Release.Name }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}

View file

@ -2,22 +2,20 @@
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.server.name}} name: {{ template "argo-workflows.server.fullname" . }}
labels: labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
release: {{ .Release.Name }} app.kubernetes.io/version: {{ default .Chart.AppVersion .Values.server.image.tag | quote }}
heritage: {{ .Release.Service }}
spec: spec:
replicas: {{ .Values.server.replicas }} replicas: {{ .Values.server.replicas }}
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }}-{{ .Values.server.name}} {{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 6 }}
release: {{ .Release.Name }}
template: template:
metadata: metadata:
labels: labels:
app: {{ .Release.Name }}-{{ .Values.server.name}} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 8 }}
release: {{ .Release.Name }} app.kubernetes.io/version: {{ default .Chart.AppVersion .Values.server.image.tag | quote }}
{{- if .Values.server.podLabels }} {{- if .Values.server.podLabels }}
{{- toYaml .Values.server.podLabels | nindent 8 }} {{- toYaml .Values.server.podLabels | nindent 8 }}
{{- end }} {{- end }}

View file

@ -1,19 +1,12 @@
{{- if .Values.server.enabled -}} {{- if .Values.server.enabled -}}
{{- if .Values.server.ingress.enabled -}} {{- if .Values.server.ingress.enabled -}}
{{- $serviceName := printf "%s-%s" .Release.Name .Values.server.name -}} {{- $serviceName := include "argo-workflows.server.fullname" . -}}
{{- $servicePort := .Values.server.servicePort -}} {{- $servicePort := .Values.server.servicePort -}}
{{- if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" }} apiVersion: {{ include "argo-workflows.ingress.apiVersion" . }}
apiVersion: networking.k8s.io/v1beta1
{{ else }}
apiVersion: extensions/v1beta1
{{ end -}}
kind: Ingress
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.server.name }} name: {{ template "argo-workflows.server.fullname" . }}
labels: labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} {{- include "argo-workflows.labels" $ | nindent 4 }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- range $key, $value := .Values.server.ingress.labels }} {{- range $key, $value := .Values.server.ingress.labels }}
{{ $key }}: {{ $value | quote }} {{ $key }}: {{ $value | quote }}
{{- end }} {{- end }}

View file

@ -2,7 +2,7 @@
apiVersion: v1 apiVersion: v1
kind: ServiceAccount kind: ServiceAccount
metadata: metadata:
name: {{ .Values.server.serviceAccount }} name: {{ template "argo-workflows.serverServiceAccountName" . }}
annotations: annotations:
{{ toYaml .Values.server.serviceAccountAnnotations | indent 4 }} {{ toYaml .Values.server.serviceAccountAnnotations | indent 4 }}
{{- end -}} {{- end -}}

View file

@ -2,14 +2,10 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ .Release.Name }}-{{ .Values.server.name }} name: {{ template "argo-workflows.server.fullname" . }}
labels: labels:
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} {{- include "argo-workflows.labels" (dict "context" . "component" .Values.server.name "name" .Values.server.name) | nindent 4 }}
release: {{ .Release.Name }} app.kubernetes.io/version: {{ default .Chart.AppVersion .Values.server.image.tag | quote }}
heritage: {{ .Release.Service }}
{{- if .Values.server.serviceLabels }}
{{- toYaml .Values.server.serviceLabels | nindent 4 }}
{{- end }}
{{- if .Values.server.serviceAnnotations }} {{- if .Values.server.serviceAnnotations }}
annotations: annotations:
{{ toYaml .Values.server.serviceAnnotations | indent 4}}{{- end }} {{ toYaml .Values.server.serviceAnnotations | indent 4}}{{- end }}
@ -21,7 +17,7 @@ spec:
{{- end }} {{- end }}
targetPort: 2746 targetPort: 2746
selector: selector:
app: {{ .Release.Name }}-{{ .Values.server.name }} {{- include "argo-workflows.selectorLabels" (dict "context" . "name" .Values.server.name) | nindent 4 }}
sessionAffinity: None sessionAffinity: None
type: {{ .Values.server.serviceType }} type: {{ .Values.server.serviceType }}
{{- if and (eq .Values.server.serviceType "LoadBalancer") .Values.server.loadBalancerIP }} {{- if and (eq .Values.server.serviceType "LoadBalancer") .Values.server.loadBalancerIP }}