From ddb9644b450c0eef0930a9cd5186128b036dedbb Mon Sep 17 00:00:00 2001 From: Hellis Date: Tue, 29 Sep 2020 23:07:26 +0800 Subject: [PATCH] [incubator/druid] Add securityContext and fix local storage mounting path (#23561) * add securityContext into statefulset yaml Signed-off-by: AWaterColorPen * change volume mounts path Signed-off-by: AWaterColorPen --- incubator/druid/Chart.yaml | 2 +- incubator/druid/README.md | 2 ++ incubator/druid/templates/historical/statefulset.yaml | 6 +++++- incubator/druid/templates/middleManager/statefulset.yaml | 6 +++++- incubator/druid/values.yaml | 6 ++++++ 5 files changed, 19 insertions(+), 3 deletions(-) diff --git a/incubator/druid/Chart.yaml b/incubator/druid/Chart.yaml index cb9a6c8f1f..0960eb17c8 100644 --- a/incubator/druid/Chart.yaml +++ b/incubator/druid/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 0.19.0 description: Apache Druid is a high performance real-time analytics database. name: druid -version: 0.2.12 +version: 0.2.13 home: https://druid.apache.org/ icon: https://druid.apache.org/img/favicon.png maintainers: diff --git a/incubator/druid/README.md b/incubator/druid/README.md index fa98612397..56f9a21b84 100644 --- a/incubator/druid/README.md +++ b/incubator/druid/README.md @@ -126,6 +126,7 @@ The following table lists the configurable parameters of the Druid chart and the | `historical.resources` | historical node resources requests & limits | `{}` | | `historical.podAnnotations` | historical Deployment annotations | `{}` | | `historical.nodeSelector` | node labels for historical pod assignment | `{}` | +| `historical.securityContext` | custom security context for historical containers | `{ fsGroup: 1000 }` | | `historical.tolerations` | historical tolerations | `[]` | | `historical.config` | historical node private config such as `JAVA_OPTS` | | | `historical.persistence.enabled` | historical persistent enabled/disabled | `true` | @@ -147,6 +148,7 @@ The following table lists the configurable parameters of the Druid chart and the | `middleManager.resources` | middleManager node resources requests & limits | `{}` | | `middleManager.podAnnotations` | middleManager Deployment annotations | `{}` | | `middleManager.nodeSelector` | Node labels for middleManager pod assignment | `{}` | +| `middleManager.securityContext` | custom security context for middleManager containers | `{ fsGroup: 1000 }` | | `middleManager.tolerations` | middleManager tolerations | `[]` | | `middleManager.config` | middleManager private config such as `JAVA_OPTS` | | | `middleManager.persistence.enabled` | middleManager persistent enabled/disabled | `true` | diff --git a/incubator/druid/templates/historical/statefulset.yaml b/incubator/druid/templates/historical/statefulset.yaml index 5597c08657..7d7eae98aa 100644 --- a/incubator/druid/templates/historical/statefulset.yaml +++ b/incubator/druid/templates/historical/statefulset.yaml @@ -60,6 +60,10 @@ spec: nodeSelector: {{ toYaml .Values.historical.nodeSelector | indent 8 }} {{- end }} +{{- if .Values.historical.securityContext }} + securityContext: +{{ toYaml .Values.historical.securityContext | indent 8 }} +{{- end }} {{- if .Values.historical.tolerations }} tolerations: {{ toYaml .Values.historical.tolerations | indent 8 }} @@ -97,7 +101,7 @@ spec: - containerPort: {{ .Values.historical.port }} name: http volumeMounts: - - mountPath: /var/druid/ + - mountPath: /opt/druid/var/druid/ name: data {{- if .Values.gCloudStorage.enabled }} - name: google-cloud-key diff --git a/incubator/druid/templates/middleManager/statefulset.yaml b/incubator/druid/templates/middleManager/statefulset.yaml index 0c2bfcb232..fed59f0a4d 100644 --- a/incubator/druid/templates/middleManager/statefulset.yaml +++ b/incubator/druid/templates/middleManager/statefulset.yaml @@ -60,6 +60,10 @@ spec: nodeSelector: {{ toYaml .Values.middleManager.nodeSelector | indent 8 }} {{- end }} +{{- if .Values.middleManager.securityContext }} + securityContext: +{{ toYaml .Values.middleManager.securityContext | indent 8 }} +{{- end }} {{- if .Values.middleManager.tolerations }} tolerations: {{ toYaml .Values.middleManager.tolerations | indent 8 }} @@ -97,7 +101,7 @@ spec: - containerPort: {{ .Values.middleManager.port }} name: http volumeMounts: - - mountPath: /var/druid/ + - mountPath: /opt/druid/var/druid/ name: data {{- if .Values.gCloudStorage.enabled }} - name: google-cloud-key diff --git a/incubator/druid/values.yaml b/incubator/druid/values.yaml index 3fe8bf321b..a7588d2d14 100644 --- a/incubator/druid/values.yaml +++ b/incubator/druid/values.yaml @@ -205,6 +205,9 @@ historical: nodeSelector: {} + securityContext: + fsGroup: 1000 + tolerations: [] resources: {} @@ -284,6 +287,9 @@ middleManager: nodeSelector: {} + securityContext: + fsGroup: 1000 + tolerations: [] resources: {}