Skip to content
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
17 changes: 17 additions & 0 deletions charts/questdb/templates/init_config_scripts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "questdb.fullname" . }}-config-scripts
labels:
{{- include "questdb.labels" . | nindent 4 }}
data:
prepare_config.sh: |
#!/bin/bash
data_dir="$1"

if [ -d "${data_dir}"/override_conf/ ] ; then
# Copy override configuration files
cp "${data_dir}"/override_conf/* "${data_dir}"/merged_conf/
fi

echo "Configuration preparation complete"
63 changes: 48 additions & 15 deletions charts/questdb/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,16 @@ spec:
{{ toYaml .Values.questdb.envFrom | nindent 10 }}
{{- end }}
volumeMounts:
- name: tmpfs-tmp
mountPath: /tmp
- name: tmpfs-questdb-import
mountPath: /var/lib/questdb/import
- name: tmpfs-questdb-public
mountPath: /var/lib/questdb/public
- name: {{ include "questdb.fullname" . }}
mountPath: {{ .Values.questdb.dataDir }}
{{- if .Values.questdb.serverConfig.enabled }}
- name: server-config
mountPath: {{ .Values.questdb.dataDir }}/conf/server.conf
subPath: server.conf
{{- end }}
{{- if .Values.questdb.loggingConfig.enabled }}
- name: logging-config
mountPath: {{ .Values.questdb.dataDir }}/conf/log.conf
subPath: log.conf
{{- end }}
{{- if .Values.questdb.mimeConfig.enabled }}
- name: mime-config
mountPath: {{ .Values.questdb.dataDir }}/conf/mime.types
subPath: mime.types
{{- end }}
- name: config-mount
mountPath: {{ .Values.questdb.dataDir }}/conf
{{- if .Values.extraVolumeMounts }}
{{ toYaml .Values.extraVolumeMounts | nindent 10 }}
{{- end }}
Expand Down Expand Up @@ -99,6 +92,35 @@ spec:
{{- toYaml .Values.sidecars | nindent 8 }}
{{- end }}
initContainers:
- name: init-config-prep
image: "{{ .Values.configPrep.image.repository }}:{{ .Values.configPrep.image.tag }}"
command: ["bash", "/mnt/prep_scripts/prepare_config.sh", "{{ .Values.questdb.dataDir }}"]
securityContext:
{{- include "generateSecurityContext" . | nindent 12 }}
volumeMounts:
- name: prep-scripts
mountPath: /mnt/prep_scripts
- name: config-mount
mountPath: {{ .Values.questdb.dataDir }}/merged_conf
{{- if .Values.questdb.serverConfig.enabled }}
- name: server-config
mountPath: {{ .Values.questdb.dataDir }}/override_conf/server.conf
subPath: server.conf
{{- end }}
{{- if .Values.questdb.loggingConfig.enabled }}
- name: logging-config
mountPath: {{ .Values.questdb.dataDir }}/override_conf/log.conf
subPath: log.conf
{{- end }}
{{- if .Values.questdb.mimeConfig.enabled }}
- name: mime-config
mountPath: {{ .Values.questdb.dataDir }}/override_conf/mime.types
subPath: mime.types
{{- end }}
{{- if .Values.configPrep.resources }}
resources:
{{- toYaml .Values.configPrep.resources | nindent 12}}
{{- end }}
- name: init-db-migration
image: "{{ .Values.dataMigration.image.repository }}:{{ .Values.dataMigration.image.tag }}"
command: ["bash", "/mnt/migration_scripts/migrate_to_helm_v1.sh"]
Expand Down Expand Up @@ -129,6 +151,17 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: tmpfs-tmp
emptyDir: {}
- name: tmpfs-questdb-import
emptyDir: {}
- name: tmpfs-questdb-public
emptyDir: {}
- name: config-mount
emptyDir: {}
- name: prep-scripts
configMap:
name: {{ include "questdb.fullname" . }}-config-scripts
{{- if .Values.questdb.serverConfig.enabled }}
- name: server-config
{{- if eq .Values.questdb.configStorageType "Secret" }}
Expand Down
12 changes: 12 additions & 0 deletions charts/questdb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ podSecurityContext:
type: RuntimeDefault

securityContext:
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
Expand Down Expand Up @@ -142,6 +143,17 @@ dataMigration:
limits:
memory: "1Gi"

configPrep:
image:
repository: debian
pullPolicy: IfNotPresent
tag: 12.10-slim
resources:
requests:
memory: "256Mi"
limits:
memory: "256Mi"

# openshift
openshift:
enabled: detect