forked from kubernetes-sigs/cloud-provider-kind
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (125 loc) · 4.58 KB
/
gateway.yml
File metadata and controls
137 lines (125 loc) · 4.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
name: gateway
on:
push:
pull_request:
workflow_dispatch:
env:
GO_VERSION: "1.24"
GATEWAY_VERSION: "v1.4.0"
K8S_VERSION: "v1.34.0"
KIND_VERSION: "v0.30.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@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version: ${{ env.GO_VERSION }}
id: go
- name: Check out code
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.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)
# Test binaries
git clone --branch ${{ env.GATEWAY_VERSION }} --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:
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 \
--debug=true \
--kubeconfig=_artifacts/kubeconfig.conf \
--organization=sigs.k8s.io \
--project=cloud-provider-kind \
--url=https://github.com/kubernetes-sigs/cloud-provider-kind \
--version=${{ github.sha }} \
--contact=https://github.com/kubernetes-sigs/cloud-provider-kind/issues/new \
--gateway-class=cloud-provider-kind \
--conformance-profiles=GATEWAY-HTTP \
--supported-features=Gateway,HTTPRoute,ReferenceGrant \
--report-output=./_artifacts/conformance.yaml
- 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