diff --git a/helm-charts/seldon-core-operator/templates/clusterrole_seldon-webhook-role.yaml b/helm-charts/seldon-core-operator/templates/clusterrole_seldon-webhook-role.yaml index 6c1e92f8ec..37cc693e09 100644 --- a/helm-charts/seldon-core-operator/templates/clusterrole_seldon-webhook-role.yaml +++ b/helm-charts/seldon-core-operator/templates/clusterrole_seldon-webhook-role.yaml @@ -1,4 +1,5 @@ {{- if .Values.managerCreateResources }} +{{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -45,3 +46,4 @@ rules: - patch - update {{- end }} +{{- end }} diff --git a/helm-charts/seldon-core-operator/templates/clusterrolebinding_seldon-webhook-rolebinding.yaml b/helm-charts/seldon-core-operator/templates/clusterrolebinding_seldon-webhook-rolebinding.yaml index 61c2734bca..5600a21a63 100644 --- a/helm-charts/seldon-core-operator/templates/clusterrolebinding_seldon-webhook-rolebinding.yaml +++ b/helm-charts/seldon-core-operator/templates/clusterrolebinding_seldon-webhook-rolebinding.yaml @@ -1,4 +1,5 @@ {{- if .Values.managerCreateResources }} +{{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -17,3 +18,4 @@ subjects: name: seldon-manager namespace: '{{ .Release.Namespace }}' {{- end }} +{{- end }} diff --git a/helm-charts/seldon-core-operator/templates/deployment_seldon-controller-manager.yaml b/helm-charts/seldon-core-operator/templates/deployment_seldon-controller-manager.yaml index 77c435d033..3087d91a4b 100644 --- a/helm-charts/seldon-core-operator/templates/deployment_seldon-controller-manager.yaml +++ b/helm-charts/seldon-core-operator/templates/deployment_seldon-controller-manager.yaml @@ -115,8 +115,6 @@ spec: value: '{{ .Values.executor.image.pullPolicy }}' - name: EXECUTOR_PROMETHEUS_PATH value: '{{ .Values.executor.prometheus.path }}' - - name: EXECUTOR_SERVER_GRPC_PORT - value: '{{ .Values.engine.grpc.port }}' - name: EXECUTOR_SERVER_PORT value: '{{ .Values.executor.port }}' - name: EXECUTOR_CONTAINER_USER @@ -152,7 +150,7 @@ spec: name: cert readOnly: true {{- end }} - serviceAccountName: seldon-manager + serviceAccountName: '{{ .Values.serviceAccount.name }}' terminationGracePeriodSeconds: 10 {{- if not .Values.managerCreateResources }} volumes: diff --git a/helm-charts/seldon-core-operator/templates/role_seldon-leader-election-role.yaml b/helm-charts/seldon-core-operator/templates/role_seldon-leader-election-role.yaml index 8102fad986..a312c56542 100644 --- a/helm-charts/seldon-core-operator/templates/role_seldon-leader-election-role.yaml +++ b/helm-charts/seldon-core-operator/templates/role_seldon-leader-election-role.yaml @@ -1,3 +1,4 @@ +{{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: @@ -35,3 +36,4 @@ rules: - events verbs: - create +{{- end }} diff --git a/helm-charts/seldon-core-operator/templates/rolebinding_seldon-leader-election-rolebinding.yaml b/helm-charts/seldon-core-operator/templates/rolebinding_seldon-leader-election-rolebinding.yaml index 3b47b1f1d6..4f77fabb70 100644 --- a/helm-charts/seldon-core-operator/templates/rolebinding_seldon-leader-election-rolebinding.yaml +++ b/helm-charts/seldon-core-operator/templates/rolebinding_seldon-leader-election-rolebinding.yaml @@ -1,3 +1,4 @@ +{{- if .Values.rbac.create }} apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: @@ -16,3 +17,4 @@ subjects: - kind: ServiceAccount name: seldon-manager namespace: '{{ .Release.Namespace }}' +{{- end }} diff --git a/operator/helm/split_resources.py b/operator/helm/split_resources.py index a4cfea62bd..a3ff91a298 100644 --- a/operator/helm/split_resources.py +++ b/operator/helm/split_resources.py @@ -122,6 +122,9 @@ def helm_release(value: str): "image" ] = "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag }}" + # ServiceAccount + res["spec"]["template"]["spec"]["serviceAccountName"] = helm_value("serviceAccount.name") + # Resource requests res["spec"]["template"]["spec"]["containers"][0]["resources"][ "requests" @@ -279,7 +282,13 @@ def helm_release(value: str): if name.find("spartakus") > -1: fdata = HELM_SPARTAKUS_IF_START + fdata + HELM_IF_END elif name == "seldon-webhook-rolebinding" or name == "seldon-webhook-role": - fdata = HELM_CREATERESOURCES_RBAC_IF_START + fdata + HELM_IF_END + fdata = ( + HELM_CREATERESOURCES_RBAC_IF_START + + HELM_RBAC_IF_START + + fdata + + HELM_IF_END + + HELM_IF_END + ) # cluster roles for single namespace elif name == "seldon-manager-rolebinding" or name == "seldon-manager-role": fdata = ( @@ -338,6 +347,15 @@ def helm_release(value: str): + HELM_IF_END + HELM_IF_END ) + elif ( + name == "seldon-leader-election-rolebinding" + or name == "seldon-leader-election-role" + ): + fdata = ( + HELM_RBAC_IF_START + + fdata + + HELM_IF_END + ) elif name == "seldon-manager" and kind == "serviceaccount": fdata = HELM_SA_IF_START + fdata + HELM_IF_END elif kind == "issuer" or kind == "certificate":