Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Changes required for redash v9 #36

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: redash
version: 2.0.0
appVersion: 8.0.2.b37747
version: 2.0.1
appVersion: 9.0.0-beta.b42121
description: Redash is an open source tool built for teams to query, visualize and collaborate.
keywords:
- redash
Expand Down
12 changes: 6 additions & 6 deletions requirements.lock
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: redis
repository: https://kubernetes-charts.storage.googleapis.com
version: 10.5.3
repository: https://charts.bitnami.com/bitnami
version: 10.7.17
- name: postgresql
repository: https://kubernetes-charts.storage.googleapis.com
version: 8.3.4
digest: sha256:f07804082637fe925a6d4c5e731f1b812173c8d24759ae2cb49c75cbe97db081
generated: "2020-02-18T17:42:36.142632429-08:00"
repository: https://charts.bitnami.com/bitnami
version: 8.10.14
digest: sha256:9361754af5681cbe5140b3ed2ed94e9608fd8d72af258ba61aa88e204f2ec606
generated: "2020-09-01T16:32:13.445102+10:00"
8 changes: 4 additions & 4 deletions requirements.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
dependencies:
- name: redis
version: "^10.5.3"
repository: "https://kubernetes-charts.storage.googleapis.com"
version: "^10.6.12"
repository: "https://charts.bitnami.com/bitnami"
condition: redis.enabled
- name: postgresql
version: "^8.3.4"
repository: "https://kubernetes-charts.storage.googleapis.com"
version: "^8.10.14"
repository: "https://charts.bitnami.com/bitnami"
condition: postgresql.enabled
20 changes: 19 additions & 1 deletion templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,20 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified scheduler name.
*/}}
{{- define "redash.scheduler.fullname" -}}
{{- template "redash.fullname" . -}}-scheduler
{{- end -}}

{{/*
Create a default fully qualified genericWorker name.
*/}}
{{- define "redash.genericWorker.fullname" -}}
{{- template "redash.fullname" . -}}-genericworker
{{- end -}}

{{/*
Create a default fully qualified adhocWorker name.
*/}}
Expand Down Expand Up @@ -373,6 +387,10 @@ Shared environment block used across each component.
- name: REDASH_SENTRY_DSN
value: {{ default .Values.redash.sentryDsn | quote }}
{{- end }}
{{- if .Values.redash.sentryEnvironment }}
- name: REDASH_SENTRY_ENVIRONMENT
value: {{ default .Values.redash.sentryEnvironment | quote }}
{{- end }}
{{- if .Values.redash.allowScriptsInUserInput }}
- name: REDASH_ALLOW_SCRIPTS_IN_USER_INPUT
value: {{ default .Values.redash.allowScriptsInUserInput | quote }}
Expand Down Expand Up @@ -508,4 +526,4 @@ Create the name of the service account to use
{{- end -}}

# This ensures a random value is provided for postgresqlPassword:
required "A secure random value for .postgresql.postgresqlPassword is required" .Values.postgresql.postgresqlPassword
required "A secure random value for .postgresql.postgresqlPassword is required" .Values.postgresql.postgresqlPassword
2 changes: 1 addition & 1 deletion templates/adhocworker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint scheduler"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint worker"]
volumeMounts:
- name: config
mountPath: /config
Expand Down
3 changes: 3 additions & 0 deletions templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ data:
# Max number of attempts
MAX_ATTEMPTS=10

# Patch the status command
sed -i '57s/.*/ #removed/' /app/redash/monitor.py

# Load connection variables
. /config/dynamicenv.sh
# Initialize attempt counter
Expand Down
65 changes: 65 additions & 0 deletions templates/genericworker-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "redash.genericWorker.fullname" . }}
labels:
{{- include "redash.labels" . | nindent 4 }}
app.kubernetes.io/component: genericworker
spec:
replicas: {{ .Values.genericWorker.replicaCount }}
selector:
matchLabels:
{{- include "redash.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: genericworker
template:
metadata:
labels:
{{- include "redash.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: genericworker
{{- if .Values.genericWorker.podAnnotations }}
annotations:
{{ toYaml .Values.genericWorker.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: {{ include "redash.name" . }}-genericworker
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint worker"]
volumeMounts:
- name: config
mountPath: /config
env:
{{- include "redash.env" . | nindent 12 }}
{{- range $key, $value := .Values.genericWorker.env }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
resources:
{{ toYaml .Values.genericWorker.resources | indent 12 }}
volumes:
- name: config
configMap:
name: {{ include "redash.fullname" . }}
{{- if .Values.genericWorker.nodeSelector }}
nodeSelector:
{{ toYaml .Values.genericWorker.nodeSelector | indent 8 }}
{{- end }}
{{- with .Values.genericWorker.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.genericWorker.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
24 changes: 12 additions & 12 deletions templates/hook-install-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ spec:
- name: config
configMap:
name: {{ include "redash.fullname" . }}
{{- with .Values.server.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 6 }}
{{- end }}
{{- with .Values.server.affinity }}
affinity:
{{ toYaml . | indent 6 }}
{{- end }}
{{- with .Values.server.tolerations }}
tolerations:
{{ toYaml . | indent 6 }}
{{- end }}
{{- 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 }}
24 changes: 12 additions & 12 deletions templates/hook-upgrade-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ spec:
- name: config
configMap:
name: {{ include "redash.fullname" . }}
{{- with .Values.server.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 6 }}
{{- end }}
{{- with .Values.server.affinity }}
affinity:
{{ toYaml . | indent 6 }}
{{- end }}
{{- with .Values.server.tolerations }}
tolerations:
{{ toYaml . | indent 6 }}
{{- end }}
{{- 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 }}
2 changes: 1 addition & 1 deletion templates/scheduledworker-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint scheduler"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint worker"]
volumeMounts:
- name: config
mountPath: /config
Expand Down
65 changes: 65 additions & 0 deletions templates/scheduler-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "redash.scheduler.fullname" . }}
labels:
{{- include "redash.labels" . | nindent 4 }}
app.kubernetes.io/component: scheduler
spec:
replicas: {{ .Values.scheduler.replicaCount }}
selector:
matchLabels:
{{- include "redash.selectorLabels" . | nindent 6 }}
app.kubernetes.io/component: scheduler
template:
metadata:
labels:
{{- include "redash.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: scheduler
{{- if .Values.scheduler.podAnnotations }}
annotations:
{{ toYaml .Values.scheduler.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: {{ include "redash.name" . }}-scheduler
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["/bin/sh"]
args: ["-c", ". /config/dynamicenv.sh && /app/bin/docker-entrypoint scheduler"]
volumeMounts:
- name: config
mountPath: /config
env:
{{- include "redash.env" . | nindent 12 }}
{{- range $key, $value := .Values.scheduler.env }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
resources:
{{ toYaml .Values.scheduler.resources | indent 12 }}
volumes:
- name: config
configMap:
name: {{ include "redash.fullname" . }}
{{- if .Values.scheduler.nodeSelector }}
nodeSelector:
{{ toYaml .Values.scheduler.nodeSelector | indent 8 }}
{{- end }}
{{- with .Values.scheduler.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.scheduler.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
Loading