stack-orchestrator/stack_orchestrator/deploy
Prathamesh Musale 2535e6a3ef so-o2o: replace etcd-level backup with kubectl caddy cert backup
Remove the etcd+PKI persistence and whitelist-cleanup machinery. Replace
with a CronJob that dumps manager=caddy Secrets to a hostPath under
{kind-mount-root}/caddy-cert-backup/ every 5 minutes, and a Python
restore step that applies the file before the Caddy Deployment starts on
a fresh cluster.

Key changes:
- New components/ingress/caddy-cert-backup.yaml: SA/Role/RoleBinding +
  CronJob pinned to the control-plane node. Atomic write via tmp+rename.
- helpers.py:
  - Delete _get_etcd_host_path_from_kind_config, _clean_etcd_keeping_certs,
    _capture_etcd_image, _read_etcd_image_ref, _etcd_image_ref_path, and
    the etcd+PKI block in _generate_kind_mounts
  - Simplify create_cluster (no pre-cleanup, no post-capture)
  - install_ingress_for_kind splits YAML apply into 3 phases: namespace +
    RBAC + CM + Service + IngressClass → restore caddy secrets → Caddy
    Deployment → install backup CronJob. Caddy pod can't exist until
    phase 3, so certs are always in place before startup.
- deploy_k8s.py: thread kind_mount_root into install_ingress_for_kind.

Feature only active when kind-mount-root is set in the spec. No new spec
keys. Backup survives kind delete via the existing /srv/kind mount point.

Net: -139 LoC in helpers.py (removes docker-in-docker shell-in-Python),
+100 LoC of YAML, +90 LoC of straightforward Python.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 08:48:10 +00:00
..
compose so-l2l: in-place stop/restart via label-scoped cleanup (#743) 2026-04-16 12:10:04 +05:30
k8s so-o2o: replace etcd-level backup with kubectl caddy cert backup 2026-04-17 08:48:10 +00:00
webapp Merge wd-a7b: cluster-id/namespace naming, jobs, multi-cert, secrets 2026-04-01 18:22:07 +00:00
__init__.py Rename app -> stack_orchestrator (#625) 2023-11-07 00:06:55 -07:00
deploy.py so-l2l: in-place stop/restart via label-scoped cleanup (#743) 2026-04-16 12:10:04 +05:30
deploy_types.py Add Job and secrets support for k8s-kind deployments (#995) 2026-03-11 03:56:21 +00:00
deploy_util.py Fix pyright type errors across codebase 2026-01-22 01:10:36 -05:00
deployer.py so-l2l: in-place stop/restart via label-scoped cleanup (#743) 2026-04-16 12:10:04 +05:30
deployer_factory.py Add Job and secrets support for k8s-kind deployments (#995) 2026-03-11 03:56:21 +00:00
deployment.py so-l2l: in-place stop/restart via label-scoped cleanup (#743) 2026-04-16 12:10:04 +05:30
deployment_context.py Merge origin/main into multi-port-service 2026-01-24 16:48:11 -05:00
deployment_create.py Fix Kind port mappings and configmap source path resolution (#742) 2026-04-14 17:33:47 +05:30
dns_probe.py feat(deploy): add deployment restart command 2026-02-03 17:15:19 -05:00
images.py Apply pre-commit linting fixes 2026-01-21 20:58:31 -05:00
spec.py Add ip mode to external-services for static IP endpoints (#740) 2026-04-02 17:53:23 +05:30
stack.py Apply pre-commit linting fixes 2026-01-21 20:58:31 -05:00
stack_state.py Rename app -> stack_orchestrator (#625) 2023-11-07 00:06:55 -07:00