feat(argo-events): Upgrade argo-events to v1.7.0 (#1269)

* feat(argo-events) : Upgrade argo-events to v1.7.0

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Fix typos

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Add missing braces

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Use templates for service account names

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Drop application labels

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Update documentation

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Move CRDs to template folder

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Disable webhook by default

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Fix indentation

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Update README

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Drop prefix from aggregate-roles

Signed-off-by: Petr Drastil <petr.drastil@gmail.com>

* Fix typo aggragate-roles.yaml -> aggregate-roles.yaml

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Use helm-docs.sh

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Fix typo REALEASE -> RELEASE

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* Use consistent wording/style

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

Co-authored-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
Petr Drastil 2022-06-14 17:37:47 +02:00 committed by GitHub
parent 99f97cafd9
commit d2c2055290
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 1520 additions and 909 deletions

View file

@ -24,3 +24,76 @@ If release name contains chart name it will be used as a full name.
{{- end }}
{{- end }}
{{- end }}
{{/*
Create controller name and version as used by the chart label.
*/}}
{{- define "argo-events.controller.fullname" -}}
{{- printf "%s-%s" (include "argo-events.fullname" .) .Values.controller.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the controller service account to use
*/}}
{{- define "argo-events.controller.serviceAccountName" -}}
{{- if .Values.controller.serviceAccount.create -}}
{{ default (include "argo-events.controller.fullname" .) .Values.controller.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.controller.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create webhook name and version as used by the chart label.
*/}}
{{- define "argo-events.webhook.fullname" }}
{{- printf "%s-%s" (include "argo-events.fullname" .) .Values.webhook.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the webhook service account to use
*/}}
{{- define "argo-events.webhook.serviceAccountName" -}}
{{- if .Values.webhook.serviceAccount.create -}}
{{ default (include "argo-events.webhook.fullname" .) .Values.webhook.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.webhook.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "argo-events.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "argo-events.labels" -}}
helm.sh/chart: {{ include "argo-events.chart" .context }}
{{ include "argo-events.selectorLabels" (dict "context" .context "component" .component "name" .name) }}
app.kubernetes.io/managed-by: {{ .context.Release.Service }}
app.kubernetes.io/part-of: argo-events
{{- end }}
{{/*
Selector labels
*/}}
{{- define "argo-events.selectorLabels" -}}
{{- if .name -}}
app.kubernetes.io/name: {{ include "argo-events.name" .context }}-{{ .name }}
{{- end }}
app.kubernetes.io/instance: {{ .context.Release.Name }}
{{- if .component }}
app.kubernetes.io/component: {{ .component }}
{{- end }}
{{- end }}
{{/*
Return the default Argo Events app version
*/}}
{{- define "argo-events.defaultTag" -}}
{{- default .Chart.AppVersion .Values.global.image.tag }}
{{- end -}}

View file

@ -1,83 +1,86 @@
{{- if and .Values.createAggregateRoles (not .Values.singleNamespace) }}
{{- if and .Values.createAggregateRoles (not .Values.controller.rbac.namespaced) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "argo-events.fullname" . }}-aggregate-to-admin
labels:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
name: {{ include "argo-events.fullname" . }}-aggregate-to-admin
{{- include "argo-events.labels" (dict "context" .) | nindent 4 }}
rules:
- apiGroups:
- argoproj.io
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- argoproj.io
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "argo-events.fullname" . }}-aggregate-to-edit
labels:
rbac.authorization.k8s.io/aggregate-to-edit: "true"
name: {{ include "argo-events.fullname" . }}-aggregate-to-edit
{{- include "argo-events.labels" (dict "context" .) | nindent 4 }}
rules:
- apiGroups:
- argoproj.io
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- argoproj.io
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "argo-events.fullname" . }}-aggregate-to-view
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
name: {{ include "argo-events.fullname" . }}-aggregate-to-view
{{- include "argo-events.labels" (dict "context" .) | nindent 4 }}
rules:
- apiGroups:
- argoproj.io
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
verbs:
- get
- list
- watch
- apiGroups:
- argoproj.io
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
verbs:
- get
- list
- watch
{{- end }}

View file

@ -1,101 +0,0 @@
{{- if not .Values.singleNamespace }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: argo-events-binding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: argo-events-role
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount }}
namespace: {{ .Release.Namespace }}
{{- if .Values.additionalSaNamespaces }}
{{ $sa := .Values.serviceAccount }}
{{- range $namespace := .Values.additionalSaNamespaces }}
- kind: ServiceAccount
name: {{ $sa }}
namespace: {{ $namespace }}
{{- end }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: argo-events-role
rules:
{{- with .Values.additionalServiceAccountRules }}
{{- toYaml . | nindent 2 }}
{{- end }}
- apiGroups:
- ""
resources:
- "events"
verbs:
- "create"
- "patch"
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- argoproj.io
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
- apiGroups:
- ""
resources:
- pods
- pods/exec
- configmaps
- secrets
- services
- persistentvolumeclaims
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
- apiGroups:
- "apps"
resources:
- deployments
- statefulsets
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
{{- end }}

View file

@ -0,0 +1,41 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "argo-events.controller.fullname" . }}
labels:
{{- include "argo-events.labels" (dict "context" . "name" .Values.controller.name) | nindent 4 }}
data:
controller-config.yaml: |
eventBus:
{{- if .Values.configs.nats.versions }}
nats:
{{- range .Values.configs.nats.versions }}
versions:
- version: {{ .version }}
natsStreamingImage: {{ .natsStreamingImage }}
metricsExporterImage: {{ .metricsExporterImage }}
{{- end }}
{{- end }}
{{- if .Values.configs.jetstream.versions }}
jetstream:
# Default JetStream settings, could be overridden by EventBus JetStream specs
settings: |
# https://docs.nats.io/running-a-nats-service/configuration#jetstream
# Only configure "max_memory_store" or "max_file_store", do not set "store_dir" as it has been hardcoded.
max_memory_store: {{ .Values.configs.jetstream.settings.maxMemoryStore | default -1 }}
max_file_store: {{ .Values.configs.jetstream.settings.maxFileStore | default -1 }}
streamConfig: |
maxMsgs: {{ .Values.configs.jetstream.streamConfig.maxMsgs }}
maxAge: {{ .Values.configs.jetstream.streamConfig.maxAge }}
maxBytes: {{ .Values.configs.jetstream.streamConfig.maxBytes }}
replicas: {{ .Values.configs.jetstream.streamConfig.replicas }}
duplicates: {{ .Values.configs.jetstream.streamConfig.duplicates }}
{{- range .Values.configs.jetstream.versions }}
versions:
- version: {{ .version }}
natsImage: {{ .natsImage }}
metricsExporterImage: {{ .metricsExporterImage }}
configReloaderImage: {{ .configReloaderImage }}
startCommand: {{ .startCommand }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,137 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "argo-events.controller.fullname" . }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
app.kubernetes.io/version: {{ default (include "argo-events.defaultTag" .) .Values.controller.image.tag | quote }}
spec:
selector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
revisionHistoryLimit: 5
replicas: {{ .Values.controller.replicas }}
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/argo-events-controller/config.yaml") . | sha256sum }}
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.controller.podAnnotations) }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 8 }}
app.kubernetes.io/version: {{ default (include "argo-events.defaultTag" .) .Values.controller.image.tag | quote }}
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.controller.podLabels) }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.controller.name }}
image: {{ default .Values.global.image.repository .Values.controller.image.repository }}:{{ default (include "argo-events.defaultTag" .) .Values.controller.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.controller.image.imagePullPolicy }}
args:
- controller
{{- if .Values.controller.rbac.namespaced }}
- --namespaced
{{- end }}
{{- with .Values.controller.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
env:
- name: ARGO_EVENTS_IMAGE
value: {{ default .Values.global.image.repository .Values.controller.image.repository }}:{{ default (include "argo-events.defaultTag" .) .Values.controller.image.tag }}
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- with .Values.controller.env }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.envFrom }}
envFrom:
{{- toYaml | nindent 8 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /etc/argo-events
{{- with .Values.controller.volumeMounts }}
{{- toYaml . | nindent 8 }}
{{- end }}
ports:
- name: metrics
containerPort: 7777
protocol: TCP
- name: probe
containerPort: 8081
protocol: TCP
livenessProbe:
httpGet:
port: probe
path: /healthz
initialDelaySeconds: {{ .Values.controller.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.controller.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.controller.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.controller.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.controller.livenessProbe.failureThreshold }}
readinessProbe:
httpGet:
port: probe
path: /readyz
initialDelaySeconds: {{ .Values.controller.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.controller.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.controller.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.controller.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.controller.readinessProbe.failureThreshold }}
{{- with .Values.controller.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.controller.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end -}}
{{- with .Values.controller.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.topologySpreadConstraints }}
topologySpreadConstraints:
{{- range $constraint := . }}
- {{ toYaml $constraint | nindent 8 | trim }}
{{- if not $constraint.labelSelector }}
labelSelector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" $ "name" $.Values.controller.name) | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "argo-events.controller.serviceAccountName" . }}
{{- with .Values.global.hostAliases }}
hostAliases:
{{- toYaml . | nindent 6 }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ include "argo-events.controller.fullname" . }}
{{- with .Values.controller.volumes }}
{{- toYaml . | nindent 6 }}
{{- end }}

View file

@ -0,0 +1,28 @@
{{- if .Values.controller.pdb.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-events.controller.fullname" . }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.controller.pdb.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.controller.pdb.minAvailable }}
minAvailable: {{ .Values.controller.pdb.minAvailable }}
{{- else if .Values.controller.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.controller.pdb.maxUnavailable }}
{{- else }}
minAvailable: 0
{{- end }}
selector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 6 }}
{{- end }}

View file

@ -0,0 +1,113 @@
{{- if .Values.controller.rbac.enabled }}
apiVersion: rbac.authorization.k8s.io/v1
kind: {{ .Values.controller.rbac.namespaced | ternary "Role" "ClusterRole" }}
metadata:
name: {{ include "argo-events.controller.fullname" . }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
rules:
{{- if .Values.openshift }}
- apiGroups:
- apps
resources:
- deployments/finalizers
verbs:
- update
{{- if not .Values.controller.rbac.namespaced }}
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles/finalizers
verbs:
- update
{{- end }}
{{- end }}
{{- with .Values.controller.rbac.rules }}
{{- toYaml . | nindent 0 }}
{{- end }}
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- argoproj.io
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
- pods/exec
- configmaps
- secrets
- services
- persistentvolumeclaims
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
- apiGroups:
- apps
resources:
- deployments
- statefulsets
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
---
apiVersion: rbac.authorization.k8s.io/v1
kind: {{ .Values.controller.rbac.namespaced | ternary "RoleBinding" "ClusterRoleBinding" }}
metadata:
name: {{ include "argo-events.controller.fullname" . }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: {{ .Values.controller.rbac.namespaced | ternary "Role" "ClusterRole" }}
name: {{ include "argo-events.controller.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "argo-events.controller.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View file

@ -0,0 +1,25 @@
{{- if .Values.controller.metrics.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "argo-events.controller.fullname" . }}-metrics
{{- with .Values.controller.metrics.service.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" (printf "%s-metrics" .Values.controller.name)) | nindent 4 }}
{{- with .Values.controller.metrics.service.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
ports:
- name: metrics
protocol: TCP
port: {{ .Values.controller.metrics.service.servicePort }}
targetPort: metrics
selector:
{{- include "argo-events.selectorLabels" (dict "context" . "name" .Values.controller.name) | nindent 4 }}
{{- end }}

View file

@ -0,0 +1,15 @@
{{- if .Values.controller.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.controller.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "argo-events.controller.serviceAccountName" . }}
{{- with .Values.controller.serviceAccount.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- end }}

View file

@ -0,0 +1,38 @@
{{- if and .Values.controller.metrics.enabled .Values.controller.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "argo-events.controller.fullname" . }}
{{- with .Values.controller.metrics.serviceMonitor.namespace }}
namespace: {{ . }}
{{- end }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.controller.name "name" .Values.controller.name) | nindent 4 }}
{{- with .Values.controller.metrics.serviceMonitor.selector }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.controller.metrics.serviceMonitor.additionalLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
endpoints:
- port: metrics
{{- with .Values.controller.metrics.serviceMonitor.interval }}
interval: {{ . }}
{{- end }}
path: /metrics
{{- with .Values.controller.metrics.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.metrics.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" . "component" .Values.controller.name "name" "metrics") | nindent 6 }}
{{- end }}

View file

@ -1,103 +0,0 @@
{{- if .Values.singleNamespace }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: argo-events-binding
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: argo-events-role
subjects:
- kind: ServiceAccount
name: {{ .Values.serviceAccount }}
namespace: {{ .Release.Namespace }}
{{- if .Values.additionalSaNamespaces }}
{{ $sa := .Values.serviceAccount }}
{{- range $namespace := .Values.additionalSaNamespaces }}
- kind: ServiceAccount
name: {{ $sa }}
namespace: {{ $namespace }}
{{- end }}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: argo-events-role
namespace: {{ .Release.Namespace }}
rules:
{{- with .Values.additionalServiceAccountRules }}
{{- toYaml . | nindent 2 }}
{{- end }}
- apiGroups:
- ""
resources:
- "events"
verbs:
- "create"
- "patch"
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- argoproj.io
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
resources:
- sensors
- sensors/finalizers
- sensors/status
- eventsources
- eventsources/finalizers
- eventsources/status
- eventbus
- eventbus/finalizers
- eventbus/status
- apiGroups:
- ""
resources:
- pods
- pods/exec
- configmaps
- secrets
- services
- persistentvolumeclaims
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
- apiGroups:
- "apps"
resources:
- deployments
- statefulsets
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
{{- end }}

View file

@ -1,25 +0,0 @@
# All argo-events services are bound to the "argo-events" service account.
# In RBAC enabled setups, this SA is bound to specific roles.
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.serviceAccount }}
namespace: {{ .Release.Namespace }}
{{- with .Values.serviceAccountAnnotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
{{- if .Values.additionalSaNamespaces }}
{{ $annotations := .Values.serviceAccountAnnotations }}
{{ $sa := .Values.serviceAccount }}
{{- range $namespace := .Values.additionalSaNamespaces }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $sa }}
namespace: {{ $namespace }}
{{- with $annotations }}
annotations: {{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,79 @@
{{- if and .Values.webhook.enabled (not .Values.controller.rbac.namespaced) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: argo-events-webhook
labels:
{{- include "argo-events.labels" (dict "context" . "name" .Values.webhook.name) | nindent 4 }}
rules:
{{- if .Values.openshift }}
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles/finalizers
verbs:
- update
- apiGroups:
- apps
resources:
- deployments/finalizers
verbs:
- update
{{- end }}
- apiGroups:
- ""
resources:
- secrets
verbs:
- get
- list
- create
- update
- delete
- patch
- watch
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingwebhookconfigurations
verbs:
- get
- list
- create
- update
- delete
- patch
- watch
- apiGroups:
- argoproj.io
resources:
- eventbus
- eventsources
- sensors
verbs:
- get
- list
- watch
- apiGroups:
- rbac.authorization.k8s.io
resources:
- clusterroles
verbs:
- get
- list
{{- end }}

View file

@ -0,0 +1,16 @@
{{- if and .Values.webhook.enabled (not .Values.controller.rbac.namespaced) }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "argo-events.webhook.fullname" . }}
labels:
{{- include "argo-events.labels" (dict "context" . "name" .Values.webhook.name) | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: argo-events-webhook
subjects:
- kind: ServiceAccount
name: {{ include "argo-events.webhook.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}

View file

@ -0,0 +1,120 @@
{{- if and .Values.webhook.enabled (not .Values.controller.rbac.namespaced) }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: events-webhook
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 4 }}
app.kubernetes.io/version: {{ default (include "argo-events.defaultTag" .) .Values.webhook.image.tag | quote }}
spec:
selector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" . "name" .Values.webhook.name) | nindent 6 }}
revisionHistoryLimit: 5
replicas: {{ .Values.webhook.replicas }}
template:
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.podAnnotations) .Values.webhook.podAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 8 }}
app.kubernetes.io/version: {{ default (include "argo-events.defaultTag" .) .Values.webhook.image.tag | quote }}
{{- with (mergeOverwrite (deepCopy .Values.global.podLabels) .Values.webhook.podLabels) }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.global.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.global.securityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: {{ .Values.webhook.name }}
image: {{ default .Values.global.image.repository .Values.webhook.image.repository }}:{{ default (include "argo-events.defaultTag" .) .Values.controller.image.tag }}
imagePullPolicy: {{ default .Values.global.image.imagePullPolicy .Values.webhook.image.imagePullPolicy }}
args:
- webhook-service
{{- with .Values.webhook.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- with .Values.webhook.env }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.webhook.envFrom }}
envFrom:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.webhook.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 8 }}
{{- end }}
ports:
- name: webhook
containerPort: 443
protocol: TCP
livenessProbe:
tcpSocket:
port: webhook
initialDelaySeconds: {{ .Values.webhook.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.webhook.livenessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.webhook.livenessProbe.timeoutSeconds }}
successThreshold: {{ .Values.webhook.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.webhook.livenessProbe.failureThreshold }}
readinessProbe:
tcpSocket:
port: webhook
initialDelaySeconds: {{ .Values.webhook.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.webhook.readinessProbe.periodSeconds }}
timeoutSeconds: {{ .Values.webhook.readinessProbe.timeoutSeconds }}
successThreshold: {{ .Values.webhook.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.webhook.readinessProbe.failureThreshold }}
{{- with .Values.webhook.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- with .Values.webhook.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.webhook.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.webhook.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.webhook.topologySpreadConstraints }}
topologySpreadConstraints:
{{- range $constraint := . }}
- {{ toYaml $constraint | nindent 8 | trim }}
{{- if not $constraint.labelSelector }}
labelSelector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" $ "name" $.Values.webhook.name) | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "argo-events.webhook.serviceAccountName" . }}
{{- with .Values.global.hostAliases }}
hostAliases:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.webhook.volumes }}
volumes:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}

View file

@ -0,0 +1,28 @@
{{- if and .Values.webhook.enabled .Values.webhook.pdb.enabled (not .Values.controller.rbac.namespaced) }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "argo-events.webhook.fullname" . }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 4 }}
{{- with .Values.webhook.pdb.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.webhook.pdb.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
{{- if .Values.webhook.pdb.minAvailable }}
minAvailable: {{ .Values.webhook.pdb.minAvailable }}
{{- else if .Values.webhook.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.webhook.pdb.maxUnavailable }}
{{- else }}
minAvailable: 0
{{- end }}
selector:
matchLabels:
{{- include "argo-events.selectorLabels" (dict "context" . "name" .Values.webhook.name) | nindent 6 }}
{{- end }}

View file

@ -0,0 +1,14 @@
{{- if and .Values.webhook.enabled (not .Values.controller.rbac.namespaced) }}
apiVersion: v1
kind: Service
metadata:
name: events-webhook
labels:
{{- include "argo-events.labels" (dict "context" . "name" .Values.webhook.name) | nindent 4 }}
spec:
ports:
- port: 443
targetPort: webhook
selector:
{{- include "argo-events.selectorLabels" (dict "context" $ "name" $.Values.webhook.name) | nindent 4 }}
{{- end }}

View file

@ -0,0 +1,15 @@
{{- if and .Values.webhook.serviceAccount.create (not .Values.controller.rbac.namespaced) }}
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: {{ .Values.webhook.serviceAccount.automountServiceAccountToken }}
metadata:
name: {{ include "argo-events.webhook.serviceAccountName" . }}
{{- with .Values.webhook.serviceAccount.annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-events.labels" (dict "context" . "component" .Values.webhook.name "name" .Values.webhook.name) | nindent 4 }}
{{- end }}

View file

@ -0,0 +1,48 @@
{{- if .Values.crds.install }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: eventbus.argoproj.io
annotations:
{{- if .Values.crds.keep }}
"helm.sh/resource-policy": keep
{{- end }}
{{- with .Values.crds.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
group: argoproj.io
names:
kind: EventBus
listKind: EventBusList
plural: eventbus
shortNames:
- eb
singular: eventbus
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- metadata
- spec
type: object
served: true
storage: true
subresources:
status: {}
{{- end }}

View file

@ -0,0 +1,48 @@
{{- if .Values.crds.install }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: eventsources.argoproj.io
annotations:
{{- if .Values.crds.keep }}
"helm.sh/resource-policy": keep
{{- end }}
{{- with .Values.crds.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
group: argoproj.io
names:
kind: EventSource
listKind: EventSourceList
plural: eventsources
shortNames:
- es
singular: eventsource
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- metadata
- spec
type: object
served: true
storage: true
subresources:
status: {}
{{- end }}

View file

@ -0,0 +1,48 @@
{{- if .Values.crds.install }}
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: sensors.argoproj.io
annotations:
{{- if .Values.crds.keep }}
"helm.sh/resource-policy": keep
{{- end }}
{{- with .Values.crds.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
group: argoproj.io
names:
kind: Sensor
listKind: SensorList
plural: sensors
shortNames:
- sn
singular: sensor
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
type: object
x-kubernetes-preserve-unknown-fields: true
status:
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- metadata
- spec
type: object
served: true
storage: true
subresources:
status: {}
{{- end }}

View file

@ -1,85 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Values.eventbusController.name }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Release.Name }}-{{ .Values.eventbusController.name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.eventbusController.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Values.eventbusController.name }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Values.eventbusController.name }}
release: {{ .Release.Name }}
{{- with .Values.eventbusController.podLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.eventbusController.podAnnotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.serviceAccount }}
containers:
- name: {{ .Values.eventbusController.name }}
image: "{{ .Values.registry }}/{{ .Values.eventbusController.image }}:{{ .Values.eventbusController.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- eventbus-controller
{{- if .Values.singleNamespace }}
- --namespaced
{{- end }}
env:
{{- with .Values.eventbusController.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: NATS_STREAMING_IMAGE
value: {{ .Values.eventbusController.natsStreamingImage }}
- name: NATS_METRICS_EXPORTER_IMAGE
value: {{ .Values.eventbusController.natsMetricsExporterImage }}
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 3
periodSeconds: 3
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 3
periodSeconds: 3
resources: {{- toYaml .Values.eventbusController.resources | nindent 12 }}
{{- with .Values.eventbusController.containerSecurityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.eventbusController.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
{{- with .Values.securityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.eventbusController.nodeSelector }}
nodeSelector: {{ toYaml .Values.eventbusController.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.eventbusController.tolerations }}
tolerations: {{ toYaml .Values.eventbusController.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.eventbusController.affinity }}
affinity: {{ toYaml .Values.eventbusController.affinity | nindent 8 }}
{{- end }}

View file

@ -1,83 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Values.eventsourceController.name }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Release.Name }}-{{ .Values.eventsourceController.name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.eventsourceController.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Values.eventsourceController.name }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Values.eventsourceController.name }}
release: {{ .Release.Name }}
{{- with .Values.eventsourceController.podLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.eventsourceController.podAnnotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.serviceAccount }}
containers:
- name: {{ .Values.eventsourceController.name }}
image: "{{ .Values.registry }}/{{ .Values.eventsourceController.image }}:{{ .Values.eventsourceController.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- eventsource-controller
{{- if .Values.singleNamespace }}
- --namespaced
{{- end }}
env:
{{- with .Values.eventsourceController.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: EVENTSOURCE_IMAGE
value: "{{ .Values.registry }}/{{ .Values.eventsourceController.eventsourceImage }}:{{ .Values.eventsourceController.tag | default .Chart.AppVersion }}"
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 3
periodSeconds: 3
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 3
periodSeconds: 3
resources: {{- toYaml .Values.eventsourceController.resources | nindent 12 }}
{{- with .Values.eventsourceController.containerSecurityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.eventsourceController.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
{{- with .Values.securityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.eventsourceController.nodeSelector }}
nodeSelector: {{ toYaml .Values.eventsourceController.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.eventsourceController.tolerations }}
tolerations: {{ toYaml .Values.eventsourceController.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.eventsourceController.affinity }}
affinity: {{ toYaml .Values.eventsourceController.affinity | nindent 8 }}
{{- end }}

View file

@ -1,83 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-{{ .Values.sensorController.name }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ .Release.Name }}-{{ .Values.sensorController.name }}
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.sensorController.replicaCount }}
selector:
matchLabels:
app: {{ .Release.Name }}-{{ .Values.sensorController.name }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}-{{ .Values.sensorController.name }}
release: {{ .Release.Name }}
{{- with .Values.sensorController.podLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
{{- with .Values.sensorController.podAnnotations }}
annotations: {{- toYaml . | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ .Values.serviceAccount }}
containers:
- name: {{ .Values.sensorController.name }}
image: "{{ .Values.registry }}/{{ .Values.sensorController.image }}:{{ .Values.sensorController.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.imagePullPolicy }}
args:
- sensor-controller
{{- if .Values.singleNamespace }}
- --namespaced
{{- end }}
env:
{{- with .Values.sensorController.extraEnv }}
{{- toYaml . | nindent 12 }}
{{- end }}
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: SENSOR_IMAGE
value: "{{ .Values.registry }}/{{ .Values.sensorController.sensorImage }}:{{ .Values.sensorController.tag | default .Chart.AppVersion }}"
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 3
periodSeconds: 3
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 3
periodSeconds: 3
resources: {{- toYaml .Values.sensorController.resources | nindent 12 }}
{{- with .Values.sensorController.containerSecurityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.sensorController.priorityClassName }}
priorityClassName: {{ . | quote }}
{{- end }}
{{- with .Values.securityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.sensorController.nodeSelector }}
nodeSelector: {{ toYaml .Values.sensorController.nodeSelector | nindent 8 }}
{{- end }}
{{- if .Values.sensorController.tolerations }}
tolerations: {{ toYaml .Values.sensorController.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.sensorController.affinity }}
affinity: {{ toYaml .Values.sensorController.affinity | nindent 8 }}
{{- end }}