This repository has been archived on 2026-06-16. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
headlamp-kube-vip-plugin/scripts/teardown-e2e-headlamp.sh
T
Chris Farhood 9cc1ca7b91 fix(e2e): use NodePort instead of cluster-internal DNS for HEADLAMP_URL
Previous attempt used kubectl port-forward to a Service, which failed
with 'connection refused' — the API server could not reach pod IPs.

Switch to NodePort (30080) service type and use the node's InternalIP
for HEADLAMP_URL, reachable from the GitHub Actions runner pod.

- Change Service type from ClusterIP to NodePort with nodePort: 30080
- After rollout, get node InternalIP via kubectl get nodes
- Poll http://<node-ip>:30080 until reachable
- Write HEADLAMP_URL=http://<node-ip>:30080 to .env.e2e
- Remove port-forward leftover cleanup from teardown script

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-05 17:10:54 +00:00

31 lines
988 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
E2E_NAMESPACE="${E2E_NAMESPACE:-headlamp-dev}"
E2E_RELEASE="${E2E_RELEASE:-headlamp-e2e}"
echo "=== E2E Headlamp Teardown ==="
echo " Namespace: $E2E_NAMESPACE"
echo " Release: $E2E_RELEASE"
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-kube-vip-plugin -n "$E2E_NAMESPACE" --ignore-not-found
echo "Cleaning up test service account..."
kubectl delete serviceaccount headlamp-e2e-test -n "$E2E_NAMESPACE" --ignore-not-found
if [ -f "$REPO_ROOT/.env.e2e" ]; then
rm -f "$REPO_ROOT/.env.e2e"
echo "Removed .env.e2e"
fi
echo ""
echo "E2E teardown complete."