deploy-templates/templates/viewer-server-deployment.yaml (136 lines of code) (raw):
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.redash.instance.name.viewer }}
labels:
helm.sh/chart: {{ .Values.redash.instance.name.viewer }}-2.3.0
app.kubernetes.io/name: {{ .Values.redash.instance.name.viewer }}
app.kubernetes.io/instance: {{ .Values.redash.instance.name.viewer }}
app.kubernetes.io/version: {{ .Values.redash.version | squote }}
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: server
spec:
replicas: {{ .Values.server.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: {{ .Values.redash.instance.name.viewer }}
app.kubernetes.io/instance: {{ .Values.redash.instance.name.viewer }}
app.kubernetes.io/component: server
template:
metadata:
labels:
app.kubernetes.io/name: {{ .Values.redash.instance.name.viewer }}
app.kubernetes.io/instance: {{ .Values.redash.instance.name.viewer }}
app.kubernetes.io/component: server
collect.logs: "plain-text"
{{- if .Values.server.podAnnotations }}
annotations:
{{ toYaml .Values.server.podAnnotations | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "redash.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Values.redash.instance.name.viewer }}-server
image: "{{ .Values.image.name }}:{{ .Values.image.version }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint server"]
lifecycle:
postStart:
exec:
command:
- "sh"
- "-c"
- bash officer_setup.sh > /dev/null 2>&1 &
volumeMounts:
- name: config
mountPath: /config
- name: officer-config
mountPath: /app/officer_setup.sh
subPath: officer_setup.sh
env:
- name: SYSTEM_ADMIN_PASS
valueFrom:
secretKeyRef:
name: {{ .Values.redash.system.admin.secret }}
key: password
- name: SYSTEM_ADMIN_EMAIL
valueFrom:
secretKeyRef:
name: {{ .Values.redash.system.admin.secret }}
key: email
- name: REDASH_ROUTE_PREFIX
value: 'reports'
- name: REDASH_DATABASE_HOSTNAME
value: {{ .Values.redash.instance.name.viewer }}-postgresql
- name: REDASH_RATELIMIT_ENABLED
value: 'false'
- name: REDASH_REDIS_HOSTNAME
value: {{ .Values.redash.instance.name.viewer }}-redis-master
{{- if .Values.redis.connectionParams }}
- name: REDASH_REDIS_CONN_PARAMS
value: {{ .Values.redis.connectionParams }}
{{- end }}
- name: REDASH_SAML_ENTITY_ID
value: {{ default .Values.redash.samlEntityId.viewer | quote }}
{{- include "redash.env.viewer" . | nindent 12 }}
{{- range $key, $value := .Values.server.env }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
- name: REDASH_SAML_METADATA_URL
value: "https://{{ .Values.keycloak.host }}/auth/realms/{{ .Release.Namespace }}-{{ .Values.redash.instance.keycloakRealms.viewer }}/protocol/saml/descriptor"
- name: REDASH_SAML_REDIRECT_URL
value: "https://{{ template "keycloak.host" . }}/auth/realms/{{ .Release.Namespace }}-{{ .Values.redash.instance.keycloakRealms.viewer }}/protocol/saml"
envFrom:
{{- include "redash.envFrom" . | nindent 12 }}
ports:
- containerPort: {{ .Values.server.httpPort }}
livenessProbe:
httpGet:
path: /reports/ping
port: {{ .Values.server.httpPort }}
# Redash can take a while to come up initially, so we delay checks.
initialDelaySeconds: 90
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 10
readinessProbe:
httpGet:
path: /reports/ping
port: {{ .Values.server.httpPort }}
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
{{- if not .Values.global.disableRequestsLimits }}
resources:
{{ toYaml .Values.server.resources | indent 12 }}
{{- end }}
volumes:
- name: officer-config
configMap:
name: viewer-setup-script-cm
defaultMode: 0755
- name: config
configMap:
name: {{ include "redash.fullname" . }}
{{- with .Values.server.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.server.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.server.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}