Real Kubernetes Cluster (kubectl) Deployment and Live End-to-End Verification Suite
Source:
docs/enhancements/0015-k8s-cluster-live-e2e/README.md· Status:implemented· Area:core· Milestone:v0.3.0
- CEP Number:
0015 - Status:
implementable - Target Version:
v0.3.0 - Components:
test/k8s-e2e/k8s_e2e_test.go,deploy/k8s/cubepod-test-cluster.yaml,Makefile
1. Summary
Section titled “1. Summary”Validates CubePod end-to-end on a real multi-node Kubernetes cluster (https://192.168.1.207:6443) using kubectl, real container images pushed to hub.sensedeal.vip/library/, real nfs-storage PersistentVolumeClaims (rootfs-pvc + workspace-pvc), real initContainer binary injection (cubepod-podd injecting /opt/cubepod/bin/{podd-init,podd} into hub.sensedeal.vip/library/cubeplex-sandbox:0.8.0-260917), and live cubepod-gateway / cubepod-controller deployments running inside Kubernetes!
2. Motivation
Section titled “2. Motivation”- Build and push real multi-component container images (
hub.sensedeal.vip/library/cubepod-podd:v0.3.0,cubepod-controller:v0.3.0,cubepod-gateway:v0.3.0,cubepod-egress:v0.3.0). - Deploy CubePod (
CRDs,RBAC,cubepod-controller,cubepod-gatewayNodePort/Service) into namespacecubepod-system(managing workloads incubepod-workloads) on thekubectltest cluster. - Provide an automated Kubernetes E2E verification suite (
test/k8s-e2e/k8s_e2e_test.go&make test-k8s-e2e) that tests the live Kubernetes deployment end-to-end:- Sandbox creation -> Kubernetes schedules Pod with
initContainers: [podd-installer]injecting/opt/cubepod/bin/{podd-init,podd}intocubeplex-sandbox:0.8.0-260917(zero modifications to the base sandbox image!) and bindsrootfs-pvc+workspace-pvconnfs-storage. - Foreground & background command execution (
POST /sandboxes/{id}/commands/run), cursor log streaming, and process kill inside the real Kubernetes Pod. - File write/read/list/delete and
tar.gzarchive-syncinside the real Kubernetes Pod/workspacePVC. Pause(deletes the Kubernetes Pod while retaining the boundnfs-storagePVCs) followed by Auto-Resume (schedules a fresh Kubernetes Pod re-mounting the same PVCs and verifying/workspacefiles persisted across Pod deletion!).ResetRootFS(rotatesrootfs-pvcgeneration 1 -> 2 while verifying/workspacePVC files remain 100% intact on the Kubernetes cluster!).- Signed
/panel/{token}/reverse proxy routing into an HTTP server started inside the Kubernetes Sandbox Pod.
- Sandbox creation -> Kubernetes schedules Pod with
Non-Goals
Section titled “Non-Goals”- Modifying existing workloads in unrelated namespaces on the shared test cluster. All CubePod resources are strictly isolated to
cubepod-systemandcubepod-workloads.
3. Design Details
Section titled “3. Design Details”3.1 Cluster Deployment Manifest (deploy/k8s/cubepod-test-cluster.yaml)
Section titled “3.1 Cluster Deployment Manifest (deploy/k8s/cubepod-test-cluster.yaml)”- Defines
Namespace(cubepod-system,cubepod-workloads), CRDs (podboxes.cubepod.io,podtemplates.cubepod.io,podwarmpools.cubepod.io),ServiceAccount+ClusterRole+ClusterRoleBinding,Deployment/cubepod-controller,Deployment/cubepod-gateway, andService/cubepod-gateway.
3.2 Live Kubernetes E2E Test Suite (test/k8s-e2e/k8s_e2e_test.go)
Section titled “3.2 Live Kubernetes E2E Test Suite (test/k8s-e2e/k8s_e2e_test.go)”- Guarded by
CUBEPOD_K8S_E2E=1(ormake test-k8s-e2e) so unit tests (make test) can still run offline in environments withoutkubectl. - Connects to the live
cubepod-gateway(either in-cluster via NodePort/port-forward or against the Kubernetes API server) and verifies the actual Pods and PVCs incubepod-workloadsviakubectl get pods/pvc -n cubepod-workloads.
4. Test Plan
Section titled “4. Test Plan”- Execute
make test-k8s-e2eagainsthttps://192.168.1.207:6443and verify every lifecycle step passes with real Kubernetes Pods and PVCs.
5. Graduation Criteria & PRR
Section titled “5. Graduation Criteria & PRR”- Clean teardown of test sandbox Pods/PVCs after test completion so no orphaned pods waste cluster resources.
6. Alternatives Considered
Section titled “6. Alternatives Considered”- Kind/Minikube-only testing: Testing directly on the real multi-node
kubectlcluster (192.168.1.207:6443) validates real CNI (Calico), real StorageClass (nfs-storage), real image pulling (hub.sensedeal.vip), and real multi-node scheduling.