stack-orchestrator/stack_orchestrator/deploy/k8s
A. F. Dudley 1da69cf739 fix(k8s): make deploy_k8s.py idempotent with create-or-replace semantics
All K8s resource creation in deploy_k8s.py now uses try-create, catch
ApiException(409), then replace — matching the pattern already used for
secrets in deployment_create.py. This allows `deployment start` to be
safely re-run without 409 Conflict errors.

Resources made idempotent:
- Deployment (create_namespaced_deployment → replace on 409)
- Service (create_namespaced_service → replace on 409)
- Ingress (create_namespaced_ingress → replace on 409)
- NodePort services (same as Service)
- ConfigMap (create_namespaced_config_map → replace on 409)
- PV/PVC: bare `except: pass` replaced with explicit ApiException
  catch for 404

Extracted _ensure_deployment(), _ensure_service(), _ensure_ingress(),
and _ensure_config_map() helpers to keep cyclomatic complexity in check.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 04:15:03 +00:00
..
helm 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
cluster_info.py feat(k8s): per-service resource layering in deployer 2026-03-07 10:26:10 +00:00
deploy_k8s.py fix(k8s): make deploy_k8s.py idempotent with create-or-replace semantics 2026-03-08 04:15:03 +00:00
helpers.py fix(k8s): expand etcd cleanup whitelist to preserve core cluster services 2026-03-07 17:56:13 +00:00
k8s_command.py Apply pre-commit linting fixes 2026-01-21 20:58:31 -05:00