Skip to content

Commit

Permalink
Updates to allow for a namespace override of selon-core-operator install
Browse files Browse the repository at this point in the history
  • Loading branch information
ntorba605 committed Dec 10, 2020
1 parent 755ff32 commit 8f614ae
Show file tree
Hide file tree
Showing 26 changed files with 119 additions and 101 deletions.
11 changes: 11 additions & 0 deletions helm-charts/seldon-core-operator/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ Create chart name and version as used by the chart label.
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create chart namespace based on override value.
*/}}
{{- define "seldon.namespace" -}}
{{- if .Values.namespaceOverride -}}
{{- .Values.namespaceOverride -}}
{{- else -}}
{{- .Release.Namespace -}}
{{- end -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ metadata:
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-serving-cert
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
spec:
commonName: '{{- printf "seldon-webhook-service.%s.svc" .Release.Namespace -}}'
commonName: '{{- printf "seldon-webhook-service.%s.svc" (include "seldon.namespace" .) -}}'
dnsNames:
- '{{- printf "seldon-webhook-service.%s.svc.cluster.local" .Release.Namespace -}}'
- '{{- printf "seldon-webhook-service.%s.svc" .Release.Namespace -}}'
- '{{- printf "seldon-webhook-service.%s.svc.cluster.local" (include "seldon.namespace" .) -}}'
- '{{- printf "seldon-webhook-service.%s.svc" (include "seldon.namespace" .) -}}'
issuerRef:
kind: Issuer
name: seldon-selfsigned-issuer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-manager-role-{{ .Release.Namespace }}
name: seldon-manager-role-{{ include "seldon.namespace" . }}
rules:
- apiGroups:
- ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-manager-sas-role-{{ .Release.Namespace }}
name: seldon-manager-sas-role-{{ include "seldon.namespace" . }}
rules:
- apiGroups:
- ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: seldon-spartakus-volunteer-{{ .Release.Namespace }}
name: seldon-spartakus-volunteer-{{ include "seldon.namespace" . }}
rules:
- apiGroups:
- ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-webhook-role-{{ .Release.Namespace }}
name: seldon-webhook-role-{{ include "seldon.namespace" . }}
rules:
- apiGroups:
- admissionregistration.k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ metadata:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-manager-rolebinding-{{ .Release.Namespace }}
name: seldon-manager-rolebinding-{{ include "seldon.namespace" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: seldon-manager-role-{{ .Release.Namespace }}
name: seldon-manager-role-{{ include "seldon.namespace" . }}
subjects:
- kind: ServiceAccount
name: '{{ .Values.serviceAccount.name }}'
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ metadata:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-manager-sas-rolebinding-{{ .Release.Namespace }}
name: seldon-manager-sas-rolebinding-{{ include "seldon.namespace" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: seldon-manager-sas-role-{{ .Release.Namespace }}
name: seldon-manager-sas-role-{{ include "seldon.namespace" . }}
subjects:
- kind: ServiceAccount
name: seldon-manager
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: seldon-spartakus-volunteer-{{ .Release.Namespace }}
name: seldon-spartakus-volunteer-{{ include "seldon.namespace" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: seldon-spartakus-volunteer-{{ .Release.Namespace }}
name: seldon-spartakus-volunteer-{{ include "seldon.namespace" . }}
subjects:
- kind: ServiceAccount
name: seldon-spartakus-volunteer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ metadata:
app.kubernetes.io/instance: '{{ .Release.Name }}'
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-webhook-rolebinding-{{ .Release.Namespace }}
name: seldon-webhook-rolebinding-{{ include "seldon.namespace" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: seldon-webhook-role-{{ .Release.Namespace }}
name: seldon-webhook-role-{{ include "seldon.namespace" . }}
subjects:
- kind: ServiceAccount
name: seldon-manager
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ metadata:
app.kubernetes.io/version: '{{ .Chart.Version }}'
control-plane: seldon-controller-manager
name: seldon-config
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/seldon-serving-cert'
cert-manager.io/inject-ca-from: '{{ include "seldon.namespace" . }}/seldon-serving-cert'
controller-gen.kubebuilder.io/version: v0.2.9
creationTimestamp: null
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: '{{ .Release.Namespace }}/seldon-serving-cert'
cert-manager.io/inject-ca-from: '{{ include "seldon.namespace" . }}/seldon-serving-cert'
controller-gen.kubebuilder.io/version: v0.2.5
creationTimestamp: null
name: seldondeployments.machinelearning.seldon.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
app.kubernetes.io/version: '{{ .Chart.Version }}'
control-plane: seldon-controller-manager
name: seldon-controller-manager
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
spec:
replicas: 1
selector:
Expand All @@ -35,7 +35,7 @@ spec:
- --enable-leader-election
- --webhook-port={{ .Values.webhook.port }}
- --create-resources=$(MANAGER_CREATE_RESOURCES)
- '{{- if .Values.singleNamespace }}--namespace={{ .Release.Namespace }}{{- end }}'
- '{{- if .Values.singleNamespace }}--namespace={{ include "seldon.namespace" . }}{{- end }}'
command:
- /manager
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-selfsigned-issuer
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
spec:
selfSigned: {}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-leader-election-role
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
rules:
- apiGroups:
- ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ kind: Role
metadata:
creationTimestamp: null
name: seldon1-manager-role
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
rules:
- apiGroups:
- ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ kind: Role
metadata:
creationTimestamp: null
name: seldon1-manager-sas-role
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
rules:
- apiGroups:
- ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ metadata:
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-leader-election-rolebinding
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: seldon-leader-election-role
subjects:
- kind: ServiceAccount
name: seldon-manager
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: seldon1-manager-rolebinding
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: seldon1-manager-role
subjects:
- kind: ServiceAccount
name: '{{ .Values.serviceAccount.name }}'
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: seldon1-manager-sas-rolebinding
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: seldon1-manager-sas-role
subjects:
- kind: ServiceAccount
name: '{{ .Values.serviceAccount.name }}'
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: seldon-webhook-service
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
spec:
ports:
- port: 443
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ metadata:
app.kubernetes.io/name: '{{ include "seldon.name" . }}'
app.kubernetes.io/version: '{{ .Chart.Version }}'
name: '{{ .Values.serviceAccount.name }}'
namespace: '{{ .Release.Namespace }}'
namespace: '{{ include "seldon.namespace" . }}'
{{- end }}
Loading

0 comments on commit 8f614ae

Please sign in to comment.