Skip to content

Commit ba033eb

Browse files
committed
deploy: the cluster issuer is a workload issuer; --node-retention per environment
The testnets listed the GKE service account issuer under --issuer, next to the human one. A service account token therefore enrolled as a human: a 90-day session, and the token accepted at /user/*. The probe and canary cronjobs enroll a fresh identity on every run, so bananas held 19,601 admitted rows with sessions of ~2160h, none of them a member any more. Under --workload-issuer, which the Kubernetes guide already prescribes, these are 48h sessions renewed with a fresh projected token, and the control plane's node GC collects the rows of the runs that ended. --node-retention is rendered from the NODE_RETENTION environment variable (unset is the binary's 720h), so an environment that runs scale tests can set it to days and watch the sweep within the test window.
1 parent cf578fb commit ba033eb

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎.github/k8s/agentmesh-control-plane-template.yaml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,14 @@ spec:
128128
args:
129129
- "--bind-address=0.0.0.0:8080"
130130
- "--db-driver=postgres"
131-
- "--issuer=https://auth.sam-mesh.dev,https://container.googleapis.com/v1/projects/${GCP_PROJECT_ID}/locations/${CLUSTER_REGION}/clusters/${CLUSTER_NAME}"
131+
- "--issuer=https://auth.sam-mesh.dev"
132+
# The cluster's service account tokens are workload identities: a
133+
# 48h session renewed with a fresh token, no /user/* access.
134+
- "--workload-issuer=https://container.googleapis.com/v1/projects/${GCP_PROJECT_ID}/locations/${CLUSTER_REGION}/clusters/${CLUSTER_NAME}"
132135
- "--allowed-audiences=agentmesh-audience,agentmesh-control-plane-audience,sam-mesh-audience,sam-control-plane-audience"
133136
- "--auto-approve-enrollment"
134137
- "--key-grace-period=48h"
138+
- "--node-retention=${NODE_RETENTION}"
135139
resources:
136140
requests:
137141
cpu: 100m

‎.github/workflows/deploy.yaml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,10 @@ jobs:
361361
# routers per member, six routers hold 10,000 members with one
362362
# router out for a rollout.
363363
VAR_ROUTER_HIGH_WATERMARK: ${{ vars.ROUTER_HIGH_WATERMARK }}
364+
# How long the control plane keeps a lapsed or silent member's
365+
# record. Unset is the binary's default, 720h; an environment that
366+
# runs scale tests sets it to days so the sweep is observable.
367+
VAR_NODE_RETENTION: ${{ vars.NODE_RETENTION }}
364368
run: |
365369
print_rollout_diagnostics() {
366370
local namespace="$1"
@@ -395,8 +399,9 @@ jobs:
395399
export CLUSTER_NAME="${VAR_CLUSTER_NAME}"
396400
export ROUTER_REPLICAS="${VAR_ROUTER_REPLICAS:-3}"
397401
export ROUTER_HIGH_WATERMARK="${VAR_ROUTER_HIGH_WATERMARK:-6000}"
402+
export NODE_RETENTION="${VAR_NODE_RETENTION:-720h}"
398403
399-
envsubst '${ENV_NAME} ${NAMESPACE} ${GCP_PROJECT_ID} ${CLUSTER_NAME} ${CLUSTER_REGION} ${IMAGE_TAG}' < .github/k8s/agentmesh-control-plane-template.yaml | kubectl apply -f -
404+
envsubst '${ENV_NAME} ${NAMESPACE} ${GCP_PROJECT_ID} ${CLUSTER_NAME} ${CLUSTER_REGION} ${IMAGE_TAG} ${NODE_RETENTION}' < .github/k8s/agentmesh-control-plane-template.yaml | kubectl apply -f -
400405
envsubst '${ENV_NAME} ${NAMESPACE} ${GCP_PROJECT_ID} ${CLUSTER_NAME} ${CLUSTER_REGION} ${IMAGE_TAG} ${ROUTER_REPLICAS} ${ROUTER_HIGH_WATERMARK}' < .github/k8s/agentmesh-router-template.yaml | kubectl apply -f -
401406
envsubst '${ENV_NAME} ${NAMESPACE} ${GCP_PROJECT_ID} ${CLUSTER_NAME} ${CLUSTER_REGION} ${IMAGE_TAG}' < .github/k8s/agentmesh-console-template.yaml | kubectl apply -f -
402407
envsubst '${ENV_NAME} ${NAMESPACE} ${GCP_PROJECT_ID}' < .github/k8s/dns-sync-cronjob-template.yaml | kubectl apply -f -

0 commit comments

Comments
 (0)