From 313bcc23fa646fcb035246dcbdd43f7e584b8837 Mon Sep 17 00:00:00 2001 From: Joshua Hoblitt Date: Tue, 26 Mar 2024 14:34:02 -0700 Subject: [PATCH] (WIP) (gha) add fleet test --- .github/workflows/fleet-test.yaml | 33 +++++++++++++++++++++++++++++++ gitrepo-local.yaml | 17 ++++++++++++++++ wait-for-bundle.sh | 7 +++++++ 3 files changed, 57 insertions(+) create mode 100644 .github/workflows/fleet-test.yaml create mode 100644 gitrepo-local.yaml create mode 100755 wait-for-bundle.sh diff --git a/.github/workflows/fleet-test.yaml b/.github/workflows/fleet-test.yaml new file mode 100644 index 000000000..df3dbe0b0 --- /dev/null +++ b/.github/workflows/fleet-test.yaml @@ -0,0 +1,33 @@ +--- +# yamllint disable rule:quoted-strings +name: fleet test + +"on": + - push + +jobs: + create-cluster: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: azure/setup-helm@v4.1.0 + - uses: helm/kind-action@v1 + with: + version: v0.21.0 + + - run: kubectl get nodes + - run: ip -c a + - run: ip route + + - run: helm repo add fleet https://rancher.github.io/fleet-helm-charts/ + - run: helm -n cattle-fleet-system install --create-namespace --wait fleet-crd fleet/fleet-crd + - run: helm -n cattle-fleet-system install --create-namespace --wait fleet fleet/fleet + - run: kubectl get pods -A + - run: kubectl apply -f gitrepo-local.yaml + - run: kubectl get clusters -A + - run: kubectl get gitrepo -A + # - run: ./wait-for-bundle.sh + # timeout-minutes: 15 + - uses: actions/checkout@v3 + - name: Setup tmate session + uses: mxschmitt/action-tmate@v3 diff --git a/gitrepo-local.yaml b/gitrepo-local.yaml new file mode 100644 index 000000000..0382ea21f --- /dev/null +++ b/gitrepo-local.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: fleet.cattle.io/v1alpha1 +kind: GitRepo +metadata: + name: local + namespace: fleet-local +spec: + repo: https://github.com/lsst-it/k8s-cookbook + branch: IT-5209/fleet-test + keepResources: true + paths: + - fleet/s/dev/c/ruka/* + targets: + - name: local + clusterName: local + correctDrift: + enabled: false # XXX do not enable because of rook diff --git a/wait-for-bundle.sh b/wait-for-bundle.sh new file mode 100755 index 000000000..cb90e9257 --- /dev/null +++ b/wait-for-bundle.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +while true; do + kubectl -n fleet-local wait --for=condition=ready bundle -l bundle=metallb --timeout=10s + kubectl get bundle -A + sleep 5 +done