Skip to content

Commit

Permalink
Merge pull request #620 from consideRatio/rbac-sa-fix-pr
Browse files Browse the repository at this point in the history
Helm upgrade error "... with the name ... not found" and how to handle it
  • Loading branch information
minrk authored Apr 2, 2018
2 parents c826f93 + cd0958e commit 544e355
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 32 deletions.
10 changes: 5 additions & 5 deletions jupyterhub/templates/hub/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
{{ if .Values.rbac.enabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: hub
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
Expand All @@ -23,9 +28,4 @@ roleRef:
kind: Role
name: hub
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: hub
{{- end }}
8 changes: 4 additions & 4 deletions jupyterhub/templates/image-puller/_helper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ metadata:
spec:
selector:
matchLabels:
app: jupyterhub
component: {{ .name }}
release: {{ .top.Release.Name }}
heritage: {{ .top.Release.Service }}
app: jupyterhub
component: {{ .name }}
release: {{ .top.Release.Name }}
heritage: {{ .top.Release.Service }}
updateStrategy:
type: RollingUpdate
rollingUpdate:
Expand Down
12 changes: 7 additions & 5 deletions jupyterhub/templates/pod-culler/rbac.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{{ if and .Values.cull.enabled .Values.cull.maxAge }}
{{ if .Values.rbac.enabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-culler
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
Expand Down Expand Up @@ -26,9 +32,5 @@ roleRef:
kind: Role
name: pod-culler
apiGroup: rbac.authorization.k8s.io
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: pod-culler
{{- end }}
{{- end }}
36 changes: 18 additions & 18 deletions jupyterhub/templates/proxy/autohttps/rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
# This is way too many permissions, but apparently the nginx-controller
# is written to sortof assume it is clusterwide ingress provider.
# So we keep this as is, for now.
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: jupyterhub
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: autohttps
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -83,9 +93,9 @@ roleRef:
kind: ClusterRole
name: nginx-{{ .Release.Name }}
subjects:
- kind: ServiceAccount
name: autohttps
namespace: {{ .Release.Namespace }}
- kind: ServiceAccount
name: autohttps
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
Expand Down Expand Up @@ -181,9 +191,9 @@ roleRef:
kind: Role
name: nginx
subjects:
- kind: ServiceAccount
name: autohttps
namespace: {{ .Release.Namespace }}
- kind: ServiceAccount
name: autohttps
namespace: {{ .Release.Namespace }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
Expand All @@ -198,18 +208,8 @@ roleRef:
kind: Role
name: kube-lego
subjects:
- kind: ServiceAccount
name: autohttps
namespace: {{ .Release.Namespace }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: jupyterhub
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
- kind: ServiceAccount
name: autohttps
namespace: {{ .Release.Namespace }}
{{- end }}
{{ end }}

0 comments on commit 544e355

Please sign in to comment.