From d4964fd412db9c16b67938fb98117fdc3dd467cf Mon Sep 17 00:00:00 2001 From: fmassot Date: Sun, 26 Nov 2023 17:05:39 +0100 Subject: [PATCH 1/6] Add storage config. --- charts/quickwit/Chart.yaml | 4 ++-- charts/quickwit/templates/_helpers.tpl | 24 ++++---------------- charts/quickwit/templates/configmap.yaml | 12 +++++++++- charts/quickwit/templates/secret.yaml | 8 +++---- charts/quickwit/values.yaml | 29 ++++++++++++++---------- 5 files changed, 38 insertions(+), 39 deletions(-) diff --git a/charts/quickwit/Chart.yaml b/charts/quickwit/Chart.yaml index 2ee3bd3..181715b 100644 --- a/charts/quickwit/Chart.yaml +++ b/charts/quickwit/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 name: quickwit description: Sub-second search & analytics engine on cloud storage. type: application -version: 0.4.0 -appVersion: "v0.6.1" +version: 0.5.0 +appVersion: "v0.6.4" keywords: - quickwit - search diff --git a/charts/quickwit/templates/_helpers.tpl b/charts/quickwit/templates/_helpers.tpl index e3d31d4..917d12c 100644 --- a/charts/quickwit/templates/_helpers.tpl +++ b/charts/quickwit/templates/_helpers.tpl @@ -140,35 +140,19 @@ Quickwit environment value: node.yaml - name: QW_CLUSTER_ID value: {{ .Release.Namespace }}-{{ include "quickwit.fullname" . }} -{{- with .Values.config.s3 }} -{{- if .endpoint }} -- name: QW_S3_ENDPOINT - value: {{ .endpoint }} -{{- end }} -{{- if .region }} -- name: AWS_REGION - value: {{ .region }} -{{- end }} -{{- if and .secret_key .access_key }} -- name: AWS_ACCESS_KEY_ID - value: {{ .access_key }} +{{- if and (.Values.config.storage) (.Values.config.storage.s3) (.Values.config.storage.s3.secret_access_key) }} - name: AWS_SECRET_ACCESS_KEY valueFrom: secretKeyRef: name: {{ include "quickwit.fullname" $ }} - key: s3.secret_key + key: .Values.config.storage.s3.secret_access_key {{- end }} -{{- end }} -{{- if .Values.config.azure_blob.account_name }} -- name: QW_AZURE_STORAGE_ACCOUNT - value: {{ .Values.config.azure_blob.account_name }} -{{- end }} -{{- if .Values.config.azure_blob.access_key }} +{{- if and (.Values.config.storage) (.Values.config.storage.azure) (.Values.config.storage.azure.access_key) }} - name: QW_AZURE_STORAGE_ACCESS_KEY valueFrom: secretKeyRef: name: {{ include "quickwit.fullname" $ }} - key: azure_blob.access_key + key: .Values.config.azure.access_key {{- end }} - name: QW_NODE_ID value: "$(POD_NAME)" diff --git a/charts/quickwit/templates/configmap.yaml b/charts/quickwit/templates/configmap.yaml index c745988..248659e 100644 --- a/charts/quickwit/templates/configmap.yaml +++ b/charts/quickwit/templates/configmap.yaml @@ -6,7 +6,7 @@ metadata: {{- include "quickwit.labels" . | nindent 4 }} data: node.yaml: |- - version: 0.5 + version: 0.6 listen_address: 0.0.0.0 gossip_listen_port: 7282 data_dir: /quickwit/qwdata @@ -15,6 +15,16 @@ data: indexer: {{- toYaml . | nindent 6 }} {{- end }} + {{- with .Values.config.storage }} + {{ if .s3 }} + {{- $_ := unset .s3 "secret_access_key" }} + {{- end }} + {{ if .azure }} + {{- $_ := unset .azure "access_key" }} + {{- end }} + storage: + {{- toYaml . | nindent 6 }} + {{- end }} {{- with .Values.config.ingest_api }} ingest_api: {{- toYaml . | nindent 6 }} diff --git a/charts/quickwit/templates/secret.yaml b/charts/quickwit/templates/secret.yaml index 1e154fc..d5e80c6 100644 --- a/charts/quickwit/templates/secret.yaml +++ b/charts/quickwit/templates/secret.yaml @@ -9,9 +9,9 @@ data: {{- if .Values.config.postgres }} postgres.password: {{ required "A valid config.postgres.password is required!" .Values.config.postgres.password | b64enc | quote }} {{- end }} -{{- if .Values.config.s3.secret_key }} - s3.secret_key: {{ .Values.config.s3.secret_key | b64enc | quote }} +{{- if and (.Values.config.storage) (.Values.config.storage.s3) (.Values.config.storage.s3.secret_access_key) }} + storage.s3.secret_access_key: {{ .Values.config.storage.s3.secret_access_key | b64enc | quote }} {{- end }} -{{- if .Values.config.azure_blob.access_key }} - azure_blob.access_key: {{ .Values.config.azure_blob.access_key | b64enc | quote }} +{{- if and (.Values.config.storage) (.Values.config.storage.azure) (.Values.config.storage.azure.access_key) }} + storage.azure.access_key: {{ .Values.config.storage.azure.access_key | b64enc | quote }} {{- end }} diff --git a/charts/quickwit/values.yaml b/charts/quickwit/values.yaml index deade4e..e1eb921 100644 --- a/charts/quickwit/values.yaml +++ b/charts/quickwit/values.yaml @@ -6,7 +6,7 @@ image: repository: quickwit/quickwit pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. - # tag: v0.6.1 + # tag: v0.6.4 imagePullSecrets: [] nameOverride: "" @@ -306,22 +306,27 @@ bootstrap: # Quickwit configuration config: # Metastore configuration. - postgres: {} + # Could be set either with QW_METASTORE_URI or with the following config: + # - If on S3: + # metastore_uri: s3://quickwit-indexes + # - If on postgres-like db: + # postgres: {} # host: "" # port: 5432 # database: metastore # username: quickwit # password: "" - s3: {} - # endpoint: "https://s3.eu-west-1.amazonaws.com" - # region: eu-west-1 - # access_key: "my-access-key" - # secret_key: "my-secret-key" - - azure_blob: {} - # account_name: "my-azure-blob-accout" - # access_key: "my-azure-blob-access-key" + storage: {} + # s3: + # flavor: gcs + # region: eu-west-1 + # access_key_id: "my-access-key" + # secret_access_key: "my-secret-key" + # endpoint: https://storage.googleapis.com + # azure: + # account: your-azure-account-name + # access_key: your-azure-access-key default_index_root_uri: s3://quickwit/indexes # Indexer settings @@ -364,7 +369,7 @@ config: sources: [] # - index: my-index # source: - # version: 0.5 + # version: 0.6 # source_id: my-source # source_type: kafka # num_pipelines: 1 From de278637895070ef6dc3e010df20e7cd97103e1e Mon Sep 17 00:00:00 2001 From: fmassot Date: Sun, 26 Nov 2023 17:15:02 +0100 Subject: [PATCH 2/6] Document breaking changes. --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 5690afc..8cbea65 100644 --- a/README.md +++ b/README.md @@ -20,3 +20,11 @@ To install the quickwit chart: To uninstall the chart: helm delete my-quickwit + +## Upgrade helm chart from 0.4.0 to 0.5.0 + +The way storage config is defined changed and you have to update your helm values to upgrade to 0.5.0. + +The changes are: +- the `config.s3` and `config.azure_blog` values are no more supported. You how have to use the storage config as defined in the [docs](https://quickwit.io/docs/configuration/storage-config). +- the keys of secrets have changes: `s3.secret_key` is replaced by `storage.s3.secret_access_key` and `azure_blob.access_key` is replace by `storage.azure.access_key`. From 2c6d499a0b0030424c4447a279172d1bf1e71da9 Mon Sep 17 00:00:00 2001 From: fmassot Date: Sun, 26 Nov 2023 23:34:55 +0100 Subject: [PATCH 3/6] Fix storage. --- charts/quickwit/templates/_helpers.tpl | 16 ++++++++++++---- charts/quickwit/templates/configmap.yaml | 9 ++++++--- charts/quickwit/templates/secret.yaml | 4 ++-- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/charts/quickwit/templates/_helpers.tpl b/charts/quickwit/templates/_helpers.tpl index 917d12c..0bb1306 100644 --- a/charts/quickwit/templates/_helpers.tpl +++ b/charts/quickwit/templates/_helpers.tpl @@ -140,19 +140,27 @@ Quickwit environment value: node.yaml - name: QW_CLUSTER_ID value: {{ .Release.Namespace }}-{{ include "quickwit.fullname" . }} -{{- if and (.Values.config.storage) (.Values.config.storage.s3) (.Values.config.storage.s3.secret_access_key) }} +{{- 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: .Values.config.storage.s3.secret_access_key + 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 and (.Values.config.storage) (.Values.config.storage.azure) (.Values.config.storage.azure.access_key) }} +{{- if ((.Values.config.storage).azure).access_key }} - name: QW_AZURE_STORAGE_ACCESS_KEY valueFrom: secretKeyRef: name: {{ include "quickwit.fullname" $ }} - key: .Values.config.azure.access_key + key: storage.azure.access_key {{- end }} - name: QW_NODE_ID value: "$(POD_NAME)" diff --git a/charts/quickwit/templates/configmap.yaml b/charts/quickwit/templates/configmap.yaml index 248659e..c586c6a 100644 --- a/charts/quickwit/templates/configmap.yaml +++ b/charts/quickwit/templates/configmap.yaml @@ -16,14 +16,17 @@ data: {{- toYaml . | nindent 6 }} {{- end }} {{- with .Values.config.storage }} + {{- $new_storage := . | deepCopy }} {{ if .s3 }} - {{- $_ := unset .s3 "secret_access_key" }} + {{- $_ := unset $new_storage.s3 "access_key_id" }} + {{- $_ := unset $new_storage.s3 "secret_access_key" }} {{- end }} {{ if .azure }} - {{- $_ := unset .azure "access_key" }} + {{- $_ := unset $new_storage.azure "account" }} + {{- $_ := unset $new_storage.azure "access_key" }} {{- end }} storage: - {{- toYaml . | nindent 6 }} + {{- toYaml $new_storage | nindent 6 }} {{- end }} {{- with .Values.config.ingest_api }} ingest_api: diff --git a/charts/quickwit/templates/secret.yaml b/charts/quickwit/templates/secret.yaml index d5e80c6..f2d8084 100644 --- a/charts/quickwit/templates/secret.yaml +++ b/charts/quickwit/templates/secret.yaml @@ -9,9 +9,9 @@ data: {{- if .Values.config.postgres }} postgres.password: {{ required "A valid config.postgres.password is required!" .Values.config.postgres.password | b64enc | quote }} {{- end }} -{{- if and (.Values.config.storage) (.Values.config.storage.s3) (.Values.config.storage.s3.secret_access_key) }} +{{- if ((.Values.config.storage).s3).secret_access_key }} storage.s3.secret_access_key: {{ .Values.config.storage.s3.secret_access_key | b64enc | quote }} {{- end }} -{{- if and (.Values.config.storage) (.Values.config.storage.azure) (.Values.config.storage.azure.access_key) }} +{{- if ((.Values.config.storage).azure).access_key }} storage.azure.access_key: {{ .Values.config.storage.azure.access_key | b64enc | quote }} {{- end }} From 30f33a31b5ea1df54aa3ffc6aa0a20f62ab127ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Massot?= Date: Mon, 27 Nov 2023 09:35:02 +0100 Subject: [PATCH 4/6] Update README.md Co-authored-by: Paul Masurel --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8cbea65..5b4159d 100644 --- a/README.md +++ b/README.md @@ -26,5 +26,5 @@ To uninstall the chart: The way storage config is defined changed and you have to update your helm values to upgrade to 0.5.0. The changes are: -- the `config.s3` and `config.azure_blog` values are no more supported. You how have to use the storage config as defined in the [docs](https://quickwit.io/docs/configuration/storage-config). +- the `config.s3` and `config.azure_blob` values are no more supported. You how have to use the storage config as defined in the [docs](https://quickwit.io/docs/configuration/storage-config). - the keys of secrets have changes: `s3.secret_key` is replaced by `storage.s3.secret_access_key` and `azure_blob.access_key` is replace by `storage.azure.access_key`. From 79449fc4a4221bd94babe40ff1b4c78aaf1a9729 Mon Sep 17 00:00:00 2001 From: fmassot Date: Mon, 27 Nov 2023 09:56:25 +0100 Subject: [PATCH 5/6] Wording and add comment. --- README.md | 4 ++-- charts/quickwit/templates/configmap.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5b4159d..8a1410e 100644 --- a/README.md +++ b/README.md @@ -26,5 +26,5 @@ To uninstall the chart: The way storage config is defined changed and you have to update your helm values to upgrade to 0.5.0. The changes are: -- the `config.s3` and `config.azure_blob` values are no more supported. You how have to use the storage config as defined in the [docs](https://quickwit.io/docs/configuration/storage-config). -- the keys of secrets have changes: `s3.secret_key` is replaced by `storage.s3.secret_access_key` and `azure_blob.access_key` is replace by `storage.azure.access_key`. +- 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`. diff --git a/charts/quickwit/templates/configmap.yaml b/charts/quickwit/templates/configmap.yaml index c586c6a..5fd6d5c 100644 --- a/charts/quickwit/templates/configmap.yaml +++ b/charts/quickwit/templates/configmap.yaml @@ -17,10 +17,12 @@ data: {{- end }} {{- with .Values.config.storage }} {{- $new_storage := . | deepCopy }} + {{- /* s3 access_key_id and secret_access_key are already set by env variables */}} {{ if .s3 }} {{- $_ := unset $new_storage.s3 "access_key_id" }} {{- $_ := unset $new_storage.s3 "secret_access_key" }} {{- end }} + {{- /* azure account and access_key are already set by env variables */}} {{ if .azure }} {{- $_ := unset $new_storage.azure "account" }} {{- $_ := unset $new_storage.azure "access_key" }} From deba3527c9d8a80d9d32f883e97391208f734a6d Mon Sep 17 00:00:00 2001 From: fmassot Date: Wed, 29 Nov 2023 01:04:21 +0100 Subject: [PATCH 6/6] Add pod management policy for indexers and searchers. --- charts/quickwit/Chart.yaml | 2 +- charts/quickwit/templates/indexer-statefulset.yaml | 3 +++ charts/quickwit/templates/searcher-statefulset.yaml | 3 +++ charts/quickwit/values.yaml | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/quickwit/Chart.yaml b/charts/quickwit/Chart.yaml index 181715b..542bbbf 100644 --- a/charts/quickwit/Chart.yaml +++ b/charts/quickwit/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: quickwit description: Sub-second search & analytics engine on cloud storage. type: application -version: 0.5.0 +version: 0.5.1 appVersion: "v0.6.4" keywords: - quickwit diff --git a/charts/quickwit/templates/indexer-statefulset.yaml b/charts/quickwit/templates/indexer-statefulset.yaml index 1539843..8f013c4 100644 --- a/charts/quickwit/templates/indexer-statefulset.yaml +++ b/charts/quickwit/templates/indexer-statefulset.yaml @@ -7,6 +7,9 @@ metadata: spec: replicas: {{ .Values.indexer.replicaCount }} serviceName: {{ include "quickwit.fullname" . }}-headless + {{- if .Values.searcher.podManagementPolicy }} + podManagementPolicy: {{ .Values.indexer.podManagementPolicy }} + {{- end }} selector: matchLabels: {{- include "quickwit.indexer.selectorLabels" . | nindent 6 }} diff --git a/charts/quickwit/templates/searcher-statefulset.yaml b/charts/quickwit/templates/searcher-statefulset.yaml index 127a5ff..a702fb7 100644 --- a/charts/quickwit/templates/searcher-statefulset.yaml +++ b/charts/quickwit/templates/searcher-statefulset.yaml @@ -7,6 +7,9 @@ metadata: spec: replicas: {{ .Values.searcher.replicaCount }} serviceName: {{ include "quickwit.fullname" . }}-headless + {{- if .Values.searcher.podManagementPolicy }} + podManagementPolicy: {{ .Values.searcher.podManagementPolicy }} + {{- end }} selector: matchLabels: {{- include "quickwit.searcher.selectorLabels" . | nindent 6 }} diff --git a/charts/quickwit/values.yaml b/charts/quickwit/values.yaml index e1eb921..86080e1 100644 --- a/charts/quickwit/values.yaml +++ b/charts/quickwit/values.yaml @@ -58,6 +58,8 @@ searcher: # maxUnavailable: 1 # minAvailable: 2 + # podManagementPolicy: OrderedReady + persistentVolume: enabled: false # storage: "1Gi" @@ -109,6 +111,8 @@ indexer: # maxUnavailable: 1 # minAvailable: 2 + # podManagementPolicy: OrderedReady + updateStrategy: {} # type: RollingUpdate