{{- if .Values.statuspage.enabled -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "nbviewer.fullname" . }}-statuspage labels: component: statuspage {{- include "nbviewer.labels" . | nindent 4 }} spec: replicas: 1 selector: matchLabels: component: statuspage {{- include "nbviewer.matchLabels" . | nindent 6 }} template: metadata: labels: component: statuspage {{- include "nbviewer.matchLabels" . | nindent 8 }} annotations: # This lets us autorestart when the secret changes! checksum/secret: {{ include (print .Template.BasePath "/secret.yaml") . | sha256sum }} {{- if .Values.annotations }} {{- .Values.annotations | toYaml | trimSuffix "\n" | nindent 8 }} {{- end }} spec: nodeSelector: {{ toJson .Values.nodeSelector }} volumes: - name: secret secret: secretName: {{ template "nbviewer.fullname" . }} containers: - name: statuspage image: {{ .Values.statuspage.image }} resources: {{- .Values.statuspage.resources | toYaml | trimSuffix "\n" | nindent 12 }} {{- with .Values.imagePullPolicy }} imagePullPolicy: {{ . }} {{- end }} env: - name: PYTHONUNBUFFERED value: "1" {{- if .Values.github.clientId }} - name: GITHUB_OAUTH_KEY valueFrom: secretKeyRef: name: {{ template "nbviewer.fullname" . }} key: github-clientId {{- end }} {{- if .Values.github.clientSecret }} - name: GITHUB_OAUTH_SECRET valueFrom: secretKeyRef: name: {{ template "nbviewer.fullname" . }} key: github-clientSecret {{- end }} {{- if .Values.github.accessToken }} - name: GITHUB_API_TOKEN valueFrom: secretKeyRef: name: {{ template "nbviewer.fullname" . }} key: github-accessToken {{- end }} - name: STATUSPAGE_API_KEY valueFrom: secretKeyRef: name: {{ template "nbviewer.fullname" . }} key: statuspage-apiKey - name: STATUSPAGE_PAGE_ID value: {{ .Values.statuspage.pageId }} - name: STATUSPAGE_METRIC_ID value: {{ .Values.statuspage.metricId }} {{- end -}}