Skip to content

Commit 1cb2790

Browse files
committed
fix secrets, add statuspage
1 parent a4d7748 commit 1cb2790

File tree

5 files changed

+100
-11
lines changed

5 files changed

+100
-11
lines changed

helm-chart/minikube.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ nbviewer:
1313
- "--logging=debug"
1414

1515
memcached:
16-
replicas: 1
16+
replicaCount: 1
17+
pdbMinAvailable: 0

helm-chart/nbviewer/templates/deployment.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ kind: Deployment
33
metadata:
44
name: {{ template "nbviewer.fullname" . }}
55
labels:
6+
component: nbviewer
67
{{- include "nbviewer.labels" . | nindent 4 }}
78
spec:
89
replicas: {{ .Values.replicas }}
910
selector:
1011
matchLabels:
12+
component: nbviewer
1113
{{- include "nbviewer.matchLabels" . | nindent 6 }}
1214
{{- if .Values.deploymentStrategy }}
1315
strategy:
@@ -16,6 +18,7 @@ spec:
1618
template:
1719
metadata:
1820
labels:
21+
component: nbviewer
1922
{{- include "nbviewer.matchLabels" . | nindent 8 }}
2023
annotations:
2124
# This lets us autorestart when the secret changes!
@@ -28,7 +31,7 @@ spec:
2831
volumes:
2932
- name: secret
3033
secret:
31-
secretName: {{ template "nbviewer.fullname" . }}-secret
34+
secretName: {{ template "nbviewer.fullname" . }}
3235
{{- if .Values.extraVolumes }}
3336
{{- .Values.extraVolumes | toYaml | trimSuffix "\n" | nindent 8 }}
3437
{{- end }}
@@ -81,21 +84,21 @@ spec:
8184
valueFrom:
8285
secretKeyRef:
8386
name: {{ template "nbviewer.fullname" . }}
84-
key: github.clientId
87+
key: github-clientId
8588
{{- end }}
8689
{{- if .Values.github.clientSecret }}
8790
- name: GITHUB_OAUTH_SECRET
8891
valueFrom:
8992
secretKeyRef:
9093
name: {{ template "nbviewer.fullname" . }}
91-
key: github.client-secret
94+
key: github-clientSecret
9295
{{- end }}
9396
{{- if .Values.github.accessToken }}
9497
- name: GITHUB_API_TOKEN
9598
valueFrom:
9699
secretKeyRef:
97100
name: {{ template "nbviewer.fullname" . }}
98-
key: github.accessToken
101+
key: github-accessToken
99102
{{- end }}
100103
- name: MEMCACHIER_SERVERS
101104
value: {{ .Release.Name }}-memcached:11211
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
kind: Secret
22
apiVersion: v1
33
metadata:
4-
name: {{ template "nbviewer.fullname" . }}-secret
4+
name: {{ template "nbviewer.fullname" . }}
55
labels:
66
{{- include "nbviewer.labels" . | nindent 4 }}
77
type: Opaque
88
data:
9-
github-accessToken: {{ .Values.github.accessToken }}
10-
github-clientId: {{ .Values.github.clientId }}
11-
github-clientSecret: {{ .Values.github.clientSecret }}
9+
github-accessToken: {{ .Values.github.accessToken | b64enc | quote }}
10+
github-clientId: {{ .Values.github.clientId | b64enc | quote }}
11+
github-clientSecret: {{ .Values.github.clientSecret | b64enc | quote }}
12+
statuspage-apiKey: {{ .Values.statuspage.apiKey | b64enc | quote }}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{{- if .Values.statuspage.enabled -}}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ template "nbviewer.fullname" . }}-statuspage
6+
labels:
7+
component: statuspage
8+
{{- include "nbviewer.labels" . | nindent 4 }}
9+
spec:
10+
replicas: 1
11+
selector:
12+
matchLabels:
13+
component: statuspage
14+
{{- include "nbviewer.matchLabels" . | nindent 6 }}
15+
template:
16+
metadata:
17+
labels:
18+
component: statuspage
19+
{{- include "nbviewer.matchLabels" . | nindent 8 }}
20+
annotations:
21+
# This lets us autorestart when the secret changes!
22+
checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }}
23+
{{- if .Values.annotations }}
24+
{{- .Values.annotations | toYaml | trimSuffix "\n" | nindent 8 }}
25+
{{- end }}
26+
spec:
27+
nodeSelector: {{ toJson .Values.nodeSelector }}
28+
volumes:
29+
- name: secret
30+
secret:
31+
secretName: {{ template "nbviewer.fullname" . }}
32+
containers:
33+
- name: statuspage
34+
image: {{ .Values.statuspage.image }}
35+
36+
resources:
37+
{{- .Values.statuspage.resources | toYaml | trimSuffix "\n" | nindent 12 }}
38+
{{- with .Values.imagePullPolicy }}
39+
imagePullPolicy: {{ . }}
40+
{{- end }}
41+
env:
42+
- name: PYTHONUNBUFFERED
43+
value: "1"
44+
{{- if .Values.github.clientId }}
45+
- name: GITHUB_OAUTH_KEY
46+
valueFrom:
47+
secretKeyRef:
48+
name: {{ template "nbviewer.fullname" . }}
49+
key: github-clientId
50+
{{- end }}
51+
{{- if .Values.github.clientSecret }}
52+
- name: GITHUB_OAUTH_SECRET
53+
valueFrom:
54+
secretKeyRef:
55+
name: {{ template "nbviewer.fullname" . }}
56+
key: github-clientSecret
57+
{{- end }}
58+
{{- if .Values.github.accessToken }}
59+
- name: GITHUB_API_TOKEN
60+
valueFrom:
61+
secretKeyRef:
62+
name: {{ template "nbviewer.fullname" . }}
63+
key: github-accessToken
64+
{{- end }}
65+
- name: STATUSPAGE_API_KEY
66+
valueFrom:
67+
secretKeyRef:
68+
name: {{ template "nbviewer.fullname" . }}
69+
key: statuspage-apiKey
70+
- name: STATUSPAGE_PAGE_ID
71+
value: {{ .Values.statuspage.pageId }}
72+
- name: STATUSPAGE_METRIC_ID
73+
value: {{ .Values.statuspage.metricId }}
74+
75+
{{- end -}}

helm-chart/nbviewer/values.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ imagePullPolicy: null
44
service: {}
55
nodeSelector: null
66

7-
replicas: 2
7+
pdbMinAvailable: 2
88

99
pdb:
1010
minAvailable: 1
@@ -45,9 +45,18 @@ nbviewer:
4545

4646
memcached:
4747
AntiAffinity: soft
48-
replicas: 2
48+
replicaCount: 2
49+
pdbMinAvailable: 1
4950

5051
updateStrategy:
5152
rollingUpdate:
5253
maxSurge: 1
5354
maxUnavailable: 1
55+
56+
statuspage:
57+
enabled: false
58+
image: jupyter/statuspage
59+
resources: null
60+
apiKey: ""
61+
pageId: ""
62+
metricId: ""

0 commit comments

Comments
 (0)