github.com/kubevela/workflow@v0.6.0/charts/vela-workflow/templates/workflow-controller.yaml (about) 1 {{- if .Values.serviceAccount.create -}} 2 apiVersion: v1 3 kind: ServiceAccount 4 metadata: 5 name: {{ include "kubevela.serviceAccountName" . }} 6 labels: 7 {{- include "kubevela.labels" . | nindent 4 }} 8 {{- with .Values.serviceAccount.annotations }} 9 annotations: 10 {{- toYaml . | nindent 4 }} 11 {{- end }} 12 {{- end }} 13 14 --- 15 16 apiVersion: rbac.authorization.k8s.io/v1 17 kind: ClusterRoleBinding 18 metadata: 19 name: {{ include "kubevela.fullname" . }}:manager-rolebinding 20 roleRef: 21 apiGroup: rbac.authorization.k8s.io 22 kind: ClusterRole 23 name: "cluster-admin" 24 subjects: 25 - kind: ServiceAccount 26 name: {{ include "kubevela.serviceAccountName" . }} 27 namespace: {{ .Release.Namespace }} 28 29 --- 30 31 # permissions to do leader election. 32 apiVersion: rbac.authorization.k8s.io/v1 33 kind: Role 34 metadata: 35 name: {{ include "kubevela.fullname" . }}:leader-election-role 36 rules: 37 - apiGroups: 38 - "" 39 resources: 40 - configmaps 41 verbs: 42 - get 43 - list 44 - watch 45 - create 46 - update 47 - patch 48 - delete 49 - apiGroups: 50 - "" 51 resources: 52 - configmaps/status 53 verbs: 54 - get 55 - update 56 - patch 57 - apiGroups: 58 - "" 59 resources: 60 - events 61 verbs: 62 - create 63 64 --- 65 apiVersion: rbac.authorization.k8s.io/v1 66 kind: RoleBinding 67 metadata: 68 name: {{ include "kubevela.fullname" . }}:leader-election-rolebinding 69 roleRef: 70 apiGroup: rbac.authorization.k8s.io 71 kind: Role 72 name: {{ include "kubevela.fullname" . }}:leader-election-role 73 subjects: 74 - kind: ServiceAccount 75 name: {{ include "kubevela.serviceAccountName" . }} 76 77 --- 78 apiVersion: apps/v1 79 kind: Deployment 80 metadata: 81 name: {{ include "kubevela.fullname" . }} 82 namespace: {{ .Release.Namespace }} 83 labels: 84 controller.oam.dev/name: vela-workflow 85 {{- include "kubevela.labels" . | nindent 4 }} 86 spec: 87 replicas: {{ .Values.replicaCount }} 88 selector: 89 matchLabels: 90 {{- include "kubevela.selectorLabels" . | nindent 6 }} 91 template: 92 metadata: 93 labels: 94 {{- include "kubevela.selectorLabels" . | nindent 8 }} 95 annotations: 96 prometheus.io/path: /metrics 97 prometheus.io/port: "8080" 98 prometheus.io/scrape: "true" 99 spec: 100 {{- with .Values.imagePullSecrets }} 101 imagePullSecrets: 102 {{- toYaml . | nindent 8 }} 103 {{- end }} 104 serviceAccountName: {{ include "kubevela.serviceAccountName" . }} 105 securityContext: 106 {{- toYaml .Values.podSecurityContext | nindent 8 }} 107 containers: 108 - name: {{ .Release.Name }} 109 securityContext: 110 {{- toYaml .Values.securityContext | nindent 12 }} 111 args: 112 - "-test.coverprofile=/workspace/data/e2e-profile.out" 113 - "__DEVEL__E2E" 114 - "-test.run=E2EMain" 115 - "-test.coverpkg=$(go list ./pkg/...| tr ' 116 ' ','| sed 's/,$//g')" 117 {{ if .Values.admissionWebhooks.enabled }} 118 - "--use-webhook=true" 119 - "--webhook-port={{ .Values.webhookService.port }}" 120 - "--webhook-cert-dir={{ .Values.admissionWebhooks.certificate.mountPath }}" 121 {{ end }} 122 {{ if ne .Values.logFilePath "" }} 123 - "--log-file-path={{ .Values.logFilePath }}" 124 - "--log-file-max-size={{ .Values.logFileMaxSize }}" 125 {{ end }} 126 {{ if .Values.logDebug }} 127 - "--log-debug=true" 128 {{ end }} 129 - "--metrics-bind-address=:8080" 130 - "--leader-elect" 131 - "--health-probe-bind-address=:{{ .Values.healthCheck.port }}" 132 - "--concurrent-reconciles={{ .Values.concurrentReconciles }}" 133 - "--ignore-workflow-without-controller-requirement={{ .Values.ignoreWorkflowWithoutControllerRequirement }}" 134 - "--kube-api-qps={{ .Values.kubeClient.qps }}" 135 - "--kube-api-burst={{ .Values.kubeClient.burst }}" 136 - "--user-agent={{ .Values.kubeClient.userAgent }}" 137 - "--max-workflow-wait-backoff-time={{ .Values.workflow.backoff.maxTime.waitState }}" 138 - "--max-workflow-failed-backoff-time={{ .Values.workflow.backoff.maxTime.failedState }}" 139 - "--max-workflow-step-error-retry-times={{ .Values.workflow.step.errorRetryTimes }}" 140 - "--feature-gates=EnableWatchEventListener={{- .Values.workflow.enableWatchEventListener | toString -}}" 141 - "--feature-gates=EnablePatchStatusAtOnce={{- .Values.workflow.enablePatchStatusAtOnce | toString -}}" 142 - "--feature-gates=EnableSuspendOnFailure={{- .Values.workflow.enableSuspendOnFailure | toString -}}" 143 - "--feature-gates=EnableBackupWorkflowRecord={{- .Values.backup.enabled | toString -}}" 144 - "--group-by-label={{ .Values.workflow.groupByLabel }}" 145 {{ if .Values.backup.enable }} 146 - "--backup-strategy={{ .Values.backup.strategy }}" 147 - "--backup-ignore-strategy={{ .Values.backup.ignoreStrategy }}" 148 - "--backup-clean-on-backup={{ .Values.backup.cleanOnBackup }}" 149 - "--backup-persist-type={{ .Values.backup.persisType }}" 150 - "--backup-config-secret-name={{ .Values.backup.configSecretName }}" 151 - "--backup-config-secret-namespace={{ .Values.backup.configSecretNamespace }}" 152 {{ end }} 153 image: {{ .Values.imageRegistry }}{{ .Values.image.repository }}:{{ .Values.image.tag }} 154 imagePullPolicy: {{ quote .Values.image.pullPolicy }} 155 resources: 156 {{- toYaml .Values.resources | nindent 12 }} 157 {{ if .Values.admissionWebhooks.enabled }} 158 ports: 159 - containerPort: {{ .Values.webhookService.port }} 160 name: webhook-server 161 protocol: TCP 162 - containerPort: {{ .Values.healthCheck.port }} 163 name: healthz 164 protocol: TCP 165 readinessProbe: 166 httpGet: 167 path: /readyz 168 port: healthz 169 initialDelaySeconds: 30 170 periodSeconds: 5 171 livenessProbe: 172 httpGet: 173 path: /healthz 174 port: healthz 175 initialDelaySeconds: 90 176 periodSeconds: 5 177 volumeMounts: 178 - mountPath: {{ .Values.admissionWebhooks.certificate.mountPath }} 179 name: tls-cert-vol 180 readOnly: true 181 {{ end }} 182 {{ if .Values.admissionWebhooks.enabled }} 183 volumes: 184 - name: tls-cert-vol 185 secret: 186 defaultMode: 420 187 secretName: {{ template "kubevela.fullname" . }}-admission 188 {{ end }} 189 {{- with .Values.nodeSelector }} 190 nodeSelector: 191 {{- toYaml . | nindent 8 }} 192 {{- end }} 193 {{- with .Values.affinity }} 194 affinity: 195 {{- toYaml . | nindent 8 }} 196 {{- end }} 197 {{- with .Values.tolerations }} 198 tolerations: 199 {{- toYaml . | nindent 8 }} 200 {{- end }}