Skip to content

Commit 21f983b

Browse files
authored
chore: 1.18 kubernetes-ci use self-hosted (#390)
1 parent 241a4d5 commit 21f983b

7 files changed

Lines changed: 25 additions & 27 deletions

File tree

.github/workflows/apisix-conformance-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ jobs:
109109
- name: Get Logs from apisix-ingress-controller
110110
shell: bash
111111
run: |
112-
export KUBECONFIG=/tmp/apisix-ingress-cluster.kubeconfig
113112
kubectl logs -n apisix-conformance-test -l app=apisix-ingress-controller
114113
115114
- name: Upload Gateway API Conformance Report

.github/workflows/conformance-test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ jobs:
117117
- name: Get Logs from api7-ingress-controller
118118
shell: bash
119119
run: |
120-
export KUBECONFIG=/tmp/apisix-ingress-cluster.kubeconfig
121120
kubectl logs -n apisix-conformance-test -l app=apisix-ingress-controller
122121
123122
- name: Upload Gateway API Conformance Report

.github/workflows/e2e-test-k8s.yml

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,35 +34,27 @@ jobs:
3434
matrix:
3535
cases_subset:
3636
- v2
37-
runs-on: buildjet-2vcpu-ubuntu-2004
37+
runs-on: self-hosted
3838
steps:
3939
- name: Checkout
40-
uses: actions/checkout@v2
40+
uses: actions/checkout@v4
4141
with:
4242
submodules: recursive
4343

44-
- name: Setup Go Env
45-
uses: actions/setup-go@v4
46-
with:
47-
go-version: "1.24"
44+
- name: Check Go Env
45+
run: |
46+
go env
4847
49-
- name: Install kind
48+
- name: Check Kind Version
5049
run: |
51-
go install sigs.k8s.io/kind@v0.13.0
50+
kind version
5251
5352
- name: Install Helm
5453
run: |
5554
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
5655
chmod 700 get_helm.sh
5756
./get_helm.sh
5857
59-
- name: Login to Registry
60-
uses: docker/login-action@v3
61-
with:
62-
registry: ${{ secrets.DOCKER_REGISTRY }}
63-
username: ${{ secrets.DOCKER_USERNAME }}
64-
password: ${{ secrets.DOCKER_PASSWORD }}
65-
6658
- name: Login to Private Registry
6759
uses: docker/login-action@v3
6860
with:
@@ -72,9 +64,15 @@ jobs:
7264

7365
- name: Launch Kind Cluster
7466
env:
75-
KIND_NODE_IMAGE: kindest/node:v1.18.20@sha256:38a8726ece5d7867fb0ede63d718d27ce2d41af519ce68be5ae7fcca563537ed
67+
KIND_NODE_IMAGE: kindest/node:v1.18.15
7668
run: |
7769
make kind-up
70+
KIND_NODE_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' apisix-ingress-cluster-control-plane)
71+
echo $KIND_NODE_IP
72+
73+
kubectl config get-clusters
74+
kubectl config set-cluster kind-apisix-ingress-cluster --server=https://$KIND_NODE_IP:6443
75+
kubectl wait --for=condition=Ready nodes --all
7876
7977
- name: Build images
8078
env:
@@ -107,7 +105,6 @@ jobs:
107105
node $(pwd)/adc.js -v
108106
echo "ADC_BIN=node $(pwd)/adc.js" >> $GITHUB_ENV
109107
110-
111108
- name: Start OpenLDAP server
112109
run: make e2e-ldap
113110

Makefile

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ CRD_DOCS_TEMPLATE ?= docs/assets/template
4848

4949
INGRESS_VERSION ?= v1
5050

51-
export KUBECONFIG = /tmp/$(KIND_NAME).kubeconfig
52-
5351
# go
5452
VERSYM="github.com/apache/apisix-ingress-controller/internal/version._buildVersion"
5553
GITSHASYM="github.com/apache/apisix-ingress-controller/internal/version._buildGitRevision"
@@ -143,7 +141,6 @@ kind-e2e-test: kind-up build-image kind-load-images e2e-test
143141
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
144142
.PHONY: e2e-test
145143
e2e-test: adc
146-
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
147144
DASHBOARD_VERSION=$(DASHBOARD_VERSION) go test $(TEST_DIR) -test.timeout=$(TEST_TIMEOUT) -v -ginkgo.v -ginkgo.focus="$(TEST_FOCUS)" -ginkgo.label-filter="$(TEST_LABEL)"
148145

149146
.PHONY: download-api7ee3-chart
@@ -189,8 +186,6 @@ kind-up:
189186
@kind get clusters 2>&1 | grep -v $(KIND_NAME) \
190187
&& kind create cluster --name $(KIND_NAME) --image $(KIND_NODE_IMAGE) \
191188
|| echo "kind cluster already exists"
192-
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
193-
kubectl wait --for=condition=Ready nodes --all
194189

195190
.PHONY: kind-down
196191
kind-down:
@@ -277,7 +272,7 @@ run: manifests generate fmt vet ## Run a controller from your host.
277272
# More info: https://docs.docker.com/develop/develop-images/build_enhancements/
278273
.PHONY: docker-build
279274
docker-build: set-e2e-goos build ## Build docker image with the manager.
280-
$(CONTAINER_TOOL) build -t ${IMG} -f Dockerfile .
275+
$(CONTAINER_TOOL) build --build-arg TARGETARCH=${GOARCH} -t ${IMG} -f Dockerfile .
281276

282277
.PHONY: docker-push
283278
docker-push: ## Push docker image with the manager.

test/e2e/crds/v2/route.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1370,6 +1370,7 @@ spec:
13701370
containers:
13711371
- name: websocket-server
13721372
image: jmalloc/echo-server:latest
1373+
imagePullPolicy: IfNotPresent
13731374
ports:
13741375
- containerPort: 8080
13751376
---
@@ -1430,6 +1431,7 @@ spec:
14301431
By("create WebSocket server resources")
14311432
err := s.CreateResourceFromStringWithNamespace(websocketServerResources, s.Namespace())
14321433
Expect(err).ShouldNot(HaveOccurred(), "creating WebSocket server resources")
1434+
s.EnsureNumEndpointsReady(GinkgoT(), "websocket-server-service", 1)
14331435

14341436
By("create ApisixRoute without WebSocker")
14351437
var apisixRouteWithoutWS apiv2.ApisixRoute
@@ -1438,7 +1440,6 @@ spec:
14381440
&apisixRouteWithoutWS,
14391441
fmt.Sprintf(apisixRouteSpec2, s.Namespace(), s.Namespace()),
14401442
)
1441-
time.Sleep(12 * time.Second)
14421443

14431444
By("verify WebSocket connection fails without WebSocket enabled")
14441445
u := url.URL{

test/e2e/crds/v2/tls.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,12 @@ spec:
235235
assert.NotNil(GinkgoT(), tls[0].Client, "client configuration should not be nil")
236236
assert.NotEmpty(GinkgoT(), tls[0].Client.CA, "client CA should not be empty")
237237
assert.Equal(GinkgoT(), normalizePEM(caCert), normalizePEM(tls[0].Client.CA), "client CA should be test-ca-secret")
238-
assert.Equal(GinkgoT(), int64(1), *tls[0].Client.Depth, "client depth should be 1")
238+
depth := int64(1)
239+
if s.Deployer.Name() == framework.ProviderTypeAPI7EE {
240+
depth = int64(10) // API7EE control plane currently defaults to depth 10 for mTLS
241+
}
242+
assert.NotNil(GinkgoT(), tls[0].Client.Depth, "client depth should be set")
243+
assert.Equal(GinkgoT(), depth, *tls[0].Client.Depth, fmt.Sprintf("client depth should be %d", depth))
239244
})
240245
It("ApisixTls with skip_mtls_uri_regex test", func() {
241246
// TODO: Add support for skip_mtls_uri_regex in API7EE control plane

test/e2e/framework/api7_dashboard.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ prometheus:
203203
server:
204204
persistence:
205205
enabled: false
206+
jaeger:
207+
builtin: false
206208
postgresql:
207209
{{- if ne .DB "postgres" }}
208210
builtin: false

0 commit comments

Comments
 (0)