|
| 1 | +name: conformance |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: [ 'main', 'update-components', 'release/**', 'conform*' ] |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: read |
| 10 | + |
| 11 | +env: |
| 12 | + GO_VERSION: 1.22.x |
| 13 | + |
| 14 | +jobs: |
| 15 | + conform-kubernetes: |
| 16 | + # Hosted on Equinix |
| 17 | + # Docs: https://github.com/fluxcd/flux2/tree/main/.github/runners |
| 18 | + runs-on: [self-hosted, Linux, ARM64, equinix] |
| 19 | + strategy: |
| 20 | + matrix: |
| 21 | + # Keep this list up-to-date with https://endoflife.date/kubernetes |
| 22 | + # Build images with https://github.com/fluxcd/flux-benchmark/actions/workflows/build-kind.yaml |
| 23 | + KUBERNETES_VERSION: [ 1.28.9, 1.29.4, 1.30.0 ] |
| 24 | + fail-fast: false |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 |
| 28 | + - name: Setup Go |
| 29 | + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 |
| 30 | + with: |
| 31 | + go-version: ${{ env.GO_VERSION }} |
| 32 | + cache-dependency-path: | |
| 33 | + **/go.sum |
| 34 | + **/go.mod |
| 35 | + - name: Prepare |
| 36 | + id: prep |
| 37 | + run: | |
| 38 | + ID=${GITHUB_SHA:0:7}-${{ matrix.KUBERNETES_VERSION }}-$(date +%s) |
| 39 | + echo "CLUSTER=arm64-${ID}" >> $GITHUB_OUTPUT |
| 40 | + - name: Build |
| 41 | + run: | |
| 42 | + make build |
| 43 | + - name: Setup Kubernetes Kind |
| 44 | + run: | |
| 45 | + kind create cluster \ |
| 46 | + --wait 5m \ |
| 47 | + --name ${{ steps.prep.outputs.CLUSTER }} \ |
| 48 | + --kubeconfig=/tmp/${{ steps.prep.outputs.CLUSTER }} \ |
| 49 | + --image=ghcr.io/fluxcd/kindest/node:v${{ matrix.KUBERNETES_VERSION }}-arm64 |
| 50 | + - name: Run e2e tests |
| 51 | + run: TEST_KUBECONFIG=/tmp/${{ steps.prep.outputs.CLUSTER }} make e2e |
| 52 | + - name: Run multi-tenancy tests |
| 53 | + env: |
| 54 | + KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }} |
| 55 | + run: | |
| 56 | + ./bin/flux install |
| 57 | + ./bin/flux create source git flux-system \ |
| 58 | + --interval=15m \ |
| 59 | + --url=https://github.com/fluxcd/flux2-multi-tenancy \ |
| 60 | + --branch=main \ |
| 61 | + --ignore-paths="./clusters/**/flux-system/" |
| 62 | + ./bin/flux create kustomization flux-system \ |
| 63 | + --interval=15m \ |
| 64 | + --source=flux-system \ |
| 65 | + --path=./clusters/staging |
| 66 | + kubectl -n flux-system wait kustomization/tenants --for=condition=ready --timeout=5m |
| 67 | + kubectl -n apps wait kustomization/dev-team --for=condition=ready --timeout=1m |
| 68 | + kubectl -n apps wait helmrelease/podinfo --for=condition=ready --timeout=1m |
| 69 | + - name: Debug failure |
| 70 | + if: failure() |
| 71 | + env: |
| 72 | + KUBECONFIG: /tmp/${{ steps.prep.outputs.CLUSTER }} |
| 73 | + run: | |
| 74 | + kubectl -n flux-system get all |
| 75 | + kubectl -n flux-system describe po |
| 76 | + kubectl -n flux-system logs deploy/source-controller |
| 77 | + kubectl -n flux-system logs deploy/kustomize-controller |
| 78 | + - name: Cleanup |
| 79 | + if: always() |
| 80 | + run: | |
| 81 | + kind delete cluster --name ${{ steps.prep.outputs.CLUSTER }} |
| 82 | + rm /tmp/${{ steps.prep.outputs.CLUSTER }} |
| 83 | +
|
| 84 | + conform-k3s: |
| 85 | + runs-on: ubuntu-latest |
| 86 | + strategy: |
| 87 | + matrix: |
| 88 | + # Keep this list up-to-date with https://endoflife.date/kubernetes |
| 89 | + # Available versions can be found with "replicated cluster versions" |
| 90 | + K3S_VERSION: [ 1.28.7, 1.29.2 ] |
| 91 | + fail-fast: false |
| 92 | + steps: |
| 93 | + - name: Checkout |
| 94 | + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 |
| 95 | + - name: Setup Go |
| 96 | + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 |
| 97 | + with: |
| 98 | + go-version: ${{ env.GO_VERSION }} |
| 99 | + cache-dependency-path: | |
| 100 | + **/go.sum |
| 101 | + **/go.mod |
| 102 | + - name: Prepare |
| 103 | + id: prep |
| 104 | + run: | |
| 105 | + ID=${GITHUB_SHA:0:7}-${{ matrix.K3S_VERSION }}-$(date +%s) |
| 106 | + PSEUDO_RAND_SUFFIX=$(echo "${ID}" | shasum | awk '{print $1}') |
| 107 | + echo "cluster=flux2-k3s-${PSEUDO_RAND_SUFFIX}" >> $GITHUB_OUTPUT |
| 108 | + KUBECONFIG_PATH="$(git rev-parse --show-toplevel)/bin/kubeconfig.yaml" |
| 109 | + echo "kubeconfig-path=${KUBECONFIG_PATH}" >> $GITHUB_OUTPUT |
| 110 | + - name: Setup Kustomize |
| 111 | + uses: fluxcd/pkg/actions/kustomize@main |
| 112 | + - name: Build |
| 113 | + run: make build-dev |
| 114 | + - name: Create repository |
| 115 | + run: | |
| 116 | + gh repo create --private --add-readme fluxcd-testing/${{ steps.prep.outputs.cluster }} |
| 117 | + env: |
| 118 | + GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} |
| 119 | + - name: Create cluster |
| 120 | + id: create-cluster |
| 121 | + uses: replicatedhq/compatibility-actions/create-cluster@v1 |
| 122 | + with: |
| 123 | + api-token: ${{ secrets.REPLICATED_API_TOKEN }} |
| 124 | + kubernetes-distribution: "k3s" |
| 125 | + kubernetes-version: ${{ matrix.K3S_VERSION }} |
| 126 | + ttl: 20m |
| 127 | + cluster-name: "${{ steps.prep.outputs.cluster }}" |
| 128 | + kubeconfig-path: ${{ steps.prep.outputs.kubeconfig-path }} |
| 129 | + export-kubeconfig: true |
| 130 | + - name: Run e2e tests |
| 131 | + run: TEST_KUBECONFIG=${{ steps.prep.outputs.kubeconfig-path }} make e2e |
| 132 | + - name: Run flux bootstrap |
| 133 | + run: | |
| 134 | + ./bin/flux bootstrap git --manifests ./manifests/install/ \ |
| 135 | + --components-extra=image-reflector-controller,image-automation-controller \ |
| 136 | + --url=https://github.com/fluxcd-testing/${{ steps.prep.outputs.cluster }} \ |
| 137 | + --branch=main \ |
| 138 | + --path=clusters/k3s \ |
| 139 | + --token-auth |
| 140 | + env: |
| 141 | + GIT_PASSWORD: ${{ secrets.GITPROVIDER_BOT_TOKEN }} |
| 142 | + - name: Run flux check |
| 143 | + run: | |
| 144 | + ./bin/flux check |
| 145 | + - name: Run flux reconcile |
| 146 | + run: | |
| 147 | + ./bin/flux reconcile ks flux-system --with-source |
| 148 | + ./bin/flux get all |
| 149 | + ./bin/flux events |
| 150 | + - name: Collect reconcile logs |
| 151 | + if: ${{ always() }} |
| 152 | + continue-on-error: true |
| 153 | + run: | |
| 154 | + kubectl -n flux-system get all |
| 155 | + kubectl -n flux-system describe pods |
| 156 | + kubectl -n flux-system logs deploy/source-controller |
| 157 | + kubectl -n flux-system logs deploy/kustomize-controller |
| 158 | + kubectl -n flux-system logs deploy/notification-controller |
| 159 | + - name: Delete flux |
| 160 | + run: | |
| 161 | + ./bin/flux uninstall -s --keep-namespace |
| 162 | + kubectl delete ns flux-system --wait |
| 163 | + - name: Delete cluster |
| 164 | + if: ${{ always() }} |
| 165 | + uses: replicatedhq/replicated-actions/remove-cluster@v1 |
| 166 | + continue-on-error: true |
| 167 | + with: |
| 168 | + api-token: ${{ secrets.REPLICATED_API_TOKEN }} |
| 169 | + cluster-id: ${{ steps.create-cluster.outputs.cluster-id }} |
| 170 | + - name: Delete repository |
| 171 | + if: ${{ always() }} |
| 172 | + continue-on-error: true |
| 173 | + run: | |
| 174 | + gh repo delete fluxcd-testing/${{ steps.prep.outputs.cluster }} --yes |
| 175 | + env: |
| 176 | + GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} |
| 177 | + |
| 178 | + conform-openshift: |
| 179 | + runs-on: ubuntu-latest |
| 180 | + strategy: |
| 181 | + matrix: |
| 182 | + # Keep this list up-to-date with https://endoflife.date/red-hat-openshift |
| 183 | + OPENSHIFT_VERSION: [ 4.15.0-okd ] |
| 184 | + fail-fast: false |
| 185 | + steps: |
| 186 | + - name: Checkout |
| 187 | + uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 |
| 188 | + - name: Setup Go |
| 189 | + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1 |
| 190 | + with: |
| 191 | + go-version: ${{ env.GO_VERSION }} |
| 192 | + cache-dependency-path: | |
| 193 | + **/go.sum |
| 194 | + **/go.mod |
| 195 | + - name: Prepare |
| 196 | + id: prep |
| 197 | + run: | |
| 198 | + ID=${GITHUB_SHA:0:7}-${{ matrix.OPENSHIFT_VERSION }}-$(date +%s) |
| 199 | + PSEUDO_RAND_SUFFIX=$(echo "${ID}" | shasum | awk '{print $1}') |
| 200 | + echo "cluster=flux2-openshift-${PSEUDO_RAND_SUFFIX}" >> $GITHUB_OUTPUT |
| 201 | + KUBECONFIG_PATH="$(git rev-parse --show-toplevel)/bin/kubeconfig.yaml" |
| 202 | + echo "kubeconfig-path=${KUBECONFIG_PATH}" >> $GITHUB_OUTPUT |
| 203 | + - name: Setup Kustomize |
| 204 | + uses: fluxcd/pkg/actions/kustomize@main |
| 205 | + - name: Build |
| 206 | + run: make build-dev |
| 207 | + - name: Create repository |
| 208 | + run: | |
| 209 | + gh repo create --private --add-readme fluxcd-testing/${{ steps.prep.outputs.cluster }} |
| 210 | + env: |
| 211 | + GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} |
| 212 | + - name: Create cluster |
| 213 | + id: create-cluster |
| 214 | + uses: replicatedhq/compatibility-actions/create-cluster@v1 |
| 215 | + with: |
| 216 | + api-token: ${{ secrets.REPLICATED_API_TOKEN }} |
| 217 | + kubernetes-distribution: "openshift" |
| 218 | + kubernetes-version: ${{ matrix.OPENSHIFT_VERSION }} |
| 219 | + ttl: 20m |
| 220 | + cluster-name: "${{ steps.prep.outputs.cluster }}" |
| 221 | + kubeconfig-path: ${{ steps.prep.outputs.kubeconfig-path }} |
| 222 | + export-kubeconfig: true |
| 223 | + - name: Run flux bootstrap |
| 224 | + run: | |
| 225 | + ./bin/flux bootstrap git --manifests ./manifests/openshift/ \ |
| 226 | + --components-extra=image-reflector-controller,image-automation-controller \ |
| 227 | + --url=https://github.com/fluxcd-testing/${{ steps.prep.outputs.cluster }} \ |
| 228 | + --branch=main \ |
| 229 | + --path=clusters/openshift \ |
| 230 | + --token-auth |
| 231 | + env: |
| 232 | + GIT_PASSWORD: ${{ secrets.GITPROVIDER_BOT_TOKEN }} |
| 233 | + - name: Run flux check |
| 234 | + run: | |
| 235 | + ./bin/flux check |
| 236 | + - name: Run flux reconcile |
| 237 | + run: | |
| 238 | + ./bin/flux reconcile ks flux-system --with-source |
| 239 | + ./bin/flux get all |
| 240 | + ./bin/flux events |
| 241 | + - name: Collect reconcile logs |
| 242 | + if: ${{ always() }} |
| 243 | + continue-on-error: true |
| 244 | + run: | |
| 245 | + kubectl -n flux-system get all |
| 246 | + kubectl -n flux-system describe pods |
| 247 | + kubectl -n flux-system logs deploy/source-controller |
| 248 | + kubectl -n flux-system logs deploy/kustomize-controller |
| 249 | + kubectl -n flux-system logs deploy/notification-controller |
| 250 | + - name: Delete flux |
| 251 | + run: | |
| 252 | + ./bin/flux uninstall -s --keep-namespace |
| 253 | + kubectl delete ns flux-system --wait |
| 254 | + - name: Delete cluster |
| 255 | + if: ${{ always() }} |
| 256 | + uses: replicatedhq/replicated-actions/remove-cluster@v1 |
| 257 | + continue-on-error: true |
| 258 | + with: |
| 259 | + api-token: ${{ secrets.REPLICATED_API_TOKEN }} |
| 260 | + cluster-id: ${{ steps.create-cluster.outputs.cluster-id }} |
| 261 | + - name: Delete repository |
| 262 | + if: ${{ always() }} |
| 263 | + continue-on-error: true |
| 264 | + run: | |
| 265 | + gh repo delete fluxcd-testing/${{ steps.prep.outputs.cluster }} --yes |
| 266 | + env: |
| 267 | + GITHUB_TOKEN: ${{ secrets.GITPROVIDER_BOT_TOKEN }} |
0 commit comments