Skip to content

Commit e58e544

Browse files
Flo4604chronark
andauthored
feat: decrypt secrets at deploy time and create K8s Secrets directly (#5233)
* feat: decrypt secrets at deploy time and create K8s Secrets directly Replace the Preflight webhook + Inject binary secret injection pipeline with direct K8s Secret creation at deploy time. Krane now: - Decrypts encrypted env vars via Vault during ApplyDeployment - Creates a K8s Secret per deployment with plaintext env vars - Mounts secrets via envFrom.secretRef (resolved by kubelet) - Creates per-deployment RBAC (ServiceAccount + Role + RoleBinding) - Creates a dockerconfigjson pull secret per namespace for Depot auth - Sets AutomountServiceAccountToken: false on all customer pods - Drops the Command field (image ENTRYPOINT/CMD runs natively) - Removes the Inject label (webhook no longer needed) - Cleans up Secret/SA/Role/RoleBinding on deployment deletion The legacy SecretsService RPC is kept temporarily for backwards compat. * cleanup: remove preflight, inject, and secrets provider (#5235) Delete the entire preflight mutating webhook service, the inject binary (PID 1 sidecar), and the secrets provider package. These are replaced by Krane's deploy-time secret decryption and direct K8s Secret creation. Removed: - svc/preflight/ (webhook, mutator, registry credentials, cleanup loop) - cmd/preflight/ (CLI command) - cmd/inject/ (sidecar binary + Dockerfile) - pkg/secrets/provider/ (KraneVaultProvider, only used by inject) - dev/ local setup (Tiltfile, manifests, Dockerfile.inject) - .github/workflows/release_inject.yaml - docs/engineering/architecture/services/preflight/ Updated: - dev/k8s/manifests/rbac.yaml (new RBAC for secrets/SA/roles) - dev/k8s/manifests/cilium-policies.yaml (removed customer→krane policy) - dev/k8s/manifests/vector-logs.yaml (updated comment) - .goreleaser.yaml (removed inject tag ignore) * cleanup * fix rabbit comments * fix rabbit comments * fix rabbit comments --------- Co-authored-by: Andreas Thomas <dev@chronark.com>
1 parent 739b9c9 commit e58e544

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+443
-3617
lines changed

.github/workflows/release_inject.yaml

Lines changed: 0 additions & 56 deletions
This file was deleted.

.goreleaser.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ version: 2
1111
partial:
1212
by: goos
1313

14-
git:
15-
ignore_tags:
16-
- "inject/*"
17-
1814
before:
1915
hooks:
2016
# You may remove this if you don't use go modules.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ clean-docker-test: ## Clean up dangling test containers
102102

103103
.PHONY: tunnel
104104
tunnel: ## Forward ports 80/443 to frontline for *.unkey.local (run in separate terminal)
105-
@sudo kubectl port-forward -n unkey svc/frontline 443:443 80:80
105+
@sudo -v && while true; do sudo kubectl port-forward -n unkey svc/frontline 443:443 80:80 2>/dev/null; echo "port-forward exited, reconnecting..."; sudo -v; sleep 1; done
106106

107107
.PHONY: dev
108108
dev: ## Start dev environment

buf.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: v2
22

33
modules:
44
- path: svc/ctrl/proto
5-
- path: svc/krane/proto
65
- path: svc/vault/proto
76
- path: proto
87
deps:

cmd/inject/.goreleaser.yaml

Lines changed: 0 additions & 64 deletions
This file was deleted.

cmd/inject/BUILD.bazel

Lines changed: 0 additions & 27 deletions
This file was deleted.

cmd/inject/Dockerfile.release

Lines changed: 0 additions & 4 deletions
This file was deleted.

cmd/inject/command.go

Lines changed: 0 additions & 54 deletions
This file was deleted.

cmd/inject/config.go

Lines changed: 0 additions & 55 deletions
This file was deleted.

cmd/inject/main.go

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)