Chart Grooming (#14)
* Chart Grooming - Changed the default `workflow-controller` installation to use the `ServiceAccount` that is created and bound. - Customized the instanceID logic: - No longer defaults to installed (this was very difficult to see/understand when coming from starter tutorials) - Kept logic to allow for release name or explicit mappings but changed structure a bit - Added in optional configuration for: - CRD Install hook's ServiceAccount to allow clean install if your default roles aren't privledged - Optional Pod and Service annotations - Controller logging level configuration - Minio Customizations - Changed the Secret configuration to properly represent the path of a secret instead of the actual contents - Changed the names of the secret and service that are represented to mirror that of the underlying chart * Adding in role bindings for minio secrets if installed
This commit is contained in:
parent
edb3e6b41a
commit
b6588e85b8
10 changed files with 143 additions and 41 deletions
|
@ -1,4 +1,4 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
description: A Helm chart for Kubernetes
|
description: A Helm chart for Kubernetes
|
||||||
name: argo
|
name: argo
|
||||||
version: 0.1.1
|
version: 0.2.0
|
||||||
|
|
|
@ -3,15 +3,26 @@ This chart is used to set up argo and it's needed dependencies through one comma
|
||||||
|
|
||||||
If you want your deployment of this helm chart to most closely match the [argo CLI](https://github.com/argoproj/argo), you should deploy it in the `kube-system` namespace.
|
If you want your deployment of this helm chart to most closely match the [argo CLI](https://github.com/argoproj/argo), you should deploy it in the `kube-system` namespace.
|
||||||
|
|
||||||
|
## Pre-Requisites
|
||||||
|
This chart uses an install hook to configure the CRD definition. Installation of CRDs is a somewhat privileged process in itself and in RBAC enabled clusters the `default` service account for namespaces does not typically have the ability to do create these.
|
||||||
|
|
||||||
|
A few options are:
|
||||||
|
- Setup the CRD yourself manually and use the `--no-hooks` options of `helm install`
|
||||||
|
- Manually create a ServiceAccount in the Namespace which your release will be deployed w/ appropriate bindings to perform this action and set the `init.serviceAccount` attribute
|
||||||
|
- Augment the `default` ServiceAccount permissions in the Namespace in which your Release is deployed to have the appropriate permissions
|
||||||
|
|
||||||
|
## Usage Notes:
|
||||||
|
This chart defaults to setting the `controller.instanceID.enabled` to `false` now, which means the deployed controller will act upon any workflow deployed to the cluster. If you would like to limit the behavior and deploy multiple workflow controllers, please use the `controller.instanceID.enabled` attribute along with one of it's configuration options to set the `instanceID` of the workflow controller to be properly scoped for your needs.
|
||||||
|
|
||||||
## Values
|
## Values
|
||||||
|
|
||||||
The `values.yaml` contains items used to tweak a deployment of this chart.
|
The `values.yaml` contains items used to tweak a deployment of this chart.
|
||||||
Fields to note:
|
Fields to note:
|
||||||
* `controller.useReleaseAsInstanceID`: If set to true then chart set controller instance id to release name
|
* `controller.instanceID.enabled`: If set to true, the Argo Controller will **ONLY** monitor Workflow submissions with a `--instanceid` attribute
|
||||||
- __Note:__ If this is set to false then `controller.instanceId` must be set
|
* `controller.instanceID.useReleaseName`: If set to true then chart set controller instance id to release name
|
||||||
|
* `controller.instanceID.explicitID`: Allows customization of an instance id for the workflow controller to monitor
|
||||||
* `controller.workflowNamespaces`: This is a list of namespaces where workflows will be ran
|
* `controller.workflowNamespaces`: This is a list of namespaces where workflows will be ran
|
||||||
* `ui.enableWebConsole`: Enables ability to SSH into pod using web UI
|
* `ui.enableWebConsole`: Enables ability to SSH into pod using web UI
|
||||||
* `minio.install`: If this is true, we'll install [minio](https://github.com/kubernetes/charts/tree/master/stable/minio) and build out the artifactRepository section in workflow controller config map.
|
* `minio.install`: If this is true, we'll install [minio](https://github.com/kubernetes/charts/tree/master/stable/minio) and build out the artifactRepository section in workflow controller config map.
|
||||||
* `artifactRepository.s3.accessKeySecret` and `artifactRepository.s3.secretKeySecret` These by default have the minio default credentials in them.
|
* `artifactRepository.s3.accessKeySecret` and `artifactRepository.s3.secretKeySecret` These by default link to minio default credentials stored in the secret deployed by the minio chart.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ spec:
|
||||||
activeDeadlineSeconds: 100
|
activeDeadlineSeconds: 100
|
||||||
template:
|
template:
|
||||||
spec:
|
spec:
|
||||||
|
serviceAccountName: {{ .Values.init.serviceAccount | quote }}
|
||||||
containers:
|
containers:
|
||||||
- name: kubectl-apply
|
- name: kubectl-apply
|
||||||
image: lachlanevenson/k8s-kubectl
|
image: lachlanevenson/k8s-kubectl
|
||||||
|
|
|
@ -13,10 +13,18 @@ spec:
|
||||||
labels:
|
labels:
|
||||||
app: {{ .Release.Name }}-{{ .Values.ui.name}}
|
app: {{ .Release.Name }}-{{ .Values.ui.name}}
|
||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
|
{{- if .Values.ui.podAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml .Values.ui.podAnnotations | indent 8}}{{- end }}
|
||||||
spec:
|
spec:
|
||||||
|
serviceAccountName: {{ .Values.ui.serviceAccount | quote }}
|
||||||
containers:
|
containers:
|
||||||
- name: ui
|
- name: ui
|
||||||
image: "{{ .Values.images.namespace }}/{{ .Values.images.ui }}:{{ .Values.images.tag }}"
|
image: "{{ .Values.images.namespace }}/{{ .Values.images.ui }}:{{ .Values.images.tag }}"
|
||||||
env:
|
env:
|
||||||
- name: IN_CLUSTER
|
- name: IN_CLUSTER
|
||||||
value: "true"
|
value: "true"
|
||||||
|
{{- if .Values.ui.enableWebConsole }}
|
||||||
|
- name: ENABLE_WEB_CONSOLE
|
||||||
|
value: "true"
|
||||||
|
{{- end }}
|
||||||
|
|
|
@ -7,6 +7,9 @@ metadata:
|
||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
heritage: {{ .Release.Service }}
|
heritage: {{ .Release.Service }}
|
||||||
namspace: {{ .Release.Namespace }}
|
namspace: {{ .Release.Namespace }}
|
||||||
|
{{- if .Values.ui.serviceAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml .Values.ui.serviceAnnotations | indent 4}}{{- end }}
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- port: 80
|
- port: 80
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
{{ if .Values.minio.install }}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.controller.name}}-minio-secret
|
||||||
|
rules:
|
||||||
|
- apiGroups:
|
||||||
|
- ""
|
||||||
|
resources:
|
||||||
|
- secrets
|
||||||
|
resourceNames:
|
||||||
|
- {{ .Values.artifactRepository.s3.accessKeySecret.name | default (printf "%s-%s" .Release.Name "minio") | quote }}
|
||||||
|
- {{ .Values.artifactRepository.s3.secretKeySecret.name | default (printf "%s-%s" .Release.Name "minio") | quote }}
|
||||||
|
verbs:
|
||||||
|
- get
|
||||||
|
- watch
|
||||||
|
- list
|
||||||
|
{{- end }}
|
|
@ -9,10 +9,12 @@ metadata:
|
||||||
namespace: {{ .Release.Namespace }}
|
namespace: {{ .Release.Namespace }}
|
||||||
data:
|
data:
|
||||||
config: |
|
config: |
|
||||||
{{- if .Values.controller.useReleaseAsInstanceID }}
|
{{- if .Values.controller.instanceID.enabled }}
|
||||||
|
{{- if .Values.controller.instanceID.useReleaseName }}
|
||||||
instanceID: {{ .Release.Name }}
|
instanceID: {{ .Release.Name }}
|
||||||
{{- else }}
|
{{- else }}
|
||||||
instanceID: {{ .Values.controller.instanceID }}
|
instanceID: {{ .Values.controller.instanceID.explicitID }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
artifactRepository:
|
artifactRepository:
|
||||||
{{- if or .Values.minio.install .Values.useDefaultArtifactRepo }}
|
{{- if or .Values.minio.install .Values.useDefaultArtifactRepo }}
|
||||||
|
@ -20,13 +22,13 @@ data:
|
||||||
{{- if .Values.useStaticCredentials }}
|
{{- if .Values.useStaticCredentials }}
|
||||||
accessKeySecret:
|
accessKeySecret:
|
||||||
key: {{ .Values.artifactRepository.s3.accessKeySecret.key }}
|
key: {{ .Values.artifactRepository.s3.accessKeySecret.key }}
|
||||||
name: {{ .Values.artifactRepository.s3.accessKeySecret.name | default (printf "%s-%s" .Release.Name "minio-user") }}
|
name: {{ .Values.artifactRepository.s3.accessKeySecret.name | default (printf "%s-%s" .Release.Name "minio") }}
|
||||||
secretKeySecret:
|
secretKeySecret:
|
||||||
key: {{ .Values.artifactRepository.s3.secretKeySecret.key }}
|
key: {{ .Values.artifactRepository.s3.secretKeySecret.key }}
|
||||||
name: {{ .Values.artifactRepository.s3.secretKeySecret.name | default (printf "%s-%s" .Release.Name "minio-user") }}
|
name: {{ .Values.artifactRepository.s3.secretKeySecret.name | default (printf "%s-%s" .Release.Name "minio") }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
bucket: {{ .Values.artifactRepository.s3.bucket | default .Values.minio.defaultBucket.name }}
|
bucket: {{ .Values.artifactRepository.s3.bucket | default .Values.minio.defaultBucket.name }}
|
||||||
endpoint: {{ .Values.artifactRepository.s3.endpoint | default (printf "%s-%s" .Release.Name "minio-svc:9000") }}
|
endpoint: {{ .Values.artifactRepository.s3.endpoint | default (printf "%s-%s" .Release.Name "minio:9000") }}
|
||||||
insecure: {{ .Values.artifactRepository.s3.insecure }}
|
insecure: {{ .Values.artifactRepository.s3.insecure }}
|
||||||
{{- end}}
|
{{- end}}
|
||||||
executorImage: "{{ .Values.images.namespace }}/{{ .Values.images.executor }}:{{ .Values.images.tag }}"
|
executorImage: "{{ .Values.images.namespace }}/{{ .Values.images.executor }}:{{ .Values.images.tag }}"
|
||||||
|
|
|
@ -14,12 +14,22 @@ spec:
|
||||||
labels:
|
labels:
|
||||||
app: {{ .Release.Name }}-{{ .Values.controller.name}}
|
app: {{ .Release.Name }}-{{ .Values.controller.name}}
|
||||||
release: {{ .Release.Name }}
|
release: {{ .Release.Name }}
|
||||||
|
{{- if .Values.controller.podAnnotations }}
|
||||||
|
annotations:
|
||||||
|
{{ toYaml .Values.controller.podAnnotations | indent 8}}{{- end }}
|
||||||
spec:
|
spec:
|
||||||
|
serviceAccountName: {{ .Values.controller.serviceAccount | quote }}
|
||||||
containers:
|
containers:
|
||||||
- name: controller
|
- name: controller
|
||||||
image: "{{ .Values.images.namespace }}/{{ .Values.images.controller }}:{{ .Values.images.tag }}"
|
image: "{{ .Values.images.namespace }}/{{ .Values.images.controller }}:{{ .Values.images.tag }}"
|
||||||
command: [ "workflow-controller" ]
|
command: [ "workflow-controller" ]
|
||||||
args: ["--configmap", "{{ .Release.Name }}-{{ .Values.controller.name}}-configmap"]
|
args:
|
||||||
|
- "--configmap"
|
||||||
|
- "{{ .Release.Name }}-{{ .Values.controller.name}}-configmap"
|
||||||
|
- "--loglevel"
|
||||||
|
- "{{ .Values.controller.logging.level }}"
|
||||||
|
- "--gloglevel"
|
||||||
|
- "{{ .Values.controller.logging.globallevel }}"
|
||||||
env:
|
env:
|
||||||
- name: ARGO_NAMESPACE
|
- name: ARGO_NAMESPACE
|
||||||
valueFrom:
|
valueFrom:
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
{{ if .Values.minio.install }}
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.controller.name}}-minio-binding
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: {{ .Release.Name }}-{{ .Values.controller.name}}-minio-secret
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ .Values.controller.serviceAccount }}
|
||||||
|
namespace: {{ .Release.Namespace }}
|
||||||
|
{{- if .Values.controller.workflowNamespaces }}
|
||||||
|
{{- $uiServiceAccount := .Values.controller.serviceAccount }}
|
||||||
|
{{- $namespace := .Release.Namespace }}
|
||||||
|
{{- range $key := .Values.controller.workflowNamespaces }}
|
||||||
|
{{- if not (eq $key $namespace) }}
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: {{ $uiServiceAccount }}
|
||||||
|
namespace: {{ $key }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
|
@ -5,40 +5,64 @@ images:
|
||||||
executor: argoexec
|
executor: argoexec
|
||||||
tag: v2.1.1
|
tag: v2.1.1
|
||||||
|
|
||||||
|
crdVersion: v1alpha1
|
||||||
|
|
||||||
|
init:
|
||||||
|
# By default the installation will not set an explicit one, which will mean it uses `default` for the namespace the chart is
|
||||||
|
# being deployed to. In RBAC clusters, that will almost certainly fail. See the NOTES: section of the readme for more info.
|
||||||
|
serviceAccount: ""
|
||||||
|
|
||||||
controller:
|
controller:
|
||||||
|
# podAnnotations is an optional map of annotations to be applied to the controller Pods
|
||||||
|
podAnnotations: {}
|
||||||
serviceAccount: argo
|
serviceAccount: argo
|
||||||
name: workflow-controller
|
name: workflow-controller
|
||||||
workflowNamespaces:
|
workflowNamespaces:
|
||||||
- default
|
- default
|
||||||
# If set to true then chart set controller instance id to release name
|
|
||||||
useReleaseAsInstanceID: true
|
|
||||||
instanceID:
|
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:
|
ui:
|
||||||
|
# optional map of annotations to be applied to the ui Pods
|
||||||
|
podAnnotations: {}
|
||||||
name: ui
|
name: ui
|
||||||
serviceType: LoadBalancer
|
|
||||||
serviceAccount: argo-ui
|
|
||||||
# Enables ability to SSH into pod using web UI
|
# Enables ability to SSH into pod using web UI
|
||||||
enableWebConsole: false
|
enableWebConsole: false
|
||||||
|
serviceType: LoadBalancer
|
||||||
|
serviceAccount: argo-ui
|
||||||
|
# Annotations to be applied to the UI Service
|
||||||
|
serviceAnnotations: {}
|
||||||
|
|
||||||
crdVersion: v1alpha1
|
# Influences the creation of the ConfigMap for the workflow-controller itself.
|
||||||
|
|
||||||
useDefaultArtifactRepo: false
|
useDefaultArtifactRepo: false
|
||||||
useStaticCredentials: true
|
useStaticCredentials: true
|
||||||
|
artifactRepository:
|
||||||
|
s3:
|
||||||
|
# Note the `key` attribute is not the actual secret, it's the PATH to
|
||||||
|
# the contents in the associated secret, as defined by the `name` attribute.
|
||||||
|
accessKeySecret:
|
||||||
|
# name: <releaseName>-minio (default)
|
||||||
|
key: accesskey
|
||||||
|
secretKeySecret:
|
||||||
|
# name: <releaseName>-minio
|
||||||
|
key: secretkey
|
||||||
|
insecure: true
|
||||||
|
# bucket:
|
||||||
|
# endpoint:
|
||||||
|
|
||||||
# If set to true then chart installs minio and generate according artifactRepository section in workflow controller config map
|
# NOTE: These are setting attributes for the `minio` optional dependency
|
||||||
minio:
|
minio:
|
||||||
# This is not used by the subchart, but makes sense to group here.
|
# If set to true then chart installs minio and generate according artifactRepository section in workflow controller config map
|
||||||
install: false
|
install: false
|
||||||
defaultBucket:
|
defaultBucket:
|
||||||
enabled: true
|
enabled: true
|
||||||
name: argo-artifacts
|
name: argo-artifacts
|
||||||
|
|
||||||
artifactRepository:
|
|
||||||
s3:
|
|
||||||
#default minio creds
|
|
||||||
accessKeySecret:
|
|
||||||
key: AKIAIOSFODNN7EXAMPLE
|
|
||||||
secretKeySecret:
|
|
||||||
key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
|
|
||||||
insecure: true
|
|
||||||
|
|
Loading…
Reference in a new issue