From d37dd45c1279c5746a5005fcbad721b8f07a0711 Mon Sep 17 00:00:00 2001 From: Brian Jarrett Date: Thu, 12 Nov 2026 09:47:21 -0600 Subject: [PATCH 1/2] feat(e2e,compliance): complete end-to-end verification, v0.4.0 packaging, and rolling update plan - Fix Alpine container execution with CGO_ENABLED=0 static compilation in Makefile - Synchronize zarf.yaml and deployment manifests to v0.4.0 - Add multi-modal NIST IA-5 rule to oscal-component.yaml (4/4 satisfied in Lula) - Document pre-merge CDI CRD preservation and port-forwarding in verification runbook - Add comprehensive architecture plan for golden image DataSources, persistence, and rolling updates --- Makefile | 4 +- README.md | 3 + compliance/assessment-results.yaml | 325 +++++++++++++- compliance/oscal-component.yaml | 11 +- docs/end-to-end-verification-runbook.md | 423 ++++++++++++++++++ ...lden-images-rolling-updates-persistence.md | 249 +++++++++++ manifests/operator/deployment.yaml | 2 +- zarf.yaml | 4 +- 8 files changed, 1013 insertions(+), 8 deletions(-) create mode 100644 docs/end-to-end-verification-runbook.md create mode 100644 docs/plan-golden-images-rolling-updates-persistence.md diff --git a/Makefile b/Makefile index fe04a6f..a20e2b1 100644 --- a/Makefile +++ b/Makefile @@ -15,11 +15,11 @@ build-image: build-operator build-operator: @mkdir -p bin - go build -ldflags="$(LDFLAGS)" -o bin/uds-vm-operator ./cmd/uds-vm-operator + CGO_ENABLED=0 GOOS=linux go build -ldflags="$(LDFLAGS)" -o bin/uds-vm-operator ./cmd/uds-vm-operator build-cli: @mkdir -p bin - go build -ldflags="$(LDFLAGS)" -o bin/uds-vmctl ./cmd/uds-vmctl + CGO_ENABLED=0 go build -ldflags="$(LDFLAGS)" -o bin/uds-vmctl ./cmd/uds-vmctl test: go test -v -race ./... diff --git a/README.md b/README.md index 6db679a..874da2a 100644 --- a/README.md +++ b/README.md @@ -312,3 +312,6 @@ make lula-validate make zarf-package ``` +> 📖 **Hands-On Verification Runbook:** For a complete, step-by-step testing guide to start from scratch on your `kubevirt-dev-platform` VM, execute negative hash tampering tests, deploy via Zarf, and validate Continuous ATO and Prometheus telemetry, see **[`docs/end-to-end-verification-runbook.md`](docs/end-to-end-verification-runbook.md)**. + + diff --git a/compliance/assessment-results.yaml b/compliance/assessment-results.yaml index 8d18ef6..e682237 100644 --- a/compliance/assessment-results.yaml +++ b/compliance/assessment-results.yaml @@ -2,13 +2,334 @@ assessment-results: import-ap: href: "" metadata: - last-modified: 2026-11-11T20:39:47.036603252-06:00 + last-modified: 2026-11-12T09:36:58.850159121-06:00 oscal-version: 1.1.2 published: 2026-11-11T16:28:48.438604553-06:00 remarks: Assessment Results generated from Lula title: '[System Name] Security Assessment Results (SAR)' version: 0.0.1 results: + - description: Assessment results for performing Validations with Lula version unset + findings: + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 0d3d77f0-0baa-4ec3-aade-14966c7bfdb9 + Access Enforcement - Cloud-Init Hardened Guest Security (Disabled SSH Password & Disabled Root) + related-observations: + - observation-uuid: 8c6a1f7a-4ec8-4a3a-b18a-fe228fd7dcaa + target: + status: + state: satisfied + target-id: ac-3 + type: objective-id + title: 'Validation Result - Control: ac-3' + uuid: 0382964a-b82f-4840-a2b7-b8bff9422399 + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 7b8c9d0e-1f2a-4b3c-8d5e-6f7a8b9c0d1e + Authenticator Management - Cryptographic Key-Based Auth (Linux) & High-Entropy Credentials (Windows) + related-observations: + - observation-uuid: e323e62c-29b3-4b68-9b8f-8d3356afc38c + target: + status: + state: satisfied + target-id: ia-5 + type: objective-id + title: 'Validation Result - Control: ia-5' + uuid: e812c97c-cbe2-45f8-bd85-82736f8921cd + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 3c744348-c2e7-48f1-a822-4cda54fc0845 + Boundary Protection - Default-Deny Zero-Trust Network Policy with Restricted DNS Egress + related-observations: + - observation-uuid: 859c409f-fc93-4ff8-a411-ca5d0c2df998 + target: + status: + state: satisfied + target-id: sc-7 + type: objective-id + title: 'Validation Result - Control: sc-7' + uuid: 2f896d7d-4afc-4b01-a523-34bd15418b38 + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: fe6f31c2-86f6-4f89-9b2e-b8f1fb47d4a7 + Software and Information Integrity - Cryptographic SHA-256 Upload Digest Verification (CDI PR + related-observations: + - observation-uuid: 40a7bf5d-40aa-42c4-9941-11c386030434 + target: + status: + state: satisfied + target-id: si-7 + type: objective-id + title: 'Validation Result - Control: si-7' + uuid: 91a5095f-e688-441d-ac27-4b987630ea07 + observations: + - collected: 2026-11-12T09:36:58.790120789-06:00 + description: | + [TEST]: ada6226f-8d7f-4b8c-9bea-90606455e273 - ac-3-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: 8c6a1f7a-4ec8-4a3a-b18a-fe228fd7dcaa + - collected: 2026-11-12T09:36:58.796737466-06:00 + description: | + [TEST]: a93c8860-4430-4f65-9c8f-68faaef48c77 - sc-7-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: 859c409f-fc93-4ff8-a411-ca5d0c2df998 + - collected: 2026-11-12T09:36:58.804523187-06:00 + description: | + [TEST]: 50e0667d-80d9-4a3c-9307-a2deed25ffa7 - si-7-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: 40a7bf5d-40aa-42c4-9941-11c386030434 + - collected: 2026-11-12T09:36:58.817002288-06:00 + description: | + [TEST]: 8c9d0e1f-2a3b-4c4d-9e6f-7a8b9c0d1e2f - ia-5-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: e323e62c-29b3-4b68-9b8f-8d3356afc38c + props: + - name: threshold + ns: https://docs.lula.dev/oscal/ns + value: "false" + - name: target + ns: https://docs.lula.dev/oscal/ns + value: https://github.com/usnistgov/oscal-content/blob/master/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json + reviewed-controls: + control-selections: + - description: Controls Assessed by Lula + include-controls: + - control-id: ac-3 + - control-id: ia-5 + - control-id: sc-7 + - control-id: si-7 + description: Controls validated + remarks: Validation performed may indicate full or partial satisfaction + start: 2026-11-12T09:36:58.817311313-06:00 + title: Lula Validation Result + uuid: fe5e5cda-96e8-42ae-9c73-21ef51874d36 + - description: Assessment results for performing Validations with Lula version unset + findings: + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 0d3d77f0-0baa-4ec3-aade-14966c7bfdb9 + Access Enforcement - Cloud-Init Hardened Guest Security (Disabled SSH Password & Disabled Root) + related-observations: + - observation-uuid: 8ea33abf-cf14-431c-924e-d465d5c73699 + target: + status: + state: satisfied + target-id: ac-3 + type: objective-id + title: 'Validation Result - Control: ac-3' + uuid: d3aa3a30-caa5-4974-b9c4-75e09717264c + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 7b8c9d0e-1f2a-4b3c-8d5e-6f7a8b9c0d1e + Authenticator Management - Cryptographic Key-Based Auth (Linux) & High-Entropy Credentials (Windows) + related-observations: + - observation-uuid: 5ffd2177-b256-4026-8d68-4630d7371028 + target: + status: + state: satisfied + target-id: ia-5 + type: objective-id + title: 'Validation Result - Control: ia-5' + uuid: 9054f489-c43d-4f47-baac-82f7fbc0807d + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 3c744348-c2e7-48f1-a822-4cda54fc0845 + Boundary Protection - Default-Deny Zero-Trust Network Policy with Restricted DNS Egress + related-observations: + - observation-uuid: 7c9c76f7-78ea-410a-ac80-9ae4ffb34b64 + target: + status: + state: satisfied + target-id: sc-7 + type: objective-id + title: 'Validation Result - Control: sc-7' + uuid: 9a8ab7ee-2cf4-4f10-9666-3c417fd2296d + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: fe6f31c2-86f6-4f89-9b2e-b8f1fb47d4a7 + Software and Information Integrity - Cryptographic SHA-256 Upload Digest Verification (CDI PR + related-observations: + - observation-uuid: 0a6d4313-fcfc-4357-ad6f-c193d6486998 + target: + status: + state: satisfied + target-id: si-7 + type: objective-id + title: 'Validation Result - Control: si-7' + uuid: 0de5a31f-00bf-4ce0-931f-f80fee6b8a96 + observations: + - collected: 2026-11-12T09:30:06.965861554-06:00 + description: | + [TEST]: 8c9d0e1f-2a3b-4c4d-9e6f-7a8b9c0d1e2f - ia-5-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: 5ffd2177-b256-4026-8d68-4630d7371028 + - collected: 2026-11-12T09:30:06.97863094-06:00 + description: | + [TEST]: ada6226f-8d7f-4b8c-9bea-90606455e273 - ac-3-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: 8ea33abf-cf14-431c-924e-d465d5c73699 + - collected: 2026-11-12T09:30:06.985457619-06:00 + description: | + [TEST]: a93c8860-4430-4f65-9c8f-68faaef48c77 - sc-7-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: 7c9c76f7-78ea-410a-ac80-9ae4ffb34b64 + - collected: 2026-11-12T09:30:06.994457633-06:00 + description: | + [TEST]: 50e0667d-80d9-4a3c-9307-a2deed25ffa7 - si-7-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: 0a6d4313-fcfc-4357-ad6f-c193d6486998 + props: + - name: threshold + ns: https://docs.lula.dev/oscal/ns + value: "false" + - name: target + ns: https://docs.lula.dev/oscal/ns + value: https://github.com/usnistgov/oscal-content/blob/master/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json + reviewed-controls: + control-selections: + - description: Controls Assessed by Lula + include-controls: + - control-id: ac-3 + - control-id: ia-5 + - control-id: sc-7 + - control-id: si-7 + description: Controls validated + remarks: Validation performed may indicate full or partial satisfaction + start: 2026-11-12T09:30:06.995650482-06:00 + title: Lula Validation Result + uuid: 5c6aa34e-c99b-4400-a1fc-2923d8b3e43e + - description: Assessment results for performing Validations with Lula version unset + findings: + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 0d3d77f0-0baa-4ec3-aade-14966c7bfdb9 + Access Enforcement - Cloud-Init Hardened Guest Security (Disabled SSH Password & Disabled Root) + related-observations: + - observation-uuid: fab323c4-bb43-4f8c-b538-c6c2c7124f27 + target: + status: + state: satisfied + target-id: ac-3 + type: objective-id + title: 'Validation Result - Control: ac-3' + uuid: c29b6ab6-4a52-477c-b0d9-1f855cc3e1c4 + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 7b8c9d0e-1f2a-4b3c-8d5e-6f7a8b9c0d1e + Authenticator Management - Automated High-Entropy Dynamic Credential Generation for Windows Guests + related-observations: + - observation-uuid: 8e7b0eb0-8a38-453a-807e-59a19ae521a3 + target: + status: + state: not-satisfied + target-id: ia-5 + type: objective-id + title: 'Validation Result - Control: ia-5' + uuid: d7cc2194-2e22-4aca-a1c9-4efeee1cb48d + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: 3c744348-c2e7-48f1-a822-4cda54fc0845 + Boundary Protection - Default-Deny Zero-Trust Network Policy with Restricted DNS Egress + related-observations: + - observation-uuid: 014f8dd3-b7bc-4c86-ab05-0ccae39ad4e6 + target: + status: + state: satisfied + target-id: sc-7 + type: objective-id + title: 'Validation Result - Control: sc-7' + uuid: 28422824-5ca8-474b-a151-2645f083a9ae + - description: | + Control Implementation: 0dfab2ab-cd51-480e-95d2-be764904defe / Implemented Requirement: fe6f31c2-86f6-4f89-9b2e-b8f1fb47d4a7 + Software and Information Integrity - Cryptographic SHA-256 Upload Digest Verification (CDI PR + related-observations: + - observation-uuid: fbaecc60-3a08-4bc5-9920-dff1919144c4 + target: + status: + state: satisfied + target-id: si-7 + type: objective-id + title: 'Validation Result - Control: si-7' + uuid: f1539e57-a52e-4c27-aead-169dbe01242d + observations: + - collected: 2026-11-12T08:24:28.417935814-06:00 + description: | + [TEST]: ada6226f-8d7f-4b8c-9bea-90606455e273 - ac-3-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: fab323c4-bb43-4f8c-b538-c6c2c7124f27 + - collected: 2026-11-12T08:24:28.426517485-06:00 + description: | + [TEST]: a93c8860-4430-4f65-9c8f-68faaef48c77 - sc-7-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: 014f8dd3-b7bc-4c86-ab05-0ccae39ad4e6 + - collected: 2026-11-12T08:24:28.434568579-06:00 + description: | + [TEST]: 50e0667d-80d9-4a3c-9307-a2deed25ffa7 - si-7-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: satisfied + uuid: fbaecc60-3a08-4bc5-9920-dff1919144c4 + - collected: 2026-11-12T08:24:28.446205782-06:00 + description: | + [TEST]: 8c9d0e1f-2a3b-4c4d-9e6f-7a8b9c0d1e2f - ia-5-validation + methods: + - TEST + relevant-evidence: + - description: | + Result: not-satisfied + uuid: 8e7b0eb0-8a38-453a-807e-59a19ae521a3 + props: + - name: threshold + ns: https://docs.lula.dev/oscal/ns + value: "false" + - name: target + ns: https://docs.lula.dev/oscal/ns + value: https://github.com/usnistgov/oscal-content/blob/master/nist.gov/SP800-53/rev5/json/NIST_SP-800-53_rev5_catalog.json + reviewed-controls: + control-selections: + - description: Controls Assessed by Lula + include-controls: + - control-id: ac-3 + - control-id: ia-5 + - control-id: sc-7 + - control-id: si-7 + description: Controls validated + remarks: Validation performed may indicate full or partial satisfaction + start: 2026-11-12T08:24:28.44704065-06:00 + title: Lula Validation Result + uuid: 6bf2c3bd-352e-4f78-9372-c8345294ae25 - description: Assessment results for performing Validations with Lula version v0.8.0 findings: - description: | @@ -552,4 +873,4 @@ assessment-results: start: 2026-11-11T16:28:48.438591514-06:00 title: Lula Validation Result uuid: f774f0cc-421c-4378-9270-1efa0ebc3aa1 - uuid: 5c301c56-e5ee-425f-862f-9fb738644a02 + uuid: 99ec5953-24c2-4fc4-a81a-be79d7db5c06 diff --git a/compliance/oscal-component.yaml b/compliance/oscal-component.yaml index d48550d..92ce597 100644 --- a/compliance/oscal-component.yaml +++ b/compliance/oscal-component.yaml @@ -40,7 +40,7 @@ component-definition: rel: lula - uuid: 7b8c9d0e-1f2a-4b3c-8d5e-6f7a8b9c0d1e control-id: ia-5 - description: Authenticator Management - Automated High-Entropy Dynamic Credential Generation for Windows Guests + description: Authenticator Management - Cryptographic Key-Based Auth (Linux) & High-Entropy Credentials (Windows) links: - href: '#8c9d0e1f-2a3b-4c4d-9e6f-7a8b9c0d1e2f' rel: lula @@ -157,6 +157,15 @@ component-definition: rego: | package validate + # Case 1: Linux guest enforces cryptographic key-based auth (disabled passwords) + validate { + sec := input.vm_secrets[_] + sec.metadata.name == "tactical-sensor-vm-cloudinit" + raw := base64.decode(sec.data.userdata) + contains(raw, "ssh_pwauth: false") + } + + # Case 2: Windows guest enforces >= 24-character high-entropy credentials validate { sec := input.vm_secrets[_] sec.metadata.name == "tactical-windows-vm-admin-credentials" diff --git a/docs/end-to-end-verification-runbook.md b/docs/end-to-end-verification-runbook.md new file mode 100644 index 0000000..e828503 --- /dev/null +++ b/docs/end-to-end-verification-runbook.md @@ -0,0 +1,423 @@ +# End-to-End Verification Runbook: Zero-to-Ignition Testing Guide + +This runbook provides a complete, step-by-step walkthrough to test `uds-vm-operator` from scratch using your nested `kubevirt-dev-platform` VM (`kubevirt-sandbox`) running K3s, KubeVirt, and the patched CDI build from upstream PR [#4340](https://github.com/kubevirt/containerized-data-importer/pull/4340). + +It specifically walks you through: +1. **Starting from a clean slate** on your cluster. +2. **Negative Test 1:** Zarf air-gap supply-chain rejection of a tampered golden image. +3. **Negative Test 2:** CDI PR #4340 in-cluster rejection of an image with an invalid cryptographic checksum (NIST SI-7). +4. **Positive Test:** Disk inspection, automatic `+6%` sizing, Zarf packaging, and zero-touch ignition with the correct hash. +5. **Fleet Telemetry & Power Orchestration:** Managing live VMs via `uds-vmctl`. +6. **Continuous ATO Validation:** Running Defense Unicorns Lula against live cluster resources. +7. **Prometheus Observability:** Scraping live metrics from the operator. + +--- + +## 1. Prerequisites & Cluster Connection + +All commands can be executed directly from your workstation inside `/home/bjarrett/Projects/uds-vm-operator`. + +### Export Cluster Kubeconfig +```bash +export KUBECONFIG=/home/bjarrett/Projects/kubevirt-dev-platform/kubeconfig +``` + +### Verify Cluster Connectivity & Patched CDI +Confirm that KubeVirt and the custom CDI build (PR #4340) are healthy: + +```bash +# Check node connectivity +kubectl get nodes -o wide + +# Check KubeVirt components +kubectl get pods -n kubevirt + +# Check patched CDI components (cdi-uploadserver, cdi-controller, cdi-apiserver with test image tags) +kubectl get pods -n cdi -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}' +``` + +> [!NOTE] +> **Pre-Merge Custom CDI Configuration:** +> If the cluster was initialized from standard upstream release manifests (`v1.66.1`), point the CDI deployments to the pre-loaded local `:test` images and preserve the upload checksum CRD field: +> ```bash +> # 1. Point CDI controller & apiserver to the local PR #4340 test builds +> kubectl set env deployment/cdi-operator -n cdi \ +> CONTROLLER_IMAGE=docker.io/library/cdi-controller:test \ +> APISERVER_IMAGE=docker.io/library/cdi-apiserver:test \ +> UPLOAD_SERVER_IMAGE=docker.io/library/cdi-uploadserver:test \ +> PULL_POLICY=Never +> +> # 2. Scale down cdi-operator so it does not reconcile back to stock v1.66.1 CRDs during local testing +> kubectl scale deployment -n cdi cdi-operator --replicas=0 +> +> # 3. Ensure datavolumes CRD preserves the upload checksum schema +> kubectl patch crd datavolumes.cdi.kubevirt.io --type=json -p='[ +> {"op": "add", "path": "/spec/versions/0/schema/openAPIV3Schema/properties/spec/properties/source/properties/upload/x-kubernetes-preserve-unknown-fields", "value": true} +> ]' +> ``` + +*(Optional) Direct SSH Access:* +If you ever need to inspect the sandbox VM directly: +```bash +ssh -F /home/bjarrett/Projects/kubevirt-dev-platform/.ssh/config kubevirt-sandbox +``` + +--- + +## 2. Resetting the Cluster to a Clean Slate + +Before testing, remove any existing virtual machines, data volumes, and operator deployments so you are starting from a completely clean state: + +```bash +# 1. Delete all existing UDSVirtualMachine instances +kubectl delete udsvirtualmachine --all -A --timeout=30s --ignore-not-found + +# 2. Delete existing VirtualMachines and DataVolumes in default namespace +kubectl delete vm,vmi,dv,pvc -n default --all --timeout=60s --ignore-not-found + +# 3. Delete operator deployment in uds-system if present +kubectl delete deployment -n uds-system uds-vm-operator --ignore-not-found + +# 4. Confirm clean state +kubectl get udsvm,vm,vmi,dv,pvc -n default +``` + +--- + +## 3. Step 1: Compile Operator & CLI Binaries + +Build the native Go binaries (`uds-vm-operator` and `uds-vmctl`) with embedded git commit and version metadata: + +```bash +make build +``` + +**Why this is needed:** +- `bin/uds-vm-operator`: The Kubernetes controller binary running `controller-runtime`. +- `bin/uds-vmctl`: The standalone CLI used by operators for pre-flight disk inspection, power state changes, and tabular fleet inventory without external Python or `qemu-img` dependencies. + +Verify unit tests pass with race detection: +```bash +make test +``` +*Expected: 15/15 Go unit tests passed.* + +--- + +## 4. Step 2: Negative Test 1 — Supply-Chain Tamper Detection in Zarf + +Defense Unicorns Zarf enforces cryptographic integrity at package build time. If a disk image has been modified, tampered with, or corrupted in the supply chain, Zarf aborts package creation before the air-gap bundle is ever produced. + +### 1. Intentionally Alter the Golden Image Hash +Create a corrupted copy of the golden image with altered bytes: +```bash +# Copy the clean golden image to a temporary file +cp images/tactical-linux-golden.raw /tmp/corrupted-disk.raw + +# Flip a byte at offset 512 +printf "\xFF\xFF\xFF\xFF" | dd of=/tmp/corrupted-disk.raw bs=1 seek=512 conv=notrunc +``` + +Verify that the SHA-256 hash has changed: +```bash +sha256sum /tmp/corrupted-disk.raw +# Result will NOT match e5b844cc57f57094ea4585e235f36c78c1cd222262bb89d53c94dcb4d6b3e55d +``` + +### 2. Attempt to Build a Zarf Package with the Bad Hash +Temporarily point `zarf.yaml` to the corrupted disk: +```bash +# Back up zarf.yaml +cp zarf.yaml zarf.yaml.bak + +# Substitute the source file in zarf.yaml to the corrupted image +sed -i 's|images/tactical-linux-golden.raw|/tmp/corrupted-disk.raw|g' zarf.yaml + +# Attempt to package +zarf package create . --confirm --skip-sbom +``` + +### Expected Result: +Zarf halts immediately with an error: +```text +failed to create package: shasum mismatch for /tmp/corrupted-disk.raw: expected e5b844cc57f57094ea4585e235f36c78c1cd222262bb89d53c94dcb4d6b3e55d, got +``` +**Why:** Zarf acts as the first line of defense, guaranteeing that corrupted files cannot be packaged for air-gap distribution. + +Restore the valid `zarf.yaml`: +```bash +mv zarf.yaml.bak zarf.yaml +rm -f /tmp/corrupted-disk.raw +``` + +--- + +## 5. Step 3: Negative Test 2 — CDI In-Cluster Checksum Rejection (NIST SI-7) + +Even if an attacker bypasses the packaging gate or an operator pushes a disk directly via `virtctl`, **upstream CDI PR #4340** guarantees that KubeVirt will never execute a disk whose content does not match the manifest's declared cryptographic digest. + +### 1. Apply a UDSVirtualMachine with the Wrong Hash +Create a test manifest claiming a bogus SHA-256 digest: + +```bash +cat <` | +| **Validate cATO (Lula)** | `make lula-validate` | +| **Scrape Telemetry** | `curl -s http://localhost:8080/metrics \| grep uds_vm_` | +| **Clean Slate Reset** | `kubectl delete udsvm --all -A && kubectl delete vm,dv,pvc --all -n default` | diff --git a/docs/plan-golden-images-rolling-updates-persistence.md b/docs/plan-golden-images-rolling-updates-persistence.md new file mode 100644 index 0000000..4627a96 --- /dev/null +++ b/docs/plan-golden-images-rolling-updates-persistence.md @@ -0,0 +1,249 @@ +# Implementation Plan: Golden Images, Rolling Fleet Updates & Storage Persistence + +**Author:** Antigravity / Engineering Team +**Status:** Draft / Planned +**Target Milestone:** v0.4.0 & v0.5.0 +**Repository:** [uds-vm-operator](file:///home/bjarrett/Projects/uds-vm-operator) + +--- + +## 1. Executive Summary & Goals + +This plan defines the architectural design, schema enhancements, and step-by-step test execution roadmap to transition `uds-vm-operator` from single-fixture testing to enterprise production fleet management. + +### Key Objectives: +1. **Real Production Golden Images:** Build and verify standard, air-gapped golden images for both Linux (Ubuntu 22.04 LTS / Rocky 9) and Windows Server 2022 using `uds-vmctl prep`. +2. **CDI Golden Image Caching & Fast Cloning:** Import and cryptographically verify (NIST SI-7) a golden image once as a CDI `DataSource`, then spin up multiple VMs in seconds via storage-layer Copy-on-Write (CoW) clones without re-uploading disks. +3. **Dual Workload Persistence Model:** + * **Stateless Workloads ("Cattle"):** Disposable, immutable VMs with single root disks that can be destroyed and recreated on demand. + * **Stateful Workloads ("Pets with Replaceable Engines"):** Workloads requiring persistent data preservation across operating system upgrades via decoupled secondary data volumes. +4. **Zero-Downtime Rolling Fleet Updates:** Execute coordinated rolling updates across VM pools (`maxSurge: 1`, `maxUnavailable: 0`) with readiness gates, keeping services available during OS upgrades. + +--- + +## 2. Target Architecture + +``` + ┌─────────────────────────────────────────┐ + │ CDI DataSource │ + │ (Golden OS Image: Verified SHA-256) │ + └────────────────────┬────────────────────┘ + │ + ┌───────────────────────────┴───────────────────────────┐ + │ Fast Copy-on-Write Clones │ + ▼ ▼ + ┌─────────────────────────────┐ ┌─────────────────────────────┐ + │ STATELESS FLEET │ │ STATEFUL FLEET │ + │ (Disposable OS) │ │ (Decoupled Persistent Data)│ + └──────────────┬──────────────┘ └──────────────┬──────────────┘ + │ │ + ▼ ▼ + ┌─────────────────────────────┐ ┌─────────────────────────────┐ + │ VM Instance │ │ VM Instance │ + │ ┌───────────────────────┐ │ │ ┌───────────────────────┐ │ + │ │ C: / / Root (CoW) │ │ │ │ C: / / Root (CoW) │ │ + │ │ (Ephemeral across │ │ │ │ (Swappable on upgrade)│ │ + │ │ OS upgrades) │ │ │ └───────────────────────┘ │ + │ └───────────────────────┘ │ │ ┌───────────────────────┐ │ + └─────────────────────────────┘ │ │ D: / /data (PVC) │ │ + │ │ (PERSISTENT DATA) │ │ + │ └───────────────────────┘ │ + └─────────────────────────────┘ +``` + +--- + +## 3. Storage Persistence Model + +### 3.1. Profile A: Stateless / Immutable VMs +* **Use Case:** Tactical sensor data collectors, ingress reverse proxies, ephemeral build workers, and zero-trust edge compute. +* **Storage Topology:** Single root disk created from a CDI `DataSource` clone. +* **Upgrade Behavior:** Completely disposable. When the golden image updates, old VM instances are terminated and new instances are created. Configuration is re-applied cleanly via Cloud-Init or Sysprep. + +### 3.2. Profile B: Stateful VMs with Decoupled Data Drives +* **Use Case:** Domain Controllers, SQL/PostgreSQL databases, local telemetry archives, and stateful enterprise Windows/Linux services. +* **Storage Topology:** + 1. **Root OS Drive (`rootdisk` / `C:` or `/`):** Cloned from the golden image `DataSource`. This drive contains only the operating system and base runtimes. + 2. **Data Drive (`datadisk` / `D:` or `/var/data`):** Independent, long-lived `PersistentVolumeClaim` (PVC) bound to high-performance block or filesystem storage. +* **Upgrade Behavior:** During a rolling OS upgrade: + 1. Traffic is drained / services are stopped cleanly. + 2. The persistent data PVC is detached from the old VM instance. + 3. A new VM instance with the updated golden OS image boots up. + 4. The persistent data PVC is attached to the new VM instance. + 5. The service resumes with the updated OS and intact state. + +--- + +## 4. Required Code & CRD Schema Enhancements + +### 4.1. CRD Schema Updates (`pkg/apis/uds/v1alpha1/types.go`) + +Extend `UDSVirtualMachineSpec` to support `dataSource` roots and secondary `dataDisks`: + +```go +// DataDiskSpec defines secondary persistent data disks attached to the VM. +type DataDiskSpec struct { + Name string `json:"name"` + Size string `json:"size"` // e.g. "50Gi" + StorageClassName string `json:"storageClassName,omitempty"` + Bus string `json:"bus,omitempty"` // "virtio", "scsi", "sata" + PVCName string `json:"pvcName,omitempty"` // Bind to existing persistent PVC + RetentionPolicy string `json:"retentionPolicy,omitempty"` // "Retain" or "Delete" + MountPath string `json:"mountPath,omitempty"` // Used for Linux guest formatting +} + +type DiskSpec struct { + SourceType string `json:"sourceType"` // "upload", "http", "dataSource" + DataSourceName string `json:"dataSourceName,omitempty"` // Name of CDI DataSource to clone + Format string `json:"format,omitempty"` + VirtualSizeBytes int64 `json:"virtualSizeBytes"` + Checksum string `json:"checksum"` + StorageClassName string `json:"storageClassName,omitempty"` +} + +type UDSVirtualMachineSpec struct { + CPUs int `json:"cpus,omitempty"` + Memory string `json:"memory,omitempty"` + RunStrategy string `json:"runStrategy,omitempty"` + OSType string `json:"osType,omitempty"` + WindowsProfile *WindowsProfileSpec `json:"windowsProfile,omitempty"` + Disk DiskSpec `json:"disk"` + DataDisks []DataDiskSpec `json:"dataDisks,omitempty"` // NEW: Secondary persistent drives + SecurityProfile SecurityProfileSpec `json:"securityProfile,omitempty"` +} +``` + +### 4.2. Controller Reconciler Updates (`pkg/controller/reconciler.go`) + +1. **CDI DataSource Cloning:** + * When `spec.disk.sourceType == "dataSource"`, generate the `DataVolume` with: + ```yaml + spec: + sourceRef: + kind: DataSource + name: + namespace: + ``` +2. **Secondary Data Volume Attachment:** + * Iterate over `spec.dataDisks`: + * If `pvcName` is provided, attach existing PVC directly. + * If `pvcName` is empty, generate an independent `PersistentVolumeClaim` (or `DataVolume` with `source: blank`) named `-data-`. + * Attach each disk under `spec.template.spec.domain.devices.disks` and `spec.template.spec.volumes`. + * Honor `retentionPolicy: Retain` by omitting owner references on the persistent PVC so it survives VM deletion during rolling upgrades. + +--- + +## 5. Zero-Downtime Rolling Update Architecture + +### 5.1. Introducing `UDSVirtualMachinePool` + +To orchestrate rolling updates across multiple instances without downtime, introduce a fleet CRD: `UDSVirtualMachinePool` (or wrap KubeVirt's native `VirtualMachinePool`). + +```yaml +apiVersion: uds.dev/v1alpha1 +kind: UDSVirtualMachinePool +metadata: + name: tactical-web-fleet + namespace: default +spec: + replicas: 3 + selector: + matchLabels: + app: tactical-web + strategy: + type: RollingUpdate + rollingUpdate: + maxSurge: 1 + maxUnavailable: 0 + template: + spec: + osType: linux + cpus: 2 + memory: 2Gi + runStrategy: Always + disk: + sourceType: dataSource + dataSourceName: ubuntu-2204-golden-v1 +``` + +### 5.2. Rolling Update Sequence + +``` +Time ──► + +T0: [VM-1 (v1)] [VM-2 (v1)] [VM-3 (v1)] (Stable Fleet v1, Service points to all 3) + │ │ │ +T1: [VM-1 (v1)] [VM-2 (v1)] [VM-3 (v1)] [VM-4 (v2)] (Surge +1: Clone v2 booted) + │ +T2: [VM-1 (v1)] [VM-2 (v1)] [VM-3 (v1)] [VM-4 (v2)] (Readiness Gate: QEMU-GA & Port 80 Ready) + │ │ +T3: [Drained] [VM-2 (v1)] [VM-3 (v1)] [VM-4 (v2)] (VM-1 removed from Service, ACPI stopped) + │ +T4: [VM-5 (v2)] [VM-2 (v1)] [VM-3 (v1)] [VM-4 (v2)] (Surge +1: Repeat for VM-2...) +``` + +### 5.3. Readiness Gates +A new VM replica is only considered `Ready` to accept production traffic when: +1. **QEMU Guest Agent Check:** The guest agent responds over virtio-serial with a valid IP address. +2. **Kubernetes Readiness Probe:** TCP connect or HTTP GET probe to the application port succeeds. +3. **Cloud-Init / Sysprep Status:** The zero-touch answer script completes execution without error flags. + +--- + +## 6. Step-by-Step Implementation & Testing Phases + +### Phase 1: Real Golden Image Creation & CLI Pre-Flight +1. **Download Upstream Images:** + * Linux: Ubuntu 22.04 Minimal Cloud Image (`jammy-server-cloudimg-amd64.img`) or Rocky Linux 9 GenericCloud. + * Windows: Windows Server 2022 evaluation ISO / pre-sysprepped QCOW2 with VirtIO drivers installed. +2. **Run `uds-vmctl prep`:** + * Inspect header structure, verify format (`qcow2` or `raw`), ensure image is flattened with no external backing chain. + * Stream SHA-256 digest and compute `+6%` filesystem padding. +3. **Publish CDI `DataSource`:** + * Upload golden images into a dedicated `golden-images` namespace. + * Register CDI `DataSource` objects (`ubuntu-2204-golden-v1`, `win2022-golden-v1`). + +### Phase 2: Controller & CRD Schema Enhancements +1. Update `types.go` and regenerate CRD manifests for `spec.dataDisks` and `sourceType: dataSource`. +2. Update `reconciler.go` to construct the CDI `sourceRef: { kind: DataSource }` and secondary data volume mounts. +3. Add Go unit tests in `pkg/controller/reconciler_test.go` verifying: + * Multi-disk attachment order and bus selection (`virtio` vs `sata`). + * Retention policy behavior (`Retain` vs `Delete`). + +### Phase 3: Stateless Fleet Rolling Upgrade Test +1. Deploy a 3-replica stateless Linux web service pool using `ubuntu-2204-golden-v1`. +2. Expose the pool via a Kubernetes `Service` with an HTTP readiness probe. +3. Start an external load generator (`hey` or `curl` loop in background) sending 50 req/sec. +4. Prepare `ubuntu-2204-golden-v2` (containing a software update or MOTD change). +5. Update the pool spec to target `dataSourceName: ubuntu-2204-golden-v2`. +6. **Pass Criteria:** + * All 3 VMs roll over to `v2` one by one. + * Zero HTTP 5xx errors or dropped connections recorded during the upgrade. + * `uds-vmctl inventory` reports all 3 instances running on `v2`. + +### Phase 4: Stateful VM Upgrade & Data Preservation Test +1. Deploy a stateful VM (`tactical-db-vm`) with: + * Root OS: `ubuntu-2204-golden-v1` + * Persistent Data Disk: `db-data` (10Gi, mounted at `/var/lib/data`). +2. SSH into the VM, create a verification test database / timestamp file with checksums on `/var/lib/data`. +3. Trigger an OS upgrade to `ubuntu-2204-golden-v2`. +4. Verify the operator workflow: + * Drains and shuts down old VM. + * Retains the `db-data` PVC. + * Attaches `db-data` to the newly spawned `v2` VM. +5. SSH into the new `v2` VM and verify: + * OS kernel / packages reflect `v2`. + * The test files and database on `/var/lib/data` match original checksums with zero data loss. + +--- + +## 7. Deliverables & Acceptance Checklist + +| Item | Component | Done Definition | +| :--- | :--- | :--- | +| **CRD Extension** | `pkg/apis/uds/v1alpha1` | `dataDisks` and `dataSource` fields defined and generated in CRD. | +| **Controller Logic** | `pkg/controller` | Reconciles multi-disk attachments and CDI DataSource fast clones. | +| **Golden Images** | `uds-vmctl` / CDI | Real Ubuntu 22.04 and Windows Server 2022 golden DataSources deployed. | +| **Stateless Test** | Test Suite | 3-node pool rolls with 0% dropped HTTP traffic. | +| **Stateful Test** | Test Suite | Secondary PVC survives OS swap with byte-for-byte data integrity verified. | +| **Observability** | Prometheus / Grafana | Metrics expose pool update progress (`uds_vm_pool_replicas_updated`). | diff --git a/manifests/operator/deployment.yaml b/manifests/operator/deployment.yaml index 6d7135c..355ecd1 100644 --- a/manifests/operator/deployment.yaml +++ b/manifests/operator/deployment.yaml @@ -70,7 +70,7 @@ spec: serviceAccountName: uds-vm-operator containers: - name: manager - image: ghcr.io/celttechie/uds-vm-operator:v0.3.0 + image: ghcr.io/celttechie/uds-vm-operator:v0.4.0 command: - /manager resources: diff --git a/zarf.yaml b/zarf.yaml index 35c6358..a4f4fd0 100644 --- a/zarf.yaml +++ b/zarf.yaml @@ -3,7 +3,7 @@ kind: ZarfPackageConfig metadata: name: uds-vm-operator description: "Defense Unicorns UDS Virtual Machine Operator & Air-Gap Golden Image Package" - version: "0.3.0" + version: "0.4.0" architecture: "amd64" components: @@ -24,7 +24,7 @@ components: files: - manifests/operator/deployment.yaml images: - - ghcr.io/celttechie/uds-vm-operator:v0.3.0 + - ghcr.io/celttechie/uds-vm-operator:v0.4.0 - name: golden-images required: false From 2ad46d1696d75bdbbb1b67a32a088a33ed19c81b Mon Sep 17 00:00:00 2001 From: Brian Jarrett Date: Thu, 12 Nov 2026 10:16:42 -0600 Subject: [PATCH 2/2] docs: update README and roadmap with v0.5.0 architecture proposal - Link to Milestone v0.5.0 Architecture Proposal in README and ROADMAP - Update README Zarf package deploy command to v0.4.0 - Document multi-modal NIST IA-5 compliance rule in compliance table - Refine proposal document metadata (author: Brian Jarrett, target: v0.5.0) and adopt professional systems architecture terminology --- README.md | 32 +++++++++++++++++-- ROADMAP.md | 25 +++++++++++++++ ...lden-images-rolling-updates-persistence.md | 24 +++++++------- 3 files changed, 67 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 874da2a..4014953 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ An air-gap ready reference implementation and contribution-ready Kubernetes operator declaratively managing secure, NIST 800-53 compliant virtual machines on **KubeVirt** and **Containerized Data Importer (CDI)** within [Defense Unicorns](https://defenseunicorns.com) Unicorn Delivery Service (UDS) environments. -> 📍 **Product Roadmap:** See [ROADMAP.md](ROADMAP.md) for phased capability milestones ([v0.1.0 (Core Operator)](https://github.com/celttechie/uds-vm-operator/milestone/1) $\rightarrow$ [v0.2.0 (Windows Automation)](https://github.com/celttechie/uds-vm-operator/milestone/2) $\rightarrow$ [v0.3.0 (Go CLI & Zarf)](https://github.com/celttechie/uds-vm-operator/milestone/3) $\rightarrow$ [v0.4.0 (Observability & Continuous ATO)](https://github.com/celttechie/uds-vm-operator/milestone/4)). +> 📍 **Product Roadmap:** See [ROADMAP.md](ROADMAP.md) for phased capability milestones ([v0.1.0 (Core Operator)](https://github.com/celttechie/uds-vm-operator/milestone/1) $\rightarrow$ [v0.2.0 (Windows Automation)](https://github.com/celttechie/uds-vm-operator/milestone/2) $\rightarrow$ [v0.3.0 (Go CLI & Zarf)](https://github.com/celttechie/uds-vm-operator/milestone/3) $\rightarrow$ [v0.4.0 (Observability & Continuous ATO)](https://github.com/celttechie/uds-vm-operator/milestone/4) $\rightarrow$ [v0.5.0 Architecture Proposal (Golden Images, Rolling Updates & Persistence)](docs/plan-golden-images-rolling-updates-persistence.md)). --- @@ -242,7 +242,7 @@ The operator and pre-validated golden images are bundled into an offline, crypto make zarf-package # Deploy into an air-gapped or disconnected Kubernetes cluster in one command: -zarf package deploy zarf-package-uds-vm-operator-amd64-0.3.0.tar.zst --confirm +zarf package deploy zarf-package-uds-vm-operator-amd64-0.4.0.tar.zst --confirm ``` --- @@ -279,7 +279,7 @@ sc-7 | satisfied | **SC-7** | Boundary Protection | `NetworkPolicy` default-deny ingress & egress restricted to DNS (53) | **Satisfied** | | **AC-3** | Access Enforcement | Cloud-Init `Secret` enforces `ssh_pwauth: false` and `disable_root: true` | **Satisfied** | | **SI-7** | Information Integrity | CDI `DataVolume` enforces SHA-256 digest verification (PR #4340) | **Satisfied** | -| **IA-5** | Authenticator Management | Windows Sysprep `Secret` enforces dynamic $\ge 24$-char high-entropy password | **Satisfied** | +| **IA-5** | Authenticator Management | Linux Cloud-Init enforces key-based auth (`ssh_pwauth: false`) / Windows Sysprep enforces dynamic $\ge 24$-char high-entropy password | **Satisfied** | --- @@ -314,4 +314,30 @@ make zarf-package > 📖 **Hands-On Verification Runbook:** For a complete, step-by-step testing guide to start from scratch on your `kubevirt-dev-platform` VM, execute negative hash tampering tests, deploy via Zarf, and validate Continuous ATO and Prometheus telemetry, see **[`docs/end-to-end-verification-runbook.md`](docs/end-to-end-verification-runbook.md)**. +--- + +## 13. Next Architecture Phase: Golden Images, Rolling Fleet Updates & Storage Persistence (Milestone v0.5.0) + +With single-instance air-gap lifecycle verification, Continuous ATO, and Prometheus telemetry fully validated in `v0.4.0`, the operator's next evolution transitions from individual VM orchestration to automated enterprise fleet management. + +The complete architectural proposal, CRD schemas, and verification matrix are detailed in **[`docs/plan-golden-images-rolling-updates-persistence.md`](docs/plan-golden-images-rolling-updates-persistence.md)**. + +### Architectural Pillars of Milestone v0.5.0: + +1. **Production Golden OS Images:** + - Standardized, minimal Ubuntu 22.04 LTS / Rocky Linux 9 and Windows Server 2022 golden images. + - Pre-flight binary inspection and SHA-256 digest validation natively via `uds-vmctl prep`. +2. **Centralized Image Caching & Copy-on-Write (CoW) Fast Cloning:** + - Ingestion and cryptographic verification (NIST SP 800-53 SI-7) executed once into cluster storage via Containerized Data Importer (CDI) `DataSource` objects. + - Child virtual machines instantiate in seconds via storage-layer CoW clones without redundant network or disk transfers. +3. **Dual Storage Topology (Stateless vs. Stateful Workloads):** + - **Stateless Fleets:** Disposable, immutable virtual machines where the root operating system disk is replaced or destroyed on demand. + - **Stateful Workloads:** Mission-critical services (databases, directory services) where application data is strictly preserved across operating system updates via decoupled secondary `dataDisks` bound to independent, retained PVCs. +4. **Zero-Downtime Rolling Fleet Updates:** + - Introduction of `UDSVirtualMachinePool` orchestrating coordinated rolling updates across VM instances (`maxSurge: 1`, `maxUnavailable: 0`). + - Guest readiness verification governed by QEMU Guest Agent health, application port probes, and answer-script completion before traffic cutover. + +For full architectural diagrams, implementation phases, and test scenarios, review the [Architecture Proposal Document](docs/plan-golden-images-rolling-updates-persistence.md). + + diff --git a/ROADMAP.md b/ROADMAP.md index c49f4d0..da0ebe3 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -15,6 +15,8 @@ gantt v0.2.0 Windows VM Automation & STIG :done, 2026-11-11, 2026-11-11 v0.3.0 Go CLI (uds-vmctl) & Zarf Pkg :done, 2026-11-11, 2026-11-11 v0.4.0 Lula cATO & Prometheus Metrics :done, 2026-11-11, 2026-11-11 + section Planned + v0.5.0 Golden Images, Fleet Updates & Persistence :active, 2026-11-12, 2026-11-30 ``` --- @@ -87,3 +89,26 @@ Bridge the gap between Kubernetes orchestration and federal authorization by imp - **Enterprise CI/CD Integration (`.github/workflows/ci.yaml`):** - Full Go static analysis, race-detected testing, and automated Lula OSCAL compliance verification. +--- + +## [Milestone v0.5.0](docs/plan-golden-images-rolling-updates-persistence.md) — Golden Image Caching, Fleet Updates & Storage Persistence (PLANNED) + +### Objective: +Transition the operator from single-instance validation to automated enterprise fleet management, enabling zero-downtime rolling updates, centralized golden image caching via CDI `DataSource` objects, and stateful storage persistence. + +Detailed architectural specifications, CRD schemas, and testing runbooks are maintained in the [Architecture Proposal Document](docs/plan-golden-images-rolling-updates-persistence.md). + +### Planned Capabilities: +- **Standardized Golden Images:** + - Build and pre-flight verify minimal Ubuntu 22.04 LTS / Rocky Linux 9 and Windows Server 2022 golden disk images using native `uds-vmctl prep`. +- **Centralized Image Caching & Fast Copy-on-Write (CoW) Cloning:** + - Import and cryptographically verify (NIST SP 800-53 SI-7) golden images once into cluster storage via Containerized Data Importer (CDI) `DataSource` objects. + - Instantiate new VM instances in seconds via storage-layer CoW clones without repeated network transfer. +- **Dual Storage Topology (Stateless vs. Stateful Workloads):** + - *Stateless Fleets:* Disposable, immutable virtual machines where the root operating system disk is replaced or destroyed on demand. + - *Stateful Workloads:* Mission-critical services (databases, directory services) where application data is strictly preserved across operating system updates via decoupled secondary `dataDisks` bound to independent, retained PVCs. +- **Zero-Downtime Rolling Fleet Updates:** + - Introduce `UDSVirtualMachinePool` to orchestrate coordinated rolling updates across VM instances (`maxSurge: 1`, `maxUnavailable: 0`). + - Enforce guest readiness verification (QEMU Guest Agent health, application port probes, and answer-script completion) before traffic cutover. + + diff --git a/docs/plan-golden-images-rolling-updates-persistence.md b/docs/plan-golden-images-rolling-updates-persistence.md index 4627a96..b086261 100644 --- a/docs/plan-golden-images-rolling-updates-persistence.md +++ b/docs/plan-golden-images-rolling-updates-persistence.md @@ -1,23 +1,25 @@ -# Implementation Plan: Golden Images, Rolling Fleet Updates & Storage Persistence +# Architecture Proposal: Golden Images, Rolling Fleet Updates & Storage Persistence -**Author:** Antigravity / Engineering Team -**Status:** Draft / Planned -**Target Milestone:** v0.4.0 & v0.5.0 +**Author:** Brian Jarrett +**Status:** Proposed +**Target Release:** v0.5.0 **Repository:** [uds-vm-operator](file:///home/bjarrett/Projects/uds-vm-operator) --- ## 1. Executive Summary & Goals -This plan defines the architectural design, schema enhancements, and step-by-step test execution roadmap to transition `uds-vm-operator` from single-fixture testing to enterprise production fleet management. +This document outlines the architectural enhancements required to transition `uds-vm-operator` from single-instance validation to automated, production-grade fleet management. + +The primary objective is to allow mission operators to deploy and update fleets of virtual machines seamlessly, ensuring continuous service availability while maintaining strict data integrity and DoD compliance. ### Key Objectives: -1. **Real Production Golden Images:** Build and verify standard, air-gapped golden images for both Linux (Ubuntu 22.04 LTS / Rocky 9) and Windows Server 2022 using `uds-vmctl prep`. -2. **CDI Golden Image Caching & Fast Cloning:** Import and cryptographically verify (NIST SI-7) a golden image once as a CDI `DataSource`, then spin up multiple VMs in seconds via storage-layer Copy-on-Write (CoW) clones without re-uploading disks. -3. **Dual Workload Persistence Model:** - * **Stateless Workloads ("Cattle"):** Disposable, immutable VMs with single root disks that can be destroyed and recreated on demand. - * **Stateful Workloads ("Pets with Replaceable Engines"):** Workloads requiring persistent data preservation across operating system upgrades via decoupled secondary data volumes. -4. **Zero-Downtime Rolling Fleet Updates:** Execute coordinated rolling updates across VM pools (`maxSurge: 1`, `maxUnavailable: 0`) with readiness gates, keeping services available during OS upgrades. +1. **Production Golden Images:** Build, inspect, and verify standardized, air-gapped golden images for both Linux (Ubuntu 22.04 LTS / Rocky 9) and Windows Server 2022 using the native `uds-vmctl prep` utility. +2. **Centralized Image Caching & Fast Cloning:** Import and cryptographically verify (NIST SP 800-53 SI-7) golden images once into cluster storage via Containerized Data Importer (CDI) `DataSource` objects. Subsequent virtual machines instantiate in seconds using storage-layer Copy-on-Write (CoW) clones without re-uploading large disk images. +3. **Dual Storage Architecture:** + * **Stateless Workloads:** Disposable, immutable virtual machines where the operating system and runtimes can be replaced or destroyed on demand. + * **Stateful Workloads:** Mission-critical services (such as databases and directory services) where application data is strictly preserved across operating system updates via decoupled secondary storage volumes. +4. **Zero-Downtime Rolling Updates:** Orchestrate coordinated, automated rolling updates across VM pools (`maxSurge: 1`, `maxUnavailable: 0`) governed by guest readiness probes, preventing service outages during OS upgrades and kernel patching. ---