From 65c25067eca2c75cdf6f2df05dfbe23d189e8f0b Mon Sep 17 00:00:00 2001 From: Gandalf the Greybeard Date: Sat, 21 Mar 2026 20:43:25 +0000 Subject: [PATCH] fix: replace Helm-based E2E deploy with kubectl apply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Helm chart deployment was consistently failing — the pod enters CrashLoopBackOff despite identical kubectl manifests working. The Helm chart also silently ignored extraVolumes/extraVolumeMounts (pnpm-style keys not supported by the chart), meaning the plugin ConfigMap was never actually mounted even when deploy appeared to succeed. Replace with direct kubectl apply using a bash heredoc to render the manifest with shell variable substitution. This removes the Helm dependency, fixes the plugin volume mount, and uses the exact configuration that was proven to work in the cluster. Also adds explicit initialDelaySeconds/failureThreshold on readiness and liveness probes to give Headlamp adequate startup time. Note: .github/workflows/e2e.yaml still has a Setup Helm step that is now unused — assigned to Hugh Hackman to remove. Co-Authored-By: Paperclip --- deployment/headlamp-e2e-values.yaml | 34 --------- scripts/deploy-e2e-headlamp.sh | 110 +++++++++++++++++++++++----- scripts/teardown-e2e-headlamp.sh | 10 ++- 3 files changed, 99 insertions(+), 55 deletions(-) delete mode 100644 deployment/headlamp-e2e-values.yaml diff --git a/deployment/headlamp-e2e-values.yaml b/deployment/headlamp-e2e-values.yaml deleted file mode 100644 index dddd973..0000000 --- a/deployment/headlamp-e2e-values.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- -# Headlamp Helm values for E2E testing. -# -# Uses the stock Headlamp image with the plugin loaded via a ConfigMap -# volume mount. No custom Docker images — the plugin dist/ is packaged -# as a ConfigMap by deploy-e2e-headlamp.sh. -# -# Usage: -# helm install headlamp-e2e headlamp/headlamp \ -# -n privilegedescalation-dev \ -# -f deployment/headlamp-e2e-values.yaml \ -# --set image.registry=ghcr.io \ -# --set image.repository=headlamp-k8s/headlamp \ -# --set image.tag=latest - -config: - pluginsDir: /headlamp/plugins - watchPlugins: false - -clusterRoleBinding: - create: false - -service: - type: ClusterIP - -extraVolumes: - - name: polaris-plugin - configMap: - name: headlamp-polaris-plugin - -extraVolumeMounts: - - name: polaris-plugin - mountPath: /headlamp/plugins/headlamp-polaris - readOnly: true diff --git a/scripts/deploy-e2e-headlamp.sh b/scripts/deploy-e2e-headlamp.sh index 77378ba..412dd89 100755 --- a/scripts/deploy-e2e-headlamp.sh +++ b/scripts/deploy-e2e-headlamp.sh @@ -11,12 +11,11 @@ # Prerequisites: # - Plugin built (dist/ exists with plugin-main.js + package.json) # - kubectl configured with cluster access -# - Helm 3 installed # - RBAC applied: kubectl apply -f deployment/e2e-ci-runner-rbac.yaml # # Environment: # E2E_NAMESPACE — namespace for E2E Headlamp (default: privilegedescalation-dev) -# E2E_RELEASE — Helm release name (default: headlamp-e2e) +# E2E_RELEASE — release/resource name prefix (default: headlamp-e2e) # HEADLAMP_VERSION — Headlamp image tag (default: latest) set -euo pipefail @@ -59,28 +58,105 @@ kubectl create configmap headlamp-polaris-plugin \ --from-file="$DIST_DIR" \ --from-file=package.json="$REPO_ROOT/package.json" -# --- Deploy with Helm --- +# --- Deploy Headlamp via kubectl apply --- echo "" -echo "Adding Headlamp Helm repo..." -helm repo add headlamp https://kubernetes-sigs.github.io/headlamp/ --force-update -helm repo update +echo "Deploying Headlamp E2E instance..." -echo "Installing/upgrading Headlamp E2E instance..." -helm upgrade --install "$E2E_RELEASE" headlamp/headlamp \ - -n "$E2E_NAMESPACE" \ - -f "$REPO_ROOT/deployment/headlamp-e2e-values.yaml" \ - --set "image.registry=ghcr.io" \ - --set "image.repository=headlamp-k8s/headlamp" \ - --set "image.tag=${HEADLAMP_VERSION}" \ - --wait \ - --timeout 120s +kubectl apply -f - </dev/null || echo "Release not found (already removed?)" +echo "Removing Headlamp Deployment, Service, and ServiceAccount..." +kubectl delete deployment "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found +kubectl delete service "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found +kubectl delete serviceaccount "${E2E_RELEASE}" -n "$E2E_NAMESPACE" --ignore-not-found echo "Cleaning up ConfigMap..." kubectl delete configmap headlamp-polaris-plugin -n "$E2E_NAMESPACE" --ignore-not-found -echo "Cleaning up service account..." +echo "Cleaning up test service account..." kubectl delete serviceaccount headlamp-e2e-test -n "$E2E_NAMESPACE" --ignore-not-found # Clean up local env file