$ kubectl --context default version Client Version: v1.33.6+k3s1 Kustomize Version: v5.6.0 Server Version: v1.33.6+k3s1 $ kubectl --context default create namespace brotli-rollout-lab namespace/brotli-rollout-lab created deployment.apps/api created deployment.apps/api-legacy created service/api created $ kubectl --context default -n brotli-rollout-lab rollout status deployment/api --timeout=180s Waiting for deployment "api" rollout to finish: 0 of 5 updated replicas are available... Waiting for deployment "api" rollout to finish: 1 of 5 updated replicas are available... Waiting for deployment "api" rollout to finish: 2 of 5 updated replicas are available... Waiting for deployment "api" rollout to finish: 3 of 5 updated replicas are available... Waiting for deployment "api" rollout to finish: 4 of 5 updated replicas are available... deployment "api" successfully rolled out $ kubectl --context default -n brotli-rollout-lab rollout status deployment/api-legacy --timeout=180s deployment "api-legacy" successfully rolled out $ kubectl --context default -n brotli-rollout-lab set image deployment/api api=node:24.22.1-alpine deployment.apps/api image updated $ kubectl --context default -n brotli-rollout-lab rollout status deployment/api --timeout=180s Waiting for deployment "api" rollout to finish: 3 out of 5 new replicas have been updated... Waiting for deployment "api" rollout to finish: 3 out of 5 new replicas have been updated... Waiting for deployment "api" rollout to finish: 3 out of 5 new replicas have been updated... Waiting for deployment "api" rollout to finish: 3 out of 5 new replicas have been updated... Waiting for deployment "api" rollout to finish: 4 out of 5 new replicas have been updated... Waiting for deployment "api" rollout to finish: 4 out of 5 new replicas have been updated... Waiting for deployment "api" rollout to finish: 2 old replicas are pending termination... Waiting for deployment "api" rollout to finish: 2 old replicas are pending termination... Waiting for deployment "api" rollout to finish: 2 old replicas are pending termination... Waiting for deployment "api" rollout to finish: 2 old replicas are pending termination... Waiting for deployment "api" rollout to finish: 1 old replicas are pending termination... deployment "api" successfully rolled out === MAIN ROLLOUT COMPLETE, LEGACY ENDPOINT STILL SELECTED === $ kubectl --context default -n brotli-rollout-lab get pods -l app=api -o custom-columns=POD:.metadata.name\,TRACK:.metadata.labels.track\,IMAGE:.spec.containers\[0\].image\,IMAGE_ID:.status.containerStatuses\[0\].imageID --sort-by=.metadata.name POD TRACK IMAGE IMAGE_ID api-5cb5f6cd9f-8kh4v main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-5cb5f6cd9f-97l7b main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-5cb5f6cd9f-bls5j main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-5cb5f6cd9f-xrmkf main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-5cb5f6cd9f-zzsj4 main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-755c6d66b4-6grl2 main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-755c6d66b4-c6xdk main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-755c6d66b4-hfb6f main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-755c6d66b4-v8nvk main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-755c6d66b4-zcfj7 main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-legacy-56f9f9cbf4-zhntw legacy node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f $ kubectl --context default -n brotli-rollout-lab get endpointslice -l kubernetes.io/service-name=api -o go-template=\{\{range\ .items\}\}\{\{range\ .endpoints\}\}\{\{if\ .conditions.ready\}\}\{\{.targetRef.name\}\}\{\{\"\\t\"\}\}\{\{index\ .addresses\ 0\}\}\{\{\"\\n\"\}\}\{\{end\}\}\{\{end\}\}\{\{end\}\} READY_ENDPOINT HTTP NODE $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.27 api-5cb5f6cd9f-8kh4v api-5cb5f6cd9f-8kh4v 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.25 api-5cb5f6cd9f-97l7b api-5cb5f6cd9f-97l7b 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.28 api-5cb5f6cd9f-bls5j api-5cb5f6cd9f-bls5j 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.29 api-5cb5f6cd9f-xrmkf api-5cb5f6cd9f-xrmkf 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.26 api-5cb5f6cd9f-zzsj4 api-5cb5f6cd9f-zzsj4 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.22 api-legacy-56f9f9cbf4-zhntw api-legacy-56f9f9cbf4-zhntw 200 v24.22.0 === UPDATE THE LEGACY DEPLOYMENT === $ kubectl --context default -n brotli-rollout-lab set image deployment/api-legacy api=node:24.22.1-alpine deployment.apps/api-legacy image updated $ kubectl --context default -n brotli-rollout-lab rollout status deployment/api-legacy --timeout=180s Waiting for deployment "api-legacy" rollout to finish: 1 old replicas are pending termination... Waiting for deployment "api-legacy" rollout to finish: 1 old replicas are pending termination... deployment "api-legacy" successfully rolled out $ kubectl --context default -n brotli-rollout-lab get pods -l app=api -o custom-columns=POD:.metadata.name\,TRACK:.metadata.labels.track\,IMAGE:.spec.containers\[0\].image\,IMAGE_ID:.status.containerStatuses\[0\].imageID --sort-by=.metadata.name POD TRACK IMAGE IMAGE_ID api-5cb5f6cd9f-8kh4v main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-5cb5f6cd9f-97l7b main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-5cb5f6cd9f-bls5j main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-5cb5f6cd9f-xrmkf main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-5cb5f6cd9f-zzsj4 main node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 api-755c6d66b4-6grl2 main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-755c6d66b4-c6xdk main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-755c6d66b4-hfb6f main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-755c6d66b4-v8nvk main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-755c6d66b4-zcfj7 main node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-legacy-56f9f9cbf4-zhntw legacy node:24.22.0-alpine docker.io/library/node@sha256:44fce696f38ba8c987c4db89954051000bbd05ffd8d8659ba15ed4a8602e937f api-legacy-85456dcd77-h8c22 legacy node:24.22.1-alpine docker.io/library/node@sha256:06d7adf3e0ef61a13f1d28682726366f97a15aa1888c934d3ecec86c33918b53 $ kubectl --context default -n brotli-rollout-lab get endpointslice -l kubernetes.io/service-name=api -o go-template=\{\{range\ .items\}\}\{\{range\ .endpoints\}\}\{\{if\ .conditions.ready\}\}\{\{.targetRef.name\}\}\{\{\"\\t\"\}\}\{\{index\ .addresses\ 0\}\}\{\{\"\\n\"\}\}\{\{end\}\}\{\{end\}\}\{\{end\}\} READY_ENDPOINT HTTP NODE $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.27 api-5cb5f6cd9f-8kh4v api-5cb5f6cd9f-8kh4v 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.25 api-5cb5f6cd9f-97l7b api-5cb5f6cd9f-97l7b 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.28 api-5cb5f6cd9f-bls5j api-5cb5f6cd9f-bls5j 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.29 api-5cb5f6cd9f-xrmkf api-5cb5f6cd9f-xrmkf 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.26 api-5cb5f6cd9f-zzsj4 api-5cb5f6cd9f-zzsj4 200 v24.22.1 $ kubectl --context default -n brotli-rollout-lab exec api-5cb5f6cd9f-8kh4v -- node -e const\ \[ip\,\ expectedPod\]\ =\ process.argv.slice\(1\)\;\ fetch\(\"http://\"\ +\ ip\ +\ \":3000/health\"\,\ \{signal:\ AbortSignal.timeout\(5000\)\}\).then\(async\ r\ =\>\ \{\ const\ body\ =\ await\ r.json\(\)\;\ if\ \(\!r.ok\ \|\|\ body.pod\ \!==\ expectedPod\)\ throw\ Error\(\"unexpected\ endpoint\ response\"\)\;\ console.log\(body.pod\ +\ \"\ \"\ +\ r.status\ +\ \"\ \"\ +\ body.node\)\;\ \}\).catch\(e\ =\>\ \{\ console.error\(e\)\;\ process.exitCode\ =\ 1\;\ \}\)\; 10.42.0.30 api-legacy-85456dcd77-h8c22 api-legacy-85456dcd77-h8c22 200 v24.22.1 Verified six ready Service endpoints with HTTP 200 and Node.js v24.22.1.