update httproute spec and metadata on changes #30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ingress | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| env: | |
| GO_VERSION: "1.24" | |
| K8S_VERSION: "v1.34.0" | |
| KIND_VERSION: "v0.30.0" | |
| KIND_CLUSTER_NAME: "kind-cloud" | |
| jobs: | |
| ingress: | |
| name: ingress | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 100 | |
| env: | |
| JOB_NAME: "cloud-provider-kind-e2e-ingress" | |
| steps: | |
| - name: Set up Go | |
| uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| id: go | |
| - name: Check out code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Enable ipv4 and ipv6 forwarding | |
| run: | | |
| sudo sysctl -w net.ipv6.conf.all.forwarding=1 | |
| sudo sysctl -w net.ipv4.ip_forward=1 | |
| - name: Set up environment (download dependencies) | |
| run: | | |
| TMP_DIR=$(mktemp -d) | |
| # kubectl | |
| curl -L https://dl.k8s.io/${{ env.K8S_VERSION }}/bin/linux/amd64/kubectl -o ${TMP_DIR}/kubectl | |
| # kind | |
| curl -Lo ${TMP_DIR}/kind https://kind.sigs.k8s.io/dl/${{ env.KIND_VERSION }}/kind-linux-amd64 | |
| # Install | |
| sudo cp ${TMP_DIR}/kubectl /usr/local/bin/kubectl | |
| sudo cp ${TMP_DIR}/kind /usr/local/bin/kind | |
| sudo chmod +x /usr/local/bin/kubectl | |
| sudo chmod +x /usr/local/bin/kind | |
| # Create folder to store artifacts | |
| mkdir -p _artifacts | |
| - name: Run cloud-provider-kind | |
| run: | | |
| make | |
| nohup bin/cloud-provider-kind -v 2 --enable-log-dumping --logs-dir ./_artifacts/loadbalancers > ./_artifacts/ccm-kind.log 2>&1 & | |
| - name: Create multi node cluster | |
| run: | | |
| # create cluster | |
| cat <<EOF | /usr/local/bin/kind create cluster \ | |
| --name ${{ env.KIND_CLUSTER_NAME}} \ | |
| --image kindest/node:${{ env.K8S_VERSION }} \ | |
| -v7 --wait 1m --retain --config=- | |
| kind: Cluster | |
| apiVersion: kind.x-k8s.io/v1alpha4 | |
| nodes: | |
| - role: control-plane | |
| - role: worker | |
| - role: worker | |
| kubeadmConfigPatches: | |
| - | | |
| kind: ClusterConfiguration | |
| apiServer: | |
| extraArgs: | |
| v: "5" | |
| controllerManager: | |
| extraArgs: | |
| cloud-provider: "external" | |
| v: "5" | |
| --- | |
| kind: InitConfiguration | |
| nodeRegistration: | |
| kubeletExtraArgs: | |
| cloud-provider: "external" | |
| v: "5" | |
| --- | |
| kind: JoinConfiguration | |
| nodeRegistration: | |
| kubeletExtraArgs: | |
| cloud-provider: "external" | |
| v: "5" | |
| EOF | |
| /usr/local/bin/kind get kubeconfig --name ${{ env.KIND_CLUSTER_NAME}} > _artifacts/kubeconfig.conf | |
| - name: Get Cluster status | |
| run: | | |
| /usr/local/bin/kubectl get nodes -o yaml | |
| /usr/local/bin/kubectl get pods -A -o wide | |
| # wait network is ready | |
| /usr/local/bin/kubectl wait --for=condition=ready pods --namespace=kube-system -l k8s-app=kube-dns --timeout=3m | |
| /usr/local/bin/kubectl get nodes -o wide | |
| /usr/local/bin/kubectl get pods -A | |
| - name: Run tests | |
| run: | | |
| TMP_DIR=$(mktemp -d) | |
| # Test binaries | |
| git clone --depth 1 https://github.com/kubernetes-sigs/ingress-controller-conformance.git ${TMP_DIR}/ingress-controller-conformance | |
| cd ${TMP_DIR}/ingress-controller-conformance | |
| # Add the @skip tag to the incompatible test | |
| # The Gateway spec for spec.hostnames: ["*.foo.com"] states it matches all subdomains. | |
| # The Ingress spec for spec.rules.host: "*.foo.com" states it only matches a single subdomain level. | |
| echo "Skipping incompatible test: 'An Ingress with a wildcard host rule should not route traffic matching on more than a single dns label'" | |
| sed -i '/Scenario: An Ingress with a wildcard host rule should not route traffic matching on more than a single dns label/i @skip' features/host_rules.feature | |
| echo "Skipping load balancing spread test: 'An Ingress with no rules should send all requests to the default backend'" | |
| sed -i '/Scenario Outline: An Ingress with no rules should send all requests to the default backend/i @skip' features/load_balancing.feature | |
| make build | |
| chmod +x ingress-controller-conformance | |
| ./ingress-controller-conformance \ | |
| --ingress-class=cloud-provider-kind \ | |
| --no-colors \ | |
| --output-directory="${PWD}/_artifacts" \ | |
| --tags="~@skip" \ | |
| --wait-time-for-ingress-status=65s | |
| - name: Export logs | |
| if: always() | |
| run: | | |
| /usr/local/bin/kind export logs --name ${{ env.KIND_CLUSTER_NAME}} ./_artifacts/logs | |
| cp ./_artifacts/ccm-kind.log ./_artifacts/logs | |
| - name: Upload logs | |
| if: always() | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| with: | |
| name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }} | |
| path: ./_artifacts |