From f6c216ce93d0b7590afbbf233b1d149351b93f2b Mon Sep 17 00:00:00 2001 From: panxiao81 Date: Mon, 14 Sep 2026 14:38:14 +0000 Subject: [PATCH] =?UTF-8?q?ci:=20=E9=AA=8C=E8=AF=81=20Kata=20=E5=86=85?= =?UTF-8?q?=E8=BF=90=E8=A1=8C=20kind=20=E9=9B=86=E7=BE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/kind-on-kata-smoke.yml | 49 +++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .gitea/workflows/kind-on-kata-smoke.yml diff --git a/.gitea/workflows/kind-on-kata-smoke.yml b/.gitea/workflows/kind-on-kata-smoke.yml new file mode 100644 index 0000000..961b9d4 --- /dev/null +++ b/.gitea/workflows/kind-on-kata-smoke.yml @@ -0,0 +1,49 @@ +--- +name: kind-on-kata-smoke + +on: + push: + branches: + - poc/kind-on-kata + paths: + - .gitea/workflows/kind-on-kata-smoke.yml + workflow_dispatch: + +jobs: + smoke: + runs-on: kata-poc + steps: + - name: Create nested kind cluster + shell: sh + env: + KIND_VERSION: v0.27.0 + KIND_NODE_IMAGE: kindest/node:v1.32.2@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f + run: | + set -eu + apk add --no-cache ca-certificates curl docker-cli + curl -fsSLo /tmp/kind "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64" + curl -fsSLo /tmp/kind.sha256sum "https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64.sha256sum" + expected="$(awk '{print $1}' /tmp/kind.sha256sum)" + printf '%s %s\n' "$expected" /tmp/kind | sha256sum -c - + install -m 0755 /tmp/kind /usr/local/bin/kind + + cleanup() { + kind delete cluster --name nested >/dev/null 2>&1 || true + } + trap cleanup EXIT + + kind create cluster --name nested --image "$KIND_NODE_IMAGE" --wait 5m + docker exec nested-control-plane kubectl \ + --kubeconfig=/etc/kubernetes/admin.conf wait \ + --for=condition=Ready node/nested-control-plane --timeout=2m + docker exec nested-control-plane kubectl \ + --kubeconfig=/etc/kubernetes/admin.conf run smoke \ + --image=docker.io/library/busybox:1.37 --restart=Never \ + --command -- sh -c 'echo kind-on-kata-ok' + docker exec nested-control-plane kubectl \ + --kubeconfig=/etc/kubernetes/admin.conf wait \ + --for=jsonpath='{.status.phase}'=Succeeded pod/smoke --timeout=2m + test "$(docker exec nested-control-plane kubectl \ + --kubeconfig=/etc/kubernetes/admin.conf logs smoke)" = kind-on-kata-ok + kind delete cluster --name nested + trap - EXIT