From 2c0b562237224aec85e7a76840158a0bfbb30d9a Mon Sep 17 00:00:00 2001 From: Akshay Iyyadurai Balasundaram Date: Sat, 12 Oct 2024 00:02:09 +0200 Subject: [PATCH 1/5] fixes #27 Signed-off-by: Akshay Iyyadurai Balasundaram --- charts/perses/templates/statefulset.yaml | 6 +++++- charts/perses/values.schema.json | 9 +++++++++ charts/perses/values.yaml | 8 ++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/charts/perses/templates/statefulset.yaml b/charts/perses/templates/statefulset.yaml index ef5c4ef..92344af 100644 --- a/charts/perses/templates/statefulset.yaml +++ b/charts/perses/templates/statefulset.yaml @@ -26,6 +26,10 @@ spec: {{- end }} spec: serviceAccountName: {{ include "perses.serviceAccountName" . }} + {{- if .Values.persistence.enabled }} + securityContext: + {{- toYaml .Values.persistence.securityContext | nindent 8 }} + {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.name }}:{{ .Values.image.version | default .Chart.AppVersion }}" @@ -98,4 +102,4 @@ spec: - name: datasources configMap: name: {{ include "perses.fullname" . }}-datasources - {{- end }} \ No newline at end of file + {{- end }} diff --git a/charts/perses/values.schema.json b/charts/perses/values.schema.json index fcf3546..a7d2005 100644 --- a/charts/perses/values.schema.json +++ b/charts/perses/values.schema.json @@ -411,6 +411,15 @@ "size": { "type": "string" }, + "securityContext":{ + "type": "object", + "additionalProperties": false, + "properties": { + "fsGroup": { + "type": "integer" + } + } + }, "labels": { "type": "object" }, diff --git a/charts/perses/values.yaml b/charts/perses/values.yaml index 2987611..12011fc 100644 --- a/charts/perses/values.yaml +++ b/charts/perses/values.yaml @@ -150,7 +150,7 @@ persistence: enabled: false # -- Specify the `storageClass` used to provision the volume - storageClass: "" + storageClass: "default" # -- PVC Access Modes for data volume accessModes: @@ -159,6 +159,10 @@ persistence: # -- PVC Storage Request for data volume size: 8Gi + # -- Security context for the PVC when persistence is enabled + securityContext: + fsGroup: 2000 + # -- Labels for the PVC labels: {} # -- Annotations for the PVC @@ -202,4 +206,4 @@ datasources: # plugin: # kind: PrometheusDatasource # spec: - # directUrl: https://prometheus.demo.do.prometheus.io \ No newline at end of file + # directUrl: https://prometheus.demo.do.prometheus.io From dfc45dbda4bfd0c4fe3e39391317e1780a534b05 Mon Sep 17 00:00:00 2001 From: Akshay Iyyadurai Balasundaram Date: Sat, 12 Oct 2024 00:05:57 +0200 Subject: [PATCH 2/5] add empty line Signed-off-by: Akshay Iyyadurai Balasundaram --- charts/perses/values.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/perses/values.yaml b/charts/perses/values.yaml index 12011fc..b8821b7 100644 --- a/charts/perses/values.yaml +++ b/charts/perses/values.yaml @@ -207,3 +207,4 @@ datasources: # kind: PrometheusDatasource # spec: # directUrl: https://prometheus.demo.do.prometheus.io + From d35e4552b1a34ff06b347f38591cd7bd3890587c Mon Sep 17 00:00:00 2001 From: Akshay Iyyadurai Balasundaram Date: Sat, 12 Oct 2024 00:06:27 +0200 Subject: [PATCH 3/5] add empty line Signed-off-by: Akshay Iyyadurai Balasundaram --- charts/perses/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/perses/values.yaml b/charts/perses/values.yaml index b8821b7..03ac49f 100644 --- a/charts/perses/values.yaml +++ b/charts/perses/values.yaml @@ -207,4 +207,4 @@ datasources: # kind: PrometheusDatasource # spec: # directUrl: https://prometheus.demo.do.prometheus.io - + From a5ebe37990b9c85bddc0f76ffe8c486e41165873 Mon Sep 17 00:00:00 2001 From: Akshay Iyyadurai Balasundaram Date: Tue, 22 Oct 2024 11:32:02 +0200 Subject: [PATCH 4/5] [ENHANCEMENT] allows enable securityContext Signed-off-by: Akshay Iyyadurai Balasundaram --- charts/perses/templates/statefulset.yaml | 2 -- charts/perses/values.yaml | 1 - 2 files changed, 3 deletions(-) diff --git a/charts/perses/templates/statefulset.yaml b/charts/perses/templates/statefulset.yaml index 92344af..5542cfd 100644 --- a/charts/perses/templates/statefulset.yaml +++ b/charts/perses/templates/statefulset.yaml @@ -26,10 +26,8 @@ spec: {{- end }} spec: serviceAccountName: {{ include "perses.serviceAccountName" . }} - {{- if .Values.persistence.enabled }} securityContext: {{- toYaml .Values.persistence.securityContext | nindent 8 }} - {{- end }} containers: - name: {{ .Chart.Name }} image: "{{ .Values.image.name }}:{{ .Values.image.version | default .Chart.AppVersion }}" diff --git a/charts/perses/values.yaml b/charts/perses/values.yaml index 03ac49f..12011fc 100644 --- a/charts/perses/values.yaml +++ b/charts/perses/values.yaml @@ -207,4 +207,3 @@ datasources: # kind: PrometheusDatasource # spec: # directUrl: https://prometheus.demo.do.prometheus.io - From 890b126bdd2bc1752560e3e1f784d0d479a428c7 Mon Sep 17 00:00:00 2001 From: Akshay Iyyadurai Balasundaram Date: Tue, 22 Oct 2024 12:03:42 +0200 Subject: [PATCH 5/5] [ENHANCEMENT] Refactor PVC configuration Signed-off-by: Akshay Iyyadurai Balasundaram --- charts/perses/templates/pvc.yaml | 2 ++ charts/perses/values.schema.json | 3 +-- charts/perses/values.yaml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/charts/perses/templates/pvc.yaml b/charts/perses/templates/pvc.yaml index 046ff18..658eaa4 100644 --- a/charts/perses/templates/pvc.yaml +++ b/charts/perses/templates/pvc.yaml @@ -11,7 +11,9 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: +{{- if .Values.persistence.storageClass }} storageClassName: {{ .Values.persistence.storageClass }} +{{- end }} accessModes: {{- range .Values.persistence.accessModes }} - {{ . | quote }} diff --git a/charts/perses/values.schema.json b/charts/perses/values.schema.json index a7d2005..bf2d9eb 100644 --- a/charts/perses/values.schema.json +++ b/charts/perses/values.schema.json @@ -430,8 +430,7 @@ "required": [ "accessModes", "enabled", - "size", - "storageClass" + "size" ] }, "livenessProbe": { diff --git a/charts/perses/values.yaml b/charts/perses/values.yaml index 12011fc..9df36b1 100644 --- a/charts/perses/values.yaml +++ b/charts/perses/values.yaml @@ -149,8 +149,8 @@ persistence: # -- If disabled, it will use a emptydir volume enabled: false - # -- Specify the `storageClass` used to provision the volume - storageClass: "default" + # -- Specify the `storageClass` to provision the volume for the PVC. If you don't specify a `storageClass`, a default `storageClass` will be used. + # storageClass: "" # -- PVC Access Modes for data volume accessModes: