fix: resolve ServiceAccount race condition in deployment apply by Flo4604 · Pull Request #5309 · unkeyed/unkey

@Flo4604 mentioned this pull request

Mar 13, 2026

19 tasks

@Flo4604

Create the Secret and ServiceAccount before the ReplicaSet so they
exist by the time pods are scheduled. Patch ownerReferences onto them
after the RS is created so K8s still garbage-collects them. This
prevents "serviceaccount not found" errors without needing the
replicas=0 workaround.

@Flo4604 Flo4604 changed the base branch from feat/track-container-exits to graphite-base/5309

March 17, 2026 18:08

@Flo4604 Flo4604 changed the base branch from graphite-base/5309 to main

March 17, 2026 18:09

@Flo4604 Flo4604 marked this pull request as ready for review

March 17, 2026 18:11

chronark

coderabbitai[bot]

ogzhanolguncu

@Flo4604 Flo4604 deleted the fix/sa-race-condition branch

March 17, 2026 18:43