Skip to content

Commit 459887a

Browse files
committed
support newrelic in helm chart
1 parent 1cb2790 commit 459887a

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

helm-chart/nbviewer/templates/deployment.yaml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ spec:
3232
- name: secret
3333
secret:
3434
secretName: {{ template "nbviewer.fullname" . }}
35+
items:
36+
- key: newrelic-ini
37+
path: newrelic.ini
3538
{{- if .Values.extraVolumes }}
3639
{{- .Values.extraVolumes | toYaml | trimSuffix "\n" | nindent 8 }}
3740
{{- end }}
@@ -46,7 +49,12 @@ spec:
4649
- name: nbviewer
4750
image: {{ .Values.image }}
4851
command:
52+
{{- if .Values.nbviewer.newrelicIni }}
53+
- newrelic-admin
54+
- run-python
55+
{{- else }}
4956
- python3
57+
{{- end }}
5058
- "-m"
5159
- nbviewer
5260
- --port=5000
@@ -55,8 +63,11 @@ spec:
5563
{{- end }}
5664

5765
volumeMounts:
58-
# - mountPath: /srv/nbviewer
59-
# name: files
66+
{{- if .Values.nbviewer.newrelicIni }}
67+
- mountPath: /etc/nbviewer/newrelic.ini
68+
name: secret
69+
subPath: newrelic.ini
70+
{{- end }}
6071

6172
# - mountPath: /etc/nbviewer/values.json
6273
# subPath: values.json
@@ -102,6 +113,8 @@ spec:
102113
{{- end }}
103114
- name: MEMCACHIER_SERVERS
104115
value: {{ .Release.Name }}-memcached:11211
116+
- name: NEW_RELIC_CONFIG_FILE
117+
value: /etc/nbviewer/newrelic.ini
105118
{{- if .Values.extraEnv }}
106119
{{- range $key, $value := .Values.extraEnv }}
107120
- name: {{ $key | quote }}

helm-chart/nbviewer/templates/secret.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ data:
1010
github-clientId: {{ .Values.github.clientId | b64enc | quote }}
1111
github-clientSecret: {{ .Values.github.clientSecret | b64enc | quote }}
1212
statuspage-apiKey: {{ .Values.statuspage.apiKey | b64enc | quote }}
13+
newrelic-ini: {{ .Values.nbviewer.newrelicIni | b64enc | quote }}

helm-chart/nbviewer/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ github:
4242
nbviewer:
4343
baseUrl: "/"
4444
extraArgs: []
45+
newrelicIni: ""
4546

4647
memcached:
4748
AntiAffinity: soft

0 commit comments

Comments
 (0)