Skip to content

decouple listener logic #16

decouple listener logic

decouple listener logic #16

Workflow file for this run

name: gateway
on:
push:
pull_request:
workflow_dispatch:
env:
GO_VERSION: "1.24"
K8S_VERSION: "v1.32.0"
KIND_VERSION: "v0.27.0"
KIND_CLUSTER_NAME: "kind-cloud"
jobs:
gateway:
name: gateway
runs-on: ubuntu-latest
timeout-minutes: 100
env:
JOB_NAME: "cloud-provider-kind-e2e-gateway"
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- 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)
# Test binaries
git clone --depth 1 https://github.com/kubernetes-sigs/gateway-api.git ${TMP_DIR}
cd ${TMP_DIR}
go test ./conformance/ -c
cd -
sudo cp ${TMP_DIR}/conformance.test /usr/local/bin/conformance.test
sudo chmod +x /usr/local/bin/conformance.test
# 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:
cloud-provider: "external"
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: |
/usr/local/bin/conformance.test -test.run TestConformance \
--kubeconfig=_artifacts/kubeconfig.conf \
--organization=sigs.k8s.io \
--project=cloud-provider-kind \
--url=https://github.com/kubernetes-sigs/cloud-provider-kind \
--version=test \
--contact=antonio.ojea.garcia@gmail.com \
--gateway-class=cloud-provider-kind \
--supported-features=Gateway,HTTPRoute \
--report-output=./_artifacts
- 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
cp ./_artifacts/loadbalancers/* ./_artifacts/logs
- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: kind-logs-${{ env.JOB_NAME }}-${{ github.run_id }}
path: ./_artifacts