Skip to content

Agent Mesh

deploy, chart: hold a router rollout 90s between pods

Antonio Ojea11a4dab82c86
diff --git a/.github/k8s/sam-router-template.yaml b/.github/k8s/sam-router-template.yaml
index 3f916732..42aea534 100644
--- a/.github/k8s/sam-router-template.yaml
+++ b/.github/k8s/sam-router-template.yaml
@@ -31,6 +31,13 @@ metadata:
spec:
serviceName: "sam-router-${ENV_NAME}"
replicas: 3
+ # A router that is ready has not been re-handshaken by anyone yet: members
+ # redial a dropped router with a backoff that reaches a minute, and older
+ # members only on their monitor interval of one minute. A rollout that
+ # takes the next router sooner takes every session a member has before
+ # any is back. The first rollout under the soak fleet did exactly that in
+ # 45 seconds.
+ minReadySeconds: 90
selector:
matchLabels:
app: sam-router-${ENV_NAME}
diff --git a/charts/sam-mesh/templates/router-statefulset.yaml b/charts/sam-mesh/templates/router-statefulset.yaml
index 532fda1d..023ca70e 100644
--- a/charts/sam-mesh/templates/router-statefulset.yaml
+++ b/charts/sam-mesh/templates/router-statefulset.yaml
@@ -15,6 +15,7 @@ metadata:
spec:
serviceName: {{ include "sam-mesh.fullname" . }}-router
replicas: {{ .Values.router.replicaCount }}
+ minReadySeconds: {{ .Values.router.minReadySeconds }}
selector:
matchLabels:
app: {{ include "sam-mesh.fullname" . }}-router
diff --git a/charts/sam-mesh/values.yaml b/charts/sam-mesh/values.yaml
index e2bdce13..bcf52f9d 100644
--- a/charts/sam-mesh/values.yaml
+++ b/charts/sam-mesh/values.yaml
@@ -123,6 +123,11 @@ database:
router:
enabled: true
replicaCount: 1
+ # Seconds a new router must be ready before the rollout moves to the next
+ # one. Members redial a dropped router with a backoff that reaches a
+ # minute; a rollout faster than that takes every router a member has
+ # before any is back.
+ minReadySeconds: 90
podSecurityContext:
runAsNonRoot: true
# Dockerfiles say "USER nonroot" by name; runAsNonRoot needs the numeric uid.