mirror of
https://gitea.com/gitea/helm-actions.git
synced 2026-04-13 21:24:30 +00:00
Compare commits
12 Commits
v0.0.5
...
a21154e3a6
| Author | SHA1 | Date | |
|---|---|---|---|
| a21154e3a6 | |||
| d1c20ced5e | |||
| 4e2e4c4b29 | |||
| 759dffa245 | |||
| 619d048017 | |||
| 2f455431a9 | |||
| 9a3b8afa55 | |||
| e2bc1191d7 | |||
| 2325970518 | |||
| 1c8e4d9ef6 | |||
| 7db5906c08 | |||
| d24696be8c |
106
.gitea/workflows/e2e.yml
Normal file
106
.gitea/workflows/e2e.yml
Normal file
@ -0,0 +1,106 @@
|
|||||||
|
on: pull_request
|
||||||
|
jobs:
|
||||||
|
k8s-test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Docker CLI, kind, and kubectl
|
||||||
|
run: |
|
||||||
|
# Install Docker CLI (to talk to the host daemon via the mounted socket)
|
||||||
|
apt-get update && apt-get install -y docker.io jq
|
||||||
|
|
||||||
|
# Install kind
|
||||||
|
curl -Lo /usr/local/bin/kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64
|
||||||
|
chmod +x /usr/local/bin/kind
|
||||||
|
|
||||||
|
# Install kubectl
|
||||||
|
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
|
||||||
|
install kubectl /usr/local/bin/
|
||||||
|
|
||||||
|
- name: Debug All
|
||||||
|
run: |
|
||||||
|
docker ps -adocker network rm kind || true
|
||||||
|
docker network ls
|
||||||
|
docker volume ls
|
||||||
|
|
||||||
|
- name: Delete Kind Cluster
|
||||||
|
run: |
|
||||||
|
kind delete cluster --name test-cluster-2
|
||||||
|
|
||||||
|
- name: Sleep 5s
|
||||||
|
run: sleep 5
|
||||||
|
|
||||||
|
- name: Delete kind network
|
||||||
|
run: |
|
||||||
|
docker network rm kind || true
|
||||||
|
|
||||||
|
- name: Debug All
|
||||||
|
run: |
|
||||||
|
docker ps -a
|
||||||
|
docker network ls
|
||||||
|
docker volume ls
|
||||||
|
|
||||||
|
- name: Create kind cluster
|
||||||
|
run: |
|
||||||
|
cat > cluster.yml << 'EOF'
|
||||||
|
# three node (two workers) cluster config
|
||||||
|
kind: Cluster
|
||||||
|
apiVersion: kind.x-k8s.io/v1alpha4
|
||||||
|
nodes:
|
||||||
|
- role: control-plane
|
||||||
|
EOF
|
||||||
|
kind create cluster --name test-cluster-2 --config cluster.yml
|
||||||
|
|
||||||
|
- name: Attach kind control-plane to job network and wait
|
||||||
|
run: |
|
||||||
|
apt-get update && apt-get install -y jq docker.io
|
||||||
|
|
||||||
|
JOB_CONTAINER_ID="$(hostname)"
|
||||||
|
NETWORK_NAME="$(docker inspect "$JOB_CONTAINER_ID" --format '{{range $k, $v := .NetworkSettings.Networks}}{{$k}}{{end}}')"
|
||||||
|
echo "Job network: $NETWORK_NAME"
|
||||||
|
|
||||||
|
CONTROL_PLANE="test-cluster-2-control-plane"
|
||||||
|
docker network connect "$NETWORK_NAME" "$CONTROL_PLANE" || true
|
||||||
|
|
||||||
|
KIND_IP="$(docker inspect "$CONTROL_PLANE" --format "{{(index .NetworkSettings.Networks \"$NETWORK_NAME\").IPAddress}}")"
|
||||||
|
echo "Kind IP: $KIND_IP"
|
||||||
|
|
||||||
|
# Point kubectl at the control-plane directly
|
||||||
|
kubectl config set-cluster kind-test-cluster-2 --server="https://${KIND_IP}:6443"
|
||||||
|
kubectl config set-cluster kind-test-cluster-2 --insecure-skip-tls-verify=true
|
||||||
|
|
||||||
|
# Wait for API and nodes
|
||||||
|
for i in $(seq 1 120); do
|
||||||
|
if kubectl get nodes >/dev/null 2>&1; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
echo "Waiting for kind API... ($i/120)"
|
||||||
|
sleep 2
|
||||||
|
done
|
||||||
|
kubectl get nodes
|
||||||
|
|
||||||
|
- name: Verify cluster access
|
||||||
|
run: |
|
||||||
|
kubectl cluster-info
|
||||||
|
kubectl get nodes
|
||||||
|
kubectl get pods -A
|
||||||
|
|
||||||
|
- name: Debug All
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
docker ps -a
|
||||||
|
docker network ls
|
||||||
|
docker volume ls
|
||||||
|
|
||||||
|
- name: Delete Kind Cluster
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
kind delete cluster --name test-cluster-2
|
||||||
|
|
||||||
|
- name: Debug All
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
docker ps -a
|
||||||
|
docker network ls
|
||||||
|
docker volume ls
|
||||||
Reference in New Issue
Block a user