Add etcd + PKI extraMounts for offline data recovery
Some checks failed
Lint Checks / Run linter (push) Successful in 4m35s
Lint Checks / Run linter (pull_request) Successful in 7m46s
Deploy Test / Run deploy test suite (pull_request) Successful in 13m51s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Failing after 18m29s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Successful in 21m22s
Webapp Test / Run webapp test suite (pull_request) Successful in 24m48s
Smoke Test / Run basic test suite (pull_request) Successful in 25m23s
Some checks failed
Lint Checks / Run linter (push) Successful in 4m35s
Lint Checks / Run linter (pull_request) Successful in 7m46s
Deploy Test / Run deploy test suite (pull_request) Successful in 13m51s
K8s Deploy Test / Run deploy test suite on kind/k8s (pull_request) Failing after 18m29s
K8s Deployment Control Test / Run deployment control suite on kind/k8s (pull_request) Successful in 21m22s
Webapp Test / Run webapp test suite (pull_request) Successful in 24m48s
Smoke Test / Run basic test suite (pull_request) Successful in 25m23s
Mount /var/lib/etcd and /etc/kubernetes/pki to host filesystem
so cluster state is preserved for offline recovery. Each deployment
gets its own backup directory keyed by deployment ID.
Directory structure:
data/cluster-backups/{deployment_id}/etcd/
data/cluster-backups/{deployment_id}/pki/
This enables extracting secrets from etcd backups using etcdctl
with the preserved PKI certificates.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
aa88adabc1
commit
1b9204da98
@ -253,6 +253,26 @@ def _make_absolute_host_path(data_mount_path: Path, deployment_dir: Path) -> Pat
|
||||
def _generate_kind_mounts(parsed_pod_files, deployment_dir, deployment_context):
|
||||
volume_definitions = []
|
||||
volume_host_path_map = _get_host_paths_for_volumes(deployment_context)
|
||||
|
||||
# Cluster state backup for offline data recovery (unique per deployment)
|
||||
# etcd contains all k8s state; PKI certs needed to decrypt etcd offline
|
||||
deployment_id = deployment_context.id
|
||||
backup_subdir = f"cluster-backups/{deployment_id}"
|
||||
|
||||
etcd_host_path = _make_absolute_host_path(
|
||||
Path(f"./data/{backup_subdir}/etcd"), deployment_dir
|
||||
)
|
||||
volume_definitions.append(
|
||||
f" - hostPath: {etcd_host_path}\n" f" containerPath: /var/lib/etcd\n"
|
||||
)
|
||||
|
||||
pki_host_path = _make_absolute_host_path(
|
||||
Path(f"./data/{backup_subdir}/pki"), deployment_dir
|
||||
)
|
||||
volume_definitions.append(
|
||||
f" - hostPath: {pki_host_path}\n" f" containerPath: /etc/kubernetes/pki\n"
|
||||
)
|
||||
|
||||
# Note these paths are relative to the location of the pod files (at present)
|
||||
# So we need to fix up to make them correct and absolute because kind assumes
|
||||
# relative to the cwd.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user