SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
Add ability to configure security context for the different components (#5600)
Johnny Cederholm8c59348d2824
diff --git a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml b/k8s/charts/seaweedfs/templates/filer-statefulset.yamlindex 30f2da5370..d83d3a639b 100644--- a/k8s/charts/seaweedfs/templates/filer-statefulset.yaml+++ b/k8s/charts/seaweedfs/templates/filer-statefulset.yaml@@ -62,6 +62,9 @@ spec:initContainers:{{ tpl .Values.filer.initContainers . | nindent 8 | trim }}{{- end }}+ {{- if .Values.filer.podSecurityContext.enabled }}+ securityContext: {{- omit .Values.filer.podSecurityContext "enabled" | toYaml | nindent 8 }}+ {{- end }}containers:- name: seaweedfsimage: {{ template "filer.image" . }}@@ -264,6 +267,9 @@ spec:resources:{{ tpl .Values.filer.resources . | nindent 12 | trim }}{{- end }}+ {{- if .Values.filer.containerSecurityContext.enabled }}+ securityContext: {{- omit .Values.filer.containerSecurityContext "enabled" | toYaml | nindent 12 }}+ {{- end }}{{- if .Values.filer.sidecars }}{{- include "common.tplvalues.render" (dict "value" .Values.filer.sidecars "context" $) | nindent 8 }}{{- end }}diff --git a/k8s/charts/seaweedfs/templates/master-statefulset.yaml b/k8s/charts/seaweedfs/templates/master-statefulset.yamlindex 61252c5a3d..1f196fb9cf 100644--- a/k8s/charts/seaweedfs/templates/master-statefulset.yaml+++ b/k8s/charts/seaweedfs/templates/master-statefulset.yaml@@ -61,6 +61,9 @@ spec:initContainers:{{ tpl .Values.master.initContainers . | nindent 8 | trim }}{{- end }}+ {{- if .Values.master.podSecurityContext.enabled }}+ securityContext: {{- omit .Values.master.podSecurityContext "enabled" | toYaml | nindent 8 }}+ {{- end }}containers:- name: seaweedfsimage: {{ template "master.image" . }}@@ -222,6 +225,9 @@ spec:resources:{{ tpl .Values.master.resources . | nindent 12 | trim }}{{- end }}+ {{- if .Values.master.containerSecurityContext.enabled }}+ securityContext: {{- omit .Values.master.containerSecurityContext "enabled" | toYaml | nindent 12 }}+ {{- end }}{{- if .Values.master.sidecars }}{{- include "common.tplvalues.render" (dict "value" .Values.master.sidecars "context" $) | nindent 8 }}{{- end }}diff --git a/k8s/charts/seaweedfs/templates/post-install-bucket-hook.yaml b/k8s/charts/seaweedfs/templates/post-install-bucket-hook.yamlindex d9f7e6bcf2..2260bd84a2 100644--- a/k8s/charts/seaweedfs/templates/post-install-bucket-hook.yaml+++ b/k8s/charts/seaweedfs/templates/post-install-bucket-hook.yaml@@ -22,6 +22,9 @@ spec:app.kubernetes.io/instance: {{ .Release.Name | quote }}spec:restartPolicy: Never+ {{- if .Values.filer.podSecurityContext.enabled }}+ securityContext: {{- omit .Values.filer.podSecurityContext "enabled" | toYaml | nindent 8 }}+ {{- end }}containers:- name: post-install-jobimage: {{ template "master.image" . }}@@ -80,6 +83,9 @@ spec:{{- end }}- containerPort: {{ .Values.master.grpcPort }}#name: swfs-master-grpc+ {{- if .Values.filer.containerSecurityContext.enabled }}+ securityContext: {{- omit .Values.filer.containerSecurityContext "enabled" | toYaml | nindent 12 }}+ {{- end }}{{- if .Values.filer.s3.enableAuth }}volumes:- name: config-usersdiff --git a/k8s/charts/seaweedfs/templates/s3-deployment.yaml b/k8s/charts/seaweedfs/templates/s3-deployment.yamlindex 2882e863e3..7a02524a0c 100644--- a/k8s/charts/seaweedfs/templates/s3-deployment.yaml+++ b/k8s/charts/seaweedfs/templates/s3-deployment.yaml@@ -50,6 +50,9 @@ spec:initContainers:{{ tpl .Values.s3.initContainers . | nindent 8 | trim }}{{- end }}+ {{- if .Values.s3.podSecurityContext.enabled }}+ securityContext: {{- omit .Values.s3.podSecurityContext "enabled" | toYaml | nindent 8 }}+ {{- end }}containers:- name: seaweedfsimage: {{ template "s3.image" . }}@@ -199,6 +202,9 @@ spec:resources:{{ tpl .Values.s3.resources . | nindent 12 | trim }}{{- end }}+ {{- if .Values.s3.containerSecurityContext.enabled }}+ securityContext: {{- omit .Values.s3.containerSecurityContext "enabled" | toYaml | nindent 12 }}+ {{- end }}{{- if .Values.s3.sidecars }}{{- include "common.tplvalues.render" (dict "value" .Values.s3.sidecars "context" $) | nindent 8 }}{{- end }}diff --git a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml b/k8s/charts/seaweedfs/templates/volume-statefulset.yamlindex 688b4cb165..b691f3045b 100644--- a/k8s/charts/seaweedfs/templates/volume-statefulset.yaml+++ b/k8s/charts/seaweedfs/templates/volume-statefulset.yaml@@ -72,6 +72,9 @@ spec:{{ tpl .Values.volume.initContainers . | nindent 8 | trim }}{{- end }}{{- end }}+ {{- if .Values.volume.podSecurityContext.enabled }}+ securityContext: {{- omit .Values.volume.podSecurityContext "enabled" | toYaml | nindent 8 }}+ {{- end }}containers:- name: seaweedfsimage: {{ template "volume.image" . }}@@ -237,6 +240,9 @@ spec:resources:{{ tpl .Values.volume.resources . | nindent 12 | trim }}{{- end }}+ {{- if .Values.volume.containerSecurityContext.enabled }}+ securityContext: {{- omit .Values.volume.containerSecurityContext "enabled" | toYaml | nindent 12 }}+ {{- end }}{{- if .Values.volume.sidecars }}{{- include "common.tplvalues.render" (dict "value" .Values.volume.sidecars "context" $) | nindent 8 }}{{- end }}diff --git a/k8s/charts/seaweedfs/values.yaml b/k8s/charts/seaweedfs/values.yamlindex 576b7da228..8962e8d343 100644--- a/k8s/charts/seaweedfs/values.yaml+++ b/k8s/charts/seaweedfs/values.yaml@@ -167,6 +167,25 @@ master:# ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/serviceAccountName: ""+ # Configure security context for Pod+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/+ # Example:+ # podSecurityContext:+ # enabled: true+ # runAsUser: 1000+ # runAsGroup: 3000+ # fsGroup: 2000+ podSecurityContext: {}++ # Configure security context for Container+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/+ # Example:+ # containerSecurityContext:+ # enabled: true+ # runAsUser: 2000+ # allowPrivilegeEscalation: false+ containerSecurityContext: {}+ingress:enabled: falseclassName: "nginx"@@ -378,6 +397,25 @@ volume:extraEnvironmentVars:+ # Configure security context for Pod+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/+ # Example:+ # podSecurityContext:+ # enabled: true+ # runAsUser: 1000+ # runAsGroup: 3000+ # fsGroup: 2000+ podSecurityContext: {}++ # Configure security context for Container+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/+ # Example:+ # containerSecurityContext:+ # enabled: true+ # runAsUser: 2000+ # allowPrivilegeEscalation: false+ containerSecurityContext: {}+# used to configure livenessProbe on volume-server containers#livenessProbe:@@ -536,6 +574,25 @@ filer:# ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/serviceAccountName: ""+ # Configure security context for Pod+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/+ # Example:+ # podSecurityContext:+ # enabled: true+ # runAsUser: 1000+ # runAsGroup: 3000+ # fsGroup: 2000+ podSecurityContext: {}++ # Configure security context for Container+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/+ # Example:+ # containerSecurityContext:+ # enabled: true+ # runAsUser: 2000+ # allowPrivilegeEscalation: false+ containerSecurityContext: {}+ingress:enabled: falseclassName: "nginx"@@ -707,6 +764,25 @@ s3:# ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/serviceAccountName: ""+ # Configure security context for Pod+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/+ # Example:+ # podSecurityContext:+ # enabled: true+ # runAsUser: 1000+ # runAsGroup: 3000+ # fsGroup: 2000+ podSecurityContext: {}++ # Configure security context for Container+ # ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/+ # Example:+ # containerSecurityContext:+ # enabled: true+ # runAsUser: 2000+ # allowPrivilegeEscalation: false+ containerSecurityContext: {}+logs:type: "hostPath"size: ""