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

Helm upgrade error "... with the name ... not found" and how to handle it #620

Merged
merged 5 commits into from
Apr 2, 2018
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
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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding these indentation changes: there seem to be two standards: one where - is aligned with the parent element and another where - is indented like a dict. The latter seems more common and more readable (it's easier to see the levels this way), but this is converting to the former. Is there a reason to dedent this here (e.g. motivated by a helm linter)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#622 - The kubernetes/chart linting ignores the difference, allowing both. The repositories I've looked at have been mixing both. I've seen situations where both indentation variants have been the most readable. I'm happy to decide on any variant and go with it.

parent1:
- key1: value1
- key2: value2

parent2:
  - key1: value1
  - key2: value2

I've never seen really ugly examples of the first kind of indentation, but some due to the second kind of indentation. But that is often not an issue.

Example of nested situation causing a big challenge no matter what kind of indentation scheme used, but I figure it would be easier to use the former kind as the key-names would always start two spaces in.

networkPolicy:
enabled: false
egress:
- to:
- ipBlock:
cidr: 0.0.0.0/0

I'm setting up some linting in #624 - we can configure it to however we please, I'm looking a directive to follow!

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 }}