Skip to content

Agent Mesh

use security context

Antonio Ojea79ff15a00ee9
diff --git a/.github/k8s/sam-router-template.yaml b/.github/k8s/sam-router-template.yaml
index 7698c6c7..9a401669 100644
--- a/.github/k8s/sam-router-template.yaml
+++ b/.github/k8s/sam-router-template.yaml
@@ -40,6 +40,9 @@ spec:
app: sam-router-${ENV_NAME}
spec:
serviceAccountName: sam-router-sa
+ securityContext:
+ fsGroup: 65532
+ fsGroupChangePolicy: "Always"
containers:
- name: sam-router
image: ghcr.io/google/sam-router:${IMAGE_TAG}
diff --git a/charts/sam-mesh/templates/router-statefulset.yaml b/charts/sam-mesh/templates/router-statefulset.yaml
index 843afaf6..e7c7f168 100644
--- a/charts/sam-mesh/templates/router-statefulset.yaml
+++ b/charts/sam-mesh/templates/router-statefulset.yaml
@@ -24,6 +24,10 @@ spec:
app: {{ include "sam-mesh.fullname" . }}-router
spec:
serviceAccountName: {{ include "sam-mesh.fullname" . }}-router-sa
+ {{- with .Values.router.podSecurityContext }}
+ securityContext:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
initContainers:
- name: wait-control-plane
image: curlimages/curl:8.6.0
diff --git a/charts/sam-mesh/values.yaml b/charts/sam-mesh/values.yaml
index c7b88c4d..2f5f965b 100644
--- a/charts/sam-mesh/values.yaml
+++ b/charts/sam-mesh/values.yaml
@@ -48,6 +48,9 @@ database:
router:
enabled: true
replicaCount: 1
+ podSecurityContext:
+ fsGroup: 65532
+ fsGroupChangePolicy: "Always"
image:
repository: sam-router
useOidcToken: false