adding argo-events-chart (#9)
This commit is contained in:
parent
1fed7f37cf
commit
ab5f2edf9d
15 changed files with 256 additions and 0 deletions
37
charts/argo-events/templates/_helpers.tpl
Normal file
37
charts/argo-events/templates/_helpers.tpl
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
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).
|
||||
*/}}
|
||||
{{- define "fullname" -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "sensor-crd-json" }}
|
||||
{
|
||||
"apiVersion": "apiextensions.k8s.io/v1beta1",
|
||||
"kind": "CustomResourceDefinition",
|
||||
"metadata": {
|
||||
"name": "sensors.argoproj.io"
|
||||
},
|
||||
"spec": {
|
||||
"group": "argoproj.io",
|
||||
"names": {
|
||||
"kind": "Sensor",
|
||||
"listKind": "SensorList",
|
||||
"plural": "sensors",
|
||||
"singular": "sensor",
|
||||
},
|
||||
"scope": "Namespaced",
|
||||
"version": "v1alpha1"
|
||||
}
|
||||
}
|
||||
{{- end}}
|
||||
20
charts/argo-events/templates/_sensor-crd.tpl
Normal file
20
charts/argo-events/templates/_sensor-crd.tpl
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{{- define "sensor-crd-json" }}
|
||||
{
|
||||
"apiVersion": "apiextensions.k8s.io/v1beta1",
|
||||
"kind": "CustomResourceDefinition",
|
||||
"metadata": {
|
||||
"name": "sensors.argoproj.io"
|
||||
},
|
||||
"spec": {
|
||||
"group": "argoproj.io",
|
||||
"names": {
|
||||
"kind": "Sensor",
|
||||
"listKind": "SensorList",
|
||||
"plural": "sensors",
|
||||
"singular": "sensor",
|
||||
},
|
||||
"scope": "Namespaced",
|
||||
"version": "v1alpha1"
|
||||
}
|
||||
}
|
||||
{{- end}}
|
||||
18
charts/argo-events/templates/apply-sensor-crd-job.yaml
Normal file
18
charts/argo-events/templates/apply-sensor-crd-job.yaml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-apply-sensor-crd
|
||||
annotations:
|
||||
helm.sh/hook: pre-install
|
||||
helm.sh/hook-delete-policy: hook-succeeded
|
||||
spec:
|
||||
backoffLimit: 5
|
||||
activeDeadlineSeconds: 100
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kubectl-apply
|
||||
image: lachlanevenson/k8s-kubectl
|
||||
command: ["/bin/sh"]
|
||||
args: ["-c", 'echo ''{{- include "sensor-crd-json" .}}'' | kubectl apply -f -']
|
||||
restartPolicy: Never
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Release.name }}-{{ .Values.controller.name}}-cluster-role
|
||||
rules:
|
||||
- apiGroups: ["argoproj.io"]
|
||||
resources: ["sensors"]
|
||||
verbs: ["get", "list", "watch", "update", "patch"]
|
||||
# The following rules define what the triggers can do
|
||||
- apiGroups: ["argoproj.io"]
|
||||
resources: ["workflows"]
|
||||
verbs: ["create", "delete"]
|
||||
- apiGroups: [""]
|
||||
resources: ["configmaps", "secrets", "pods"]
|
||||
verbs: ["get", "watch", "list", "patch"]
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-{{ .Values.controller.name }}-configmap
|
||||
labels:
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
data:
|
||||
config: |
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- if .Values.useReleaseAsInstanceID }}
|
||||
instanceID: {{ .Release.Name }}
|
||||
{{- else }}
|
||||
instanceID: {{ .Values.instanceID }}
|
||||
{{- end }}
|
||||
12
charts/argo-events/templates/sensor-controller-crb.yaml
Normal file
12
charts/argo-events/templates/sensor-controller-crb.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ .Release.name }}-{{ .Values.controller.name}}-binding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Release.name }}-{{ .Values.controller.name}}-cluster-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.controller.serviceAccount }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
apiVersion: apps/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-{{ .Values.controller.name }}
|
||||
labels:
|
||||
app: {{ .Release.Name }}-{{ .Values.controller.name }}
|
||||
chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
|
||||
release: {{ .Release.Name }}
|
||||
heritage: {{ .Release.Service }}
|
||||
spec:
|
||||
replicas: {{ .Values.controller.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Release.Name }}-{{ .Values.controller.name }}
|
||||
release: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: {{ .Release.Name }}-{{ .Values.controller.name }}
|
||||
release: {{ .Release.Name }}
|
||||
spec:
|
||||
serviceAccountName: {{ .Values.controller.serviceAccount }}
|
||||
containers:
|
||||
- name: {{ .Values.controller.name }}
|
||||
image: "{{ .Values.registry }}/{{ .Values.controller.image }}:{{ .Values.controller.tag }}"
|
||||
imagePullPolicy: {{ .Values.imagePullPolicy }}
|
||||
env:
|
||||
- name: SENSOR_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: SENSOR_CONFIG_MAP
|
||||
value: {{ .Release.Name }}-{{ .Values.controller.name }}-configmap
|
||||
4
charts/argo-events/templates/sensor-controller-sa.yaml
Normal file
4
charts/argo-events/templates/sensor-controller-sa.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.controller.serviceAccount }}
|
||||
11
charts/argo-events/templates/signals-clusterrole.yaml
Normal file
11
charts/argo-events/templates/signals-clusterrole.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: {{ .Release.name }}-signals-cluster-role
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["pods"]
|
||||
verbs: ["watch", "list", "patch"]
|
||||
- apiGroups: {{ .Values.signals.listenRoles.apiGroups }}
|
||||
resources: {{ .Values.signals.listenRoles.resources }}
|
||||
verbs: ["get", "list", "watch"]
|
||||
12
charts/argo-events/templates/signals-crb.yaml
Normal file
12
charts/argo-events/templates/signals-crb.yaml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: {{ .Release.name }}-signals-binding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: {{ .Release.name }}-signals-cluster-role
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.signals.serviceAccount }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
4
charts/argo-events/templates/signals-sa.yaml
Normal file
4
charts/argo-events/templates/signals-sa.yaml
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.signals.serviceAccount }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue