Skip to content

Commit

Permalink
add executor binding
Browse files Browse the repository at this point in the history
  • Loading branch information
nolte committed Jan 24, 2024
1 parent e8df484 commit ceaabdd
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 3 deletions.
4 changes: 2 additions & 2 deletions charts/stable/argo-workflow-mixin/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: 1.16.0
description: A Helm chart for Kubernetes
description: Generate Argo Workflow Additional Manifest
name: argo-workflow-mixin
type: application
version: 0.8.3
version: 0.8.4
4 changes: 4 additions & 0 deletions charts/stable/argo-workflow-mixin/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,7 @@ Create the name of the Role to use
{{- define "argo-workflows-execution.roleK8SStateName" -}}
{{- printf "%s-%s" (default (include "argo-workflows-execution.fullname" .) .Values.role.vaultInjector.name) "state" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{- define "argo-workflows-execution.roleExecutorName" -}}
{{- printf "%s-%s" (default (include "argo-workflows-execution.fullname" .) .Values.role.executor.name) "executor" | trunc 63 | trimSuffix "-" }}
{{- end }}
23 changes: 23 additions & 0 deletions charts/stable/argo-workflow-mixin/templates/executor-binding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.roleBinding.executor.create }}
kind: {{ include "argo-workflows-execution.roleBindingKind" . }}
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ include "argo-workflows-execution.roleExecutorName" . }}
{{- if eq .Values.roleBinding.type "Role" }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "argo-workflows-execution.labels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ include "argo-workflows-execution.serviceAccountName" . }}
apiGroup: ""
roleRef:
{{- if eq .Values.role.type "ClusterRole" }}
kind: ClusterRole
{{- else }}
kind: Role
{{- end }}
name: {{ include "argo-workflows-execution.roleExecutorName" . }}
apiGroup: ""
{{- end }}
19 changes: 19 additions & 0 deletions charts/stable/argo-workflow-mixin/templates/executor-role.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.role.executor.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: {{ include "argo-workflows-execution.roleKind" . }}
metadata:
name: {{ include "argo-workflows-execution.roleExecutorName" . }}
{{- if eq .Values.role.type "Role" }}
namespace: {{ .Release.Namespace }}
{{- end }}
labels:
{{- include "argo-workflows-execution.labels" . | nindent 4 }}
rules:
- apiGroups:
- argoproj.io
resources:
- workflowtaskresults
verbs:
- create
- patch
{{- end }}
6 changes: 5 additions & 1 deletion charts/stable/argo-workflow-mixin/values-example.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ role:
vaultInjector:
create: true
name: argo-workflows-execution

executor:
create: true

roleBinding:
tfState:
create: true
type: Role
vaultInjector:
create: false
executor:
create: true

serviceAccount:
annotations: {}
Expand Down
6 changes: 6 additions & 0 deletions charts/stable/argo-workflow-mixin/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,19 @@ role:
vaultInjector:
create: false
name: argo-workflows-execution
executor:
create: false
name: argo-workflows-execution


roleBinding:
tfState:
create: false
type: Role
vaultInjector:
create: false
executor:
create: false

serviceAccount:
annotations: {}
Expand Down

0 comments on commit ceaabdd

Please sign in to comment.