Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update seldon-core-operator Helm to fix bugs #1983

Merged
merged 3 commits into from
Jun 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.managerCreateResources }}
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -45,3 +46,4 @@ rules:
- patch
- update
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.managerCreateResources }}
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -17,3 +18,4 @@ subjects:
name: seldon-manager
namespace: '{{ .Release.Namespace }}'
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -152,7 +150,7 @@ spec:
name: cert
readOnly: true
{{- end }}
serviceAccountName: seldon-manager
serviceAccountName: '{{ .Values.serviceAccount.name }}'
terminationGracePeriodSeconds: 10
{{- if not .Values.managerCreateResources }}
volumes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
Expand Down Expand Up @@ -35,3 +36,4 @@ rules:
- events
verbs:
- create
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- if .Values.rbac.create }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
Expand All @@ -16,3 +17,4 @@ subjects:
- kind: ServiceAccount
name: seldon-manager
namespace: '{{ .Release.Namespace }}'
{{- end }}
20 changes: 19 additions & 1 deletion operator/helm/split_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 = (
Expand Down Expand Up @@ -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":
Expand Down