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

feat: add support for extraEnvFrom #85

Merged
merged 30 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
d14e5d6
feat: add support for extraEnvFrom
M0NsTeRRR May 9, 2024
605728c
fix: remove empty line
M0NsTeRRR May 9, 2024
6c0145f
feat: add discussed changes
M0NsTeRRR May 13, 2024
a2cf849
fix: don't set metastore uri when not needed
M0NsTeRRR May 13, 2024
4475a88
fix: azure account placeholder
M0NsTeRRR May 13, 2024
875a08f
fix: typo
M0NsTeRRR May 14, 2024
6b7e435
fix: typo
M0NsTeRRR May 14, 2024
f3f4be4
fix: typo
M0NsTeRRR May 14, 2024
23fd121
fix: typo
M0NsTeRRR May 14, 2024
68c4c1f
fix: secret ref placeholder
M0NsTeRRR May 14, 2024
30f49df
fix: secret ref placeholder
M0NsTeRRR May 14, 2024
4a345da
fix: secret ref placeholder
M0NsTeRRR May 14, 2024
59c8eb9
fix: env ordering & postgres host required
M0NsTeRRR May 14, 2024
0ae5993
fix: postgres default values
M0NsTeRRR May 14, 2024
5a78d5c
feat: update janitor deployment to support metastore env vars
M0NsTeRRR May 14, 2024
e60b5cc
feat: update control-plane deployment to support metastore env vars
M0NsTeRRR May 14, 2024
5b5f2dc
fix: quickwit configmap
M0NsTeRRR May 22, 2024
2316288
fix: quickwit secret empty
M0NsTeRRR May 22, 2024
9815711
fix: quickwit secret leak in configmap
M0NsTeRRR May 27, 2024
b504bda
feat: add requested changes
M0NsTeRRR May 30, 2024
611354a
fix: add suggested change
M0NsTeRRR Jun 1, 2024
40c727e
chore: add configMapRef example in values.yaml
M0NsTeRRR Jun 18, 2024
85fafa9
Merge branch 'main' into feat/support-extra-env-from
M0NsTeRRR Jun 18, 2024
9055a0f
fix: add QW_METASTORE_URI doc
M0NsTeRRR Jun 20, 2024
8f0d1ed
chore: document the breaking change and change the versioning accordi…
idrissneumann Jun 20, 2024
3ae4589
chore: document the breaking change and change the versioning accordi…
M0NsTeRRR Jun 20, 2024
01f86d2
fix: readme depreciation notice
M0NsTeRRR Jun 24, 2024
9ae752d
fix: add back indexer & search settings example
M0NsTeRRR Jun 24, 2024
cbd1ddb
fix: readme suggested changes
M0NsTeRRR Jun 24, 2024
e4ca142
fix: readme missing newlines
M0NsTeRRR Jun 24, 2024
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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,26 @@ The way storage config is defined changed and you have to update your helm value
The changes are:
- the `config.s3` and `config.azure_blob` values are no more supported. You now have to use the storage config as defined in the [docs](https://quickwit.io/docs/configuration/storage-config).
- the keys of secrets have changed: `s3.secret_key` is replaced by `storage.s3.secret_access_key` and `azure_blob.access_key` is replace by `storage.azure.access_key`.

## Upgrade helm chart from 0.5.0 to 0.6.0

The way the `config` value works has changed in 0.6.0. It is now copied "as is"
to the Quickwit nodes' configurations. In particular:

- the `config.postgres` section does not support the following attributes
anymore
```
host: ""
port: 5432
database: metastore
username: quickwit
assword: ""
```
Configure `QW_METASTORE_URI` in `extraEnvFrom` instead (see
[documentation](https://quickwit.io/docs/configuration/metastore-config) for
more details).

- the seed configuration has moved from `config` to a dedicated attribute. The
changes are:
- the `config.indexes` field is moved to `seed.indexes`
- the `config.sources` field is moved to `seed.sources`
2 changes: 1 addition & 1 deletion charts/quickwit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: quickwit
description: Sub-second search & analytics engine on cloud storage.
type: application
version: 0.5.16
version: 0.6.0
appVersion: "v0.8.1"
keywords:
- quickwit
Expand Down
53 changes: 3 additions & 50 deletions charts/quickwit/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ helm.sh/chart: {{ include "quickwit.chart" . }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{ include "quickwit.additionalLabels" . }}
{{- include "quickwit.additionalLabels" . }}
{{- end }}

{{/*
Expand Down Expand Up @@ -147,63 +147,16 @@ Quickwit environment
value: node.yaml
- name: QW_CLUSTER_ID
value: {{ .Release.Namespace }}-{{ include "quickwit.fullname" . }}
{{- if ((.Values.config.storage).s3).access_key_id }}
- name: AWS_ACCESS_KEY_ID
value: {{ .Values.config.storage.s3.access_key_id }}
{{- end }}
{{- if ((.Values.config.storage).s3).secret_access_key }}
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ include "quickwit.fullname" $ }}
key: storage.s3.secret_access_key
{{- end }}
{{- if ((.Values.config.storage).azure).account }}
- name: QW_AZURE_STORAGE_ACCOUNT
value: {{ .Values.config.storage.azure.account }}
{{- end }}
{{- if ((.Values.config.storage).azure).access_key }}
- name: QW_AZURE_STORAGE_ACCESS_KEY
valueFrom:
secretKeyRef:
name: {{ include "quickwit.fullname" $ }}
key: storage.azure.access_key
{{- end }}
- name: QW_NODE_ID
value: "$(POD_NAME)"
- name: QW_PEER_SEEDS
value: {{ include "quickwit.fullname" . }}-headless
- name: QW_ADVERTISE_ADDRESS
value: "$(POD_IP)"
- name: QW_CLUSTER_ENDPOINT
value: http://{{ include "quickwit.fullname" $ }}-metastore.{{ $.Release.Namespace }}.svc.cluster.local:7280
{{- range $key, $value := .Values.environment }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- end }}

{{/*
Quickwit metastore environment
*/}}
{{- define "quickwit.metastore.environment" -}}
{{ include "quickwit.environment" . }}
{{- if .Values.config.metastore_uri }}
- name: QW_METASTORE_URI
value: {{ .Values.config.metastore_uri }}
{{- else if .Values.config.postgres }}
- name: POSTGRES_HOST
value: {{ required "A valid config.postgres.host is required!" .Values.config.postgres.host }}
- name: POSTGRES_PORT
value: {{ .Values.config.postgres.port | default 5432 | quote }}
- name: POSTGRES_DATABASE
value: {{ .Values.config.postgres.database | default "metastore" }}
- name: POSTGRES_USERNAME
value: {{ .Values.config.postgres.username | default "quickwit" }}
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "quickwit.fullname" . }}
key: postgres.password
- name: QW_METASTORE_URI
value: "postgres://$(POSTGRES_USERNAME):$(POSTGRES_PASSWORD)@$(POSTGRES_HOST):$(POSTGRES_PORT)/$(POSTGRES_DATABASE)"
{{- end }}
{{- end }}
6 changes: 3 additions & 3 deletions charts/quickwit/templates/configmap-bootstrap.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{{- if and (or .Values.config.sources .Values.config.indexes) .Values.bootstrap.enabled -}}
{{- if and (or .Values.seed.sources .Values.seed.indexes) .Values.bootstrap.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "quickwit.fullname" . }}-bootstrap
labels:
{{- include "quickwit.labels" . | nindent 4 }}
data:
{{- range .Values.config.indexes }}
{{- range .Values.seed.indexes }}
{{ .index_id }}.yaml: |-
{{- toYaml . | nindent 4 }}
{{- end }}
{{- range .Values.config.sources }}
{{- range .Values.seed.sources }}
{{ .source.source_id }}.yaml: |-
{{- toYaml .source | nindent 4 }}
{{- end }}
Expand Down
31 changes: 1 addition & 30 deletions charts/quickwit/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,4 @@ metadata:
{{- include "quickwit.labels" . | nindent 4 }}
data:
node.yaml: |-
version: 0.8
listen_address: 0.0.0.0
gossip_listen_port: 7282
data_dir: /quickwit/qwdata
default_index_root_uri: {{ .Values.config.default_index_root_uri }}
{{- with .Values.config.indexer }}
indexer:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.config.storage }}
storage:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.config.ingest_api }}
ingest_api:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.config.searcher }}
searcher:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.config.jaeger }}
jaeger:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- if (.Values.config.postgres).max_num_connections }}
metastore:
postgres:
max_num_connections: {{ .Values.config.postgres.max_num_connections }}
{{- end }}
{{- toYaml .Values.config | nindent 4 }}
9 changes: 9 additions & 0 deletions charts/quickwit/templates/control-plane-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ spec:
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if or (.Values.environmentFrom) (.Values.control_plane.extraEnvFrom) }}
envFrom:
{{- with .Values.environmentFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.control_plane.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
ports:
{{- include "quickwit.ports" . | nindent 12 }}
startupProbe:
Expand Down
9 changes: 9 additions & 0 deletions charts/quickwit/templates/indexer-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ spec:
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if or (.Values.environmentFrom) (.Values.indexer.extraEnvFrom) }}
envFrom:
{{- with .Values.environmentFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.indexer.extraEnvFrom }}
M0NsTeRRR marked this conversation as resolved.
Show resolved Hide resolved
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
args: ["run", "--service", "indexer"]
ports:
{{- include "quickwit.ports" . | nindent 12 }}
Expand Down
9 changes: 9 additions & 0 deletions charts/quickwit/templates/janitor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ spec:
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if or (.Values.environmentFrom) (.Values.janitor.extraEnvFrom) }}
envFrom:
{{- with .Values.environmentFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.janitor.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
ports:
{{- include "quickwit.ports" . | nindent 12 }}
startupProbe:
Expand Down
15 changes: 11 additions & 4 deletions charts/quickwit/templates/job-create-indices.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.bootstrap.enabled -}}
{{- range .Values.config.indexes }}
{{- range .Values.seed.indexes }}
---
apiVersion: batch/v1
kind: Job
Expand Down Expand Up @@ -35,13 +35,20 @@ spec:
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: ["/bin/bash","-c","quickwit index describe --index {{ .index_id }} --endpoint ${QW_CLUSTER_ENDPOINT} || quickwit index create --index-config {{ .index_id }}.yaml --endpoint ${QW_CLUSTER_ENDPOINT}"]
env:
- name: QW_CLUSTER_ENDPOINT
value: http://{{ include "quickwit.fullname" $ }}-metastore.{{ $.Release.Namespace }}.svc.cluster.local:7280
{{- include "quickwit.metastore.environment" $ | nindent 10 }}
{{- include "quickwit.environment" $ | nindent 10 }}
{{- range $key, $value := $.Values.bootstrap.extraEnv }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if or ($.Values.environmentFrom) ($.Values.bootstrap.extraEnvFrom) }}
envFrom:
{{- with $.Values.environmentFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.bootstrap.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
volumeMounts:
- name: config
mountPath: /quickwit/node.yaml
Expand Down
17 changes: 12 additions & 5 deletions charts/quickwit/templates/job-create-sources.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.bootstrap.enabled -}}
{{- range .Values.config.sources }}
{{- range .Values.seed.sources }}
---
apiVersion: batch/v1
kind: Job
Expand Down Expand Up @@ -35,18 +35,25 @@ spec:
imagePullPolicy: {{ $.Values.image.pullPolicy }}
command: ["/bin/bash","-c","quickwit source describe --index {{ .index }} --source {{ .source.source_id }} --endpoint ${QW_CLUSTER_ENDPOINT}|| quickwit source create --index {{ .index }} --source-config {{ .source.source_id }}.yaml --endpoint ${QW_CLUSTER_ENDPOINT}"]
env:
- name: QW_CLUSTER_ENDPOINT
value: http://{{ include "quickwit.fullname" $ }}-metastore.{{ $.Release.Namespace }}.svc.cluster.local:7280
{{- include "quickwit.metastore.environment" $ | nindent 10 }}
{{- include "quickwit.environment" $ | nindent 10 }}
{{- range $key, $value := $.Values.bootstrap.extraEnv }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if or ($.Values.environmentFrom) ($.Values.bootstrap.extraEnvFrom) }}
envFrom:
{{- with $.Values.environmentFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.bootstrap.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
volumeMounts:
- name: config
mountPath: /quickwit/node.yaml
subPath: node.yaml
{{- if $.Values.config.sources }}
{{- if $.Values.seed.sources }}
- name: source
mountPath: /quickwit/{{ .source.source_id }}.yaml
subPath: {{ .source.source_id }}.yaml
Expand Down
11 changes: 10 additions & 1 deletion charts/quickwit/templates/metastore-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,20 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
args: ["run", "--service", "metastore"]
env:
{{- include "quickwit.metastore.environment" . | nindent 12 }}
{{- include "quickwit.environment" . | nindent 12 }}
{{- range $key, $value := .Values.metastore.extraEnv }}
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if or (.Values.environmentFrom) (.Values.metastore.extraEnvFrom) }}
envFrom:
M0NsTeRRR marked this conversation as resolved.
Show resolved Hide resolved
{{- with .Values.environmentFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.metastore.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
ports:
{{- include "quickwit.ports" . | nindent 12 }}
startupProbe:
Expand Down
9 changes: 9 additions & 0 deletions charts/quickwit/templates/searcher-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,15 @@ spec:
- name: "{{ $key }}"
value: "{{ $value }}"
{{- end }}
{{- if or (.Values.environmentFrom) (.Values.searcher.extraEnvFrom) }}
envFrom:
M0NsTeRRR marked this conversation as resolved.
Show resolved Hide resolved
{{- with .Values.environmentFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.searcher.extraEnvFrom }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
args: ["run", "--service", "searcher"]
ports:
{{- include "quickwit.ports" . | nindent 12 }}
Expand Down
17 changes: 0 additions & 17 deletions charts/quickwit/templates/secret.yaml

This file was deleted.

Loading
Loading