Skip to content

Agent Mesh

charts: persist the router key on a PVC

Tomas Tormo06ec53070786
diff --git a/charts/sam-mesh/templates/router-statefulset.yaml b/charts/sam-mesh/templates/router-statefulset.yaml
index 895f2a12..26b7d2f8 100644
--- a/charts/sam-mesh/templates/router-statefulset.yaml
+++ b/charts/sam-mesh/templates/router-statefulset.yaml
@@ -129,10 +129,8 @@ spec:
mountPath: /var/run/secrets/tokens
readOnly: true
{{- end }}
- volumes:
- - name: router-data
- emptyDir: {}
{{- if .Values.router.useOidcToken }}
+ volumes:
- name: sam-token
projected:
sources:
@@ -141,4 +139,12 @@ spec:
expirationSeconds: 3600
audience: "sam-control-plane-audience"
{{- end }}
+ volumeClaimTemplates:
+ - metadata:
+ name: router-data
+ spec:
+ accessModes: [ "ReadWriteOnce" ]
+ resources:
+ requests:
+ storage: {{ .Values.router.storageSize | quote }}
{{- end }}
diff --git a/charts/sam-mesh/values.yaml b/charts/sam-mesh/values.yaml
index d855ce1f..b674969a 100644
--- a/charts/sam-mesh/values.yaml
+++ b/charts/sam-mesh/values.yaml
@@ -122,6 +122,8 @@ router:
# Overrides the announced multiaddrs; derived from hostPort when left empty.
externalAddrs: []
allowLoopback: false
+ # PVC for /data/router.key, so the libp2p peer ID survives rescheduling.
+ storageSize: 1Gi
resources:
requests:
cpu: 100m