From ed0d302642a02f00d179edde8e604a3e197b556f Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Fri, 17 Mar 2017 12:08:23 -0700 Subject: [PATCH 1/3] Set resource requests for hub and proxy pods --- helm-chart/templates/hub.yaml | 2 ++ helm-chart/templates/proxy.yaml | 2 ++ helm-chart/values.yaml | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/helm-chart/templates/hub.yaml b/helm-chart/templates/hub.yaml index f3d0e076..1e55d791 100644 --- a/helm-chart/templates/hub.yaml +++ b/helm-chart/templates/hub.yaml @@ -117,6 +117,8 @@ spec: - mountPath: /srv/jupyterhub name: hub-db-dir {{- end }} + resources: +{{ toYaml .Values.hub.resources | indent 12}} imagePullPolicy: IfNotPresent env: # Put this here directly so hub will restart when we diff --git a/helm-chart/templates/proxy.yaml b/helm-chart/templates/proxy.yaml index 7296589f..e9cf565d 100644 --- a/helm-chart/templates/proxy.yaml +++ b/helm-chart/templates/proxy.yaml @@ -55,6 +55,8 @@ spec: containers: - name: proxy-container image: {{ .Values.proxy.image.name }}:{{ .Values.proxy.image.tag }} + resources: +{{ toYaml .Values.proxy.resources | indent 12 }} env: - name: CONFIGPROXY_AUTH_TOKEN valueFrom: diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index 5b6f7c14..bc379da5 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -21,11 +21,19 @@ hub: image: name: yuvipanda/jupyterhub-kubernetes-hub tag: v0.2 + resources: + requests: + cpu: 0.5 + memory: 1Gi proxy: image: name: yuvipanda/jupyterhub-kubernetes-proxy tag: v0.1 + resources: + requests: + cpu: 1 + memory: 1Gi # Set this explicitly if you want to use a static allocated # IP as the public LoadBalancer IP. Requires support by From 8f01b886943b3faa0f638ebff294c46f82edbee0 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Fri, 17 Mar 2017 12:17:21 -0700 Subject: [PATCH 2/3] Allow setting extra arbitrary labels on hub and proxy pods --- helm-chart/templates/hub.yaml | 3 +++ helm-chart/templates/proxy.yaml | 3 +++ helm-chart/values.yaml | 2 ++ 3 files changed, 8 insertions(+) diff --git a/helm-chart/templates/hub.yaml b/helm-chart/templates/hub.yaml index 1e55d791..c2d28963 100644 --- a/helm-chart/templates/hub.yaml +++ b/helm-chart/templates/hub.yaml @@ -97,6 +97,9 @@ spec: metadata: labels: name: hub-pod + {{ if .Values.hub.labels -}} +{{ toYaml .Values.hub.labels | indent 9}} + {{- end }} spec: volumes: - name: config diff --git a/helm-chart/templates/proxy.yaml b/helm-chart/templates/proxy.yaml index e9cf565d..03bebfc8 100644 --- a/helm-chart/templates/proxy.yaml +++ b/helm-chart/templates/proxy.yaml @@ -51,6 +51,9 @@ spec: metadata: labels: name: proxy-pod + {{ if .Values.proxy.labels -}} +{{ toYaml .Values.proxy.labels | indent 9}} + {{- end }} spec: containers: - name: proxy-container diff --git a/helm-chart/values.yaml b/helm-chart/values.yaml index bc379da5..dc57615d 100644 --- a/helm-chart/values.yaml +++ b/helm-chart/values.yaml @@ -18,6 +18,7 @@ hub: db: type: sqlite-pvc url: null + labels: null image: name: yuvipanda/jupyterhub-kubernetes-hub tag: v0.2 @@ -34,6 +35,7 @@ proxy: requests: cpu: 1 memory: 1Gi + labels: null # Set this explicitly if you want to use a static allocated # IP as the public LoadBalancer IP. Requires support by From fd4edca99a650e9141bfee74d1c6be9f11a33029 Mon Sep 17 00:00:00 2001 From: yuvipanda Date: Fri, 17 Mar 2017 15:29:54 -0700 Subject: [PATCH 3/3] Don't use toYaml + indent Causes super hard to debug errors boo --- helm-chart/templates/hub.yaml | 5 ++++- helm-chart/templates/proxy.yaml | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/helm-chart/templates/hub.yaml b/helm-chart/templates/hub.yaml index c2d28963..cde414ee 100644 --- a/helm-chart/templates/hub.yaml +++ b/helm-chart/templates/hub.yaml @@ -98,7 +98,10 @@ spec: labels: name: hub-pod {{ if .Values.hub.labels -}} -{{ toYaml .Values.hub.labels | indent 9}} + # Because toYaml + indent is super flaky + {{ range $key, $value := .Values.proxy.labels -}} + {{ $key }}: {{ $value | quote }} + {{- end }} {{- end }} spec: volumes: diff --git a/helm-chart/templates/proxy.yaml b/helm-chart/templates/proxy.yaml index 03bebfc8..845a098e 100644 --- a/helm-chart/templates/proxy.yaml +++ b/helm-chart/templates/proxy.yaml @@ -52,7 +52,10 @@ spec: labels: name: proxy-pod {{ if .Values.proxy.labels -}} -{{ toYaml .Values.proxy.labels | indent 9}} + # Because toYaml + indent is super flaky + {{ range $key, $value := .Values.proxy.labels -}} + {{ $key }}: {{ $value | quote }} + {{- end }} {{- end }} spec: containers: