stack-orchestrator/stack_orchestrator
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
..
build Apply pre-commit linting fixes 2026-01-21 20:58:31 -05:00
data so-o2o: replace etcd-level backup with kubectl caddy cert backup 2026-04-17 08:48:10 +00:00
deploy so-o2o: replace etcd-level backup with kubectl caddy cert backup 2026-04-17 08:48:10 +00:00
repos Fix pyright type errors across codebase 2026-01-22 01:10:36 -05:00
__init__.py Rename app -> stack_orchestrator (#625) 2023-11-07 00:06:55 -07:00
__main__.py Rename app -> stack_orchestrator (#625) 2023-11-07 00:06:55 -07:00
base.py Fix pyright type errors across codebase 2026-01-22 01:10:36 -05:00
command_types.py Rename app -> stack_orchestrator (#625) 2023-11-07 00:06:55 -07:00
constants.py Merge wd-a7b: cluster-id/namespace naming, jobs, multi-cert, secrets 2026-04-01 18:22:07 +00:00
ids.py fix: black formatting, line length, pyright type narrowing 2026-04-02 05:22:25 +00:00
main.py Apply pre-commit linting fixes 2026-01-21 20:58:31 -05:00
opts.py Fix pyright type errors across codebase 2026-01-22 01:10:36 -05:00
update.py Apply pre-commit linting fixes 2026-01-21 20:58:31 -05:00
util.py Add Job and secrets support for k8s-kind deployments (#995) 2026-03-11 03:56:21 +00:00
version.py Apply pre-commit linting fixes 2026-01-21 20:58:31 -05:00