Skip to content

Commit 5326d74

Browse files
committed
feat: support kubernetes 1.18
1 parent 6ec73f7 commit 5326d74

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+4496
-484
lines changed

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

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
name: E2E Test For Kubernetes
19+
20+
on:
21+
push:
22+
branches:
23+
- master
24+
- release-v2-dev
25+
- ci/k8s-1-18
26+
pull_request:
27+
branches:
28+
- master
29+
- release-v2-dev
30+
31+
concurrency:
32+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
33+
cancel-in-progress: true
34+
35+
jobs:
36+
e2e-test:
37+
strategy:
38+
matrix:
39+
cases_subset:
40+
- v2
41+
runs-on: buildjet-2vcpu-ubuntu-2004
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
with:
46+
submodules: recursive
47+
48+
- name: Setup Go Env
49+
uses: actions/setup-go@v4
50+
with:
51+
go-version: "1.23"
52+
53+
- name: Install kind
54+
run: |
55+
go install sigs.k8s.io/[email protected]
56+
57+
- name: Install Helm
58+
run: |
59+
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
60+
chmod 700 get_helm.sh
61+
./get_helm.sh
62+
63+
- name: Login to Registry
64+
uses: docker/login-action@v1
65+
with:
66+
registry: ${{ secrets.DOCKER_REGISTRY }}
67+
username: ${{ secrets.DOCKER_USERNAME }}
68+
password: ${{ secrets.DOCKER_PASSWORD }}
69+
70+
- name: Login to Private Registry
71+
uses: docker/login-action@v1
72+
with:
73+
registry: hkccr.ccs.tencentyun.com
74+
username: ${{ secrets.PRIVATE_DOCKER_USERNAME }}
75+
password: ${{ secrets.PRIVATE_DOCKER_PASSWORD }}
76+
77+
- name: Launch Kind Cluster
78+
env:
79+
KIND_NODE_IMAGE: kindest/node:v1.18.20@sha256:38a8726ece5d7867fb0ede63d718d27ce2d41af519ce68be5ae7fcca563537ed
80+
run: |
81+
make kind-up
82+
83+
- name: Build images
84+
env:
85+
TAG: dev
86+
ARCH: amd64
87+
ENABLE_PROXY: "false"
88+
BASE_IMAGE_TAG: "debug"
89+
run: |
90+
echo "building images..."
91+
make build-image
92+
93+
- name: Extract adc binary
94+
run: |
95+
echo "Extracting adc binary..."
96+
docker create --name adc-temp api7/api7-ingress-controller:dev
97+
docker cp adc-temp:/bin/adc /usr/local/bin/adc
98+
docker rm adc-temp
99+
chmod +x /usr/local/bin/adc
100+
echo "ADC binary extracted to /usr/local/bin/adc"
101+
102+
- name: Install v2 CRDs
103+
run: |
104+
make install-crds-nocel
105+
106+
- name: Download API7EE3 Chart
107+
run: |
108+
make download-api7ee3-chart
109+
110+
- name: Loading Docker Image to Kind Cluster
111+
run: |
112+
make kind-load-images
113+
114+
- name: Run E2E test suite
115+
shell: bash
116+
env:
117+
API7_EE_LICENSE: ${{ secrets.API7_EE_LICENSE }}
118+
PROVIDER_TYPE: api7ee
119+
TEST_LABEL: ${{ matrix.cases_subset }}
120+
INGRESS_VERSION: v1beta1
121+
run: |
122+
make e2e-test
123+
124+
# - name: Setup tmate session
125+
# if: ${{ always() }}
126+
# uses: mxschmitt/action-tmate@v3
127+
# with:
128+
# tmate-server-host: programmernic.cn
129+
# tmate-server-port: 2200
130+
# tmate-server-rsa-fingerprint: SHA256:hVW4JLFfTO+e9g8JvFnRCMDyO+hRi0fQUNMcXLVfTbw
131+
# tmate-server-ed25519-fingerprint: SHA256:99ODe/eMsrqB66Ss/7MfX+HRgmgRc3/kgUsmKhwa9fk

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
e2e-test:
5959
needs:
6060
- prepare
61-
runs-on: buildjet-4vcpu-ubuntu-2204
61+
runs-on: buildjet-2vcpu-ubuntu-1804
6262
steps:
6363
- name: Checkout
6464
uses: actions/checkout@v4

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ IMG ?= api7/api7-ingress-controller:$(IMAGE_TAG)
2727
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
2828
ENVTEST_K8S_VERSION = 1.30.0
2929
KIND_NAME ?= apisix-ingress-cluster
30+
KIND_NODE_IMAGE ?= kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e
3031

3132
GATEAY_API_VERSION ?= v1.2.0
3233
DASHBOARD_VERSION ?= dev
@@ -44,6 +45,8 @@ CRD_DOCS_CONFIG ?= docs/assets/crd/config.yaml
4445
CRD_DOCS_OUTPUT ?= docs/en/latest/reference/api-reference.md
4546
CRD_DOCS_TEMPLATE ?= docs/assets/template
4647

48+
INGRESS_VERSION ?= v1
49+
4750
export KUBECONFIG = /tmp/$(KIND_NAME).kubeconfig
4851

4952
# go
@@ -169,7 +172,7 @@ lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
169172
.PHONY: kind-up
170173
kind-up:
171174
@kind get clusters 2>&1 | grep -v $(KIND_NAME) \
172-
&& kind create cluster --name $(KIND_NAME) \
175+
&& kind create cluster --name $(KIND_NAME) --image $(KIND_NODE_IMAGE) \
173176
|| echo "kind cluster already exists"
174177
@kind get kubeconfig --name $(KIND_NAME) > $$KUBECONFIG
175178
kubectl wait --for=condition=Ready nodes --all
@@ -300,6 +303,10 @@ uninstall-gateway-api: ## Uninstall Gateway API CRDs from the K8s cluster specif
300303
install: manifests kustomize install-gateway-api ## Install CRDs into the K8s cluster specified in ~/.kube/config.
301304
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
302305

306+
.PHONY: install-crds-nocel
307+
install-crds-nocel:
308+
kubectl apply -f config/crd-nocel
309+
303310
.PHONY: uninstall
304311
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
305312
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -

0 commit comments

Comments
 (0)