Skip to content

Commit 146e129

Browse files
fix: Adjust for workflow service account and /srm
1 parent 68e655d commit 146e129

File tree

6 files changed

+48
-18
lines changed

6 files changed

+48
-18
lines changed

setup/core/charts/codedx-tool-orchestration/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: codedx-tool-orchestration
3-
version: 1.105.0
3+
version: 1.106.0
44
appVersion: "1.32.0"
55
description: A Helm chart for Code Dx Tool Orchestration
66
icon: https://codedx.com/wp-content/uploads/2017/03/CodeDx-logo.png

setup/core/charts/codedx-tool-orchestration/templates/_helpers.tpl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,21 @@ If release name contains chart name it will be used as a full name.
7878
{{- end -}}
7979
{{- end -}}
8080

81+
{{/*
82+
Create the name of the TO workflow service account to use
83+
*/}}
84+
{{- define "codedx-tool-orchestration.serviceAccountNameWorkflow" -}}
85+
{{- if .Values.serviceAccount.create }}
86+
{{- default (printf "%s-workflow" (include "codedx-tool-orchestration.fullname" .)) .Values.serviceAccount.workflowName }}
87+
{{- else }}
88+
{{- default "default" .Values.serviceAccount.workflowName }}
89+
{{- end }}
90+
{{- end }}
91+
92+
{{- define "codedx-tool-orchestration.workflow.rolebindingname" -}}
93+
{{- printf "%s-to-workflow-rolebinding" (include "codedx-tool-orchestration.fullname" .) }}
94+
{{- end -}}
95+
8196
{{- define "codedx-tool-orchestration.workflow.role.name" -}}
8297
{{- (printf "%s-%s" (include "codedx-tool-orchestration.name" .) "workflow-role") -}}
8398
{{- end -}}

setup/core/charts/codedx-tool-orchestration/templates/tool-service-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ spec:
7474
"-workDir", "/opt/codedx/service/work",
7575
"-workflowControllerInstanceName", "{{ .Release.Name }}",
7676
"-workflowPriorityClassName", {{ include "codedx-tool-orchestration.workflow.priorityClassName" . | quote }},
77-
"-workflowRoleNames", {{ include "codedx-tool-orchestration.workflow.role.name" . }}]
77+
"-workflowServiceAccount", {{ include "codedx-tool-orchestration.serviceAccountNameWorkflow" . | quote }}]
7878
readinessProbe:
7979
httpGet:
8080
port: 3333

setup/core/charts/codedx-tool-orchestration/templates/tool-service-rbac.yaml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{{- $saName := (include "codedx-tool-orchestration.serviceAccountName" .) | quote -}}
2+
{{- $saWorkflowName := (include "codedx-tool-orchestration.serviceAccountNameWorkflow" .) | quote -}}
23
{{- $rName := (printf "%s-%s" (include "codedx-tool-orchestration.fullname" .) "role") | quote -}}
4+
{{- $workflowRoleName := (include "codedx-tool-orchestration.workflow.role.name" .) | quote -}}
35
{{- $rbName := (printf "%s-%s" (include "codedx-tool-orchestration.fullname" .) "binding") | quote -}}
46

57
{{- if .Values.serviceAccount.create -}}
@@ -11,6 +13,14 @@ metadata:
1113
labels:
1214
{{- include "codedx-tool-orchestration.commonLabels" . | nindent 4 }}
1315
---
16+
apiVersion: v1
17+
kind: ServiceAccount
18+
metadata:
19+
name: {{ $saWorkflowName }}
20+
namespace: {{ .Release.Namespace | quote }}
21+
labels:
22+
{{- include "codedx-tool-orchestration.commonLabels" . | nindent 4 }}
23+
---
1424
{{ end -}}
1525

1626

@@ -31,25 +41,12 @@ rules:
3141
- apiGroups: [""]
3242
resources: ["pods"]
3343
verbs: ["get"]
34-
- apiGroups: [""]
35-
resources: ["serviceaccounts"]
36-
verbs: ["delete"]
3744
- apiGroups: ["argoproj.io"]
3845
resources: ["workflows"]
3946
verbs: ["get", "list", "create", "delete", "patch"]
40-
- apiGroups: [""]
41-
resources: ["serviceaccounts"]
42-
verbs: ["create"]
4347
- apiGroups: [""]
4448
resources: ["configmaps"]
4549
verbs: ["get"]
46-
- apiGroups: ["rbac.authorization.k8s.io"]
47-
resources: ["rolebindings"]
48-
verbs: ["create"]
49-
- apiGroups: ["rbac.authorization.k8s.io"]
50-
resources: ["roles"]
51-
verbs: ["bind"]
52-
resourceNames: [{{ include "codedx-tool-orchestration.workflow.role.name" . | quote }}]
5350
{{- if .Values.podSecurityPolicy.tws.bind }}
5451
- apiGroups: ["policy"]
5552
resources: ["podsecuritypolicies"]
@@ -63,7 +60,7 @@ rules:
6360
apiVersion: rbac.authorization.k8s.io/v1
6461
kind: Role
6562
metadata:
66-
name: {{ include "codedx-tool-orchestration.workflow.role.name" . | quote }}
63+
name: {{ $workflowRoleName }}
6764
namespace: {{ .Release.Namespace | quote }}
6865
rules:
6966
- apiGroups: [""]
@@ -82,6 +79,22 @@ rules:
8279
---
8380
apiVersion: rbac.authorization.k8s.io/v1
8481
kind: RoleBinding
82+
metadata:
83+
name: {{ (include "codedx-tool-orchestration.workflow.rolebindingname" .) | quote }}
84+
namespace: {{ .Release.Namespace | quote }}
85+
labels:
86+
{{- include "codedx-tool-orchestration.commonLabels" . | nindent 4 }}
87+
roleRef:
88+
apiGroup: rbac.authorization.k8s.io
89+
kind: Role
90+
name: {{ $workflowRoleName }}
91+
subjects:
92+
- name: {{ $saWorkflowName }}
93+
kind: ServiceAccount
94+
namespace: {{ .Release.Namespace | quote }}
95+
---
96+
apiVersion: rbac.authorization.k8s.io/v1
97+
kind: RoleBinding
8598
metadata:
8699
name: {{ $rbName }}
87100
namespace: {{ .Release.Namespace | quote }}

setup/core/charts/codedx-tool-orchestration/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,8 @@ serviceAccount:
170170
create: true
171171
# (optional)
172172
name:
173+
# (optional)
174+
workflowName:
173175

174176
podSecurityPolicy:
175177
tws:

setup/core/common/codedx.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<#PSScriptInfo
2-
.VERSION 2.12.0
2+
.VERSION 2.13.0
33
.GUID 6b1307f7-7098-4c65-9a86-8478840ad4cd
44
.AUTHOR Code Dx
55
#>
@@ -501,7 +501,7 @@ function New-ToolOrchestrationValuesFile([string] $codedxNamespace,
501501
$tlsConfig = $configureTls.ToString().ToLower()
502502

503503
$codeDxOrchestrationFullName = Get-CodeDxChartFullName $codedxReleaseName
504-
$codedxBaseUrl = '{0}://{1}.{2}.svc.cluster.local:{3}/codedx' -f $protocol,$codeDxOrchestrationFullName,$codedxNamespace,$codedxPort
504+
$codedxBaseUrl = '{0}://{1}.{2}.svc.cluster.local:{3}/srm' -f $protocol,$codeDxOrchestrationFullName,$codedxNamespace,$codedxPort
505505

506506
$imagePullSecretYaml = $imagePullSecretName -eq '' ? '[]' : "[ {name: '$imagePullSecretName'} ]"
507507
$minioImagePullSecretYaml = $imagePullSecretName -eq '' ? '[]' : "[ '$imagePullSecretName' ]"

0 commit comments

Comments
 (0)