Skip to content

Commit 0f15f0c

Browse files
change ApplicationProtocol CRD to cluster scope (#230)
* change ApplicationProtocol CRD to cluster scope Signed-off-by: Sad-polar-bear <[email protected]> * fix script issue Signed-off-by: Sad-polar-bear <[email protected]> * fix e2e test Signed-off-by: Sad-polar-bear <[email protected]> * fix e2e test Signed-off-by: Sad-polar-bear <[email protected]> * fix e2e test Signed-off-by: Sad-polar-bear <[email protected]> * fix e2e test Signed-off-by: Sad-polar-bear <[email protected]>
1 parent 0330c7c commit 0f15f0c

25 files changed

+179
-25
lines changed

.github/workflows/e2e-dubbo.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
ISTIO_VERSION: 1.12.7
88
SCRIPTS_DIR: test/e2e/scripts
99
COMMON_DIR: test/e2e/common
10-
10+
AERAKI_IMG_PULL_POLICY: Never
1111
jobs:
1212
TestSidecarOutboundConfig:
1313
runs-on: ubuntu-latest

.github/workflows/e2e-kafka-zookeeper.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
ISTIO_VERSION: 1.12.7
88
SCRIPTS_DIR: test/e2e/scripts
99
COMMON_DIR: test/e2e/common
10-
10+
AERAKI_IMG_PULL_POLICY: Never
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest

.github/workflows/e2e-metaprotocol.yaml

+117-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,66 @@ env:
77
ISTIO_VERSION: 1.12.7
88
SCRIPTS_DIR: test/e2e/scripts
99
COMMON_DIR: test/e2e/common
10-
10+
AERAKI_IMG_PULL_POLICY: Never
1111
jobs:
12+
TestSidecarInboundConfig:
13+
runs-on: ubuntu-latest
14+
timeout-minutes: 60
15+
strategy:
16+
fail-fast: true
17+
name: TestSidecarInboundConfig
18+
steps:
19+
- name: Check out code
20+
uses: actions/checkout@v2
21+
- name: Setup Go
22+
uses: actions/setup-go@v2
23+
with:
24+
go-version: 1.16
25+
- name: Install dependencies
26+
run: |
27+
go version
28+
go get golang.org/x/tools/cmd/goimports
29+
- name: build docker
30+
run: make docker-build-e2e
31+
- name: Prepare envrionment
32+
run: bash ${SCRIPTS_DIR}/pre.sh
33+
- name: Install Minikube
34+
run: bash ${SCRIPTS_DIR}/minikube.sh start
35+
- name: Install Istio
36+
run: bash ${SCRIPTS_DIR}/istio.sh -y -f ${COMMON_DIR}/istio-config.yaml
37+
- name: Install aeraki
38+
run: bash ${SCRIPTS_DIR}/aeraki.sh
39+
- name: test
40+
run: go test -v github.com/aeraki-mesh/aeraki/test/e2e/metaprotocol/ -run TestSidecarInboundConfig
41+
TestSidecarOutboundConfig:
42+
runs-on: ubuntu-latest
43+
timeout-minutes: 60
44+
strategy:
45+
fail-fast: true
46+
name: TestSidecarOutboundConfig
47+
steps:
48+
- name: Check out code
49+
uses: actions/checkout@v2
50+
- name: Setup Go
51+
uses: actions/setup-go@v2
52+
with:
53+
go-version: 1.16
54+
- name: Install dependencies
55+
run: |
56+
go version
57+
go get golang.org/x/tools/cmd/goimports
58+
- name: build docker
59+
run: make docker-build-e2e
60+
- name: Prepare envrionment
61+
run: bash ${SCRIPTS_DIR}/pre.sh
62+
- name: Install Minikube
63+
run: bash ${SCRIPTS_DIR}/minikube.sh start
64+
- name: Install Istio
65+
run: bash ${SCRIPTS_DIR}/istio.sh -y -f ${COMMON_DIR}/istio-config.yaml
66+
- name: Install aeraki
67+
run: bash ${SCRIPTS_DIR}/aeraki.sh
68+
- name: test
69+
run: go test -v github.com/aeraki-mesh/aeraki/test/e2e/metaprotocol/ -run TestSidecarOutboundConfig
1270
TestVersionRouting:
1371
runs-on: ubuntu-latest
1472
timeout-minutes: 60
@@ -38,3 +96,61 @@ jobs:
3896
run: bash ${SCRIPTS_DIR}/aeraki.sh
3997
- name: test
4098
run: go test -v github.com/aeraki-mesh/aeraki/test/e2e/metaprotocol/ -run TestVersionRouting
99+
TestAttributeRouting:
100+
runs-on: ubuntu-latest
101+
timeout-minutes: 60
102+
strategy:
103+
fail-fast: true
104+
name: TestAttributeRouting
105+
steps:
106+
- name: Check out code
107+
uses: actions/checkout@v2
108+
- name: Setup Go
109+
uses: actions/setup-go@v2
110+
with:
111+
go-version: 1.16
112+
- name: Install dependencies
113+
run: |
114+
go version
115+
go get golang.org/x/tools/cmd/goimports
116+
- name: build docker
117+
run: make docker-build-e2e
118+
- name: Prepare envrionment
119+
run: bash ${SCRIPTS_DIR}/pre.sh
120+
- name: Install Minikube
121+
run: bash ${SCRIPTS_DIR}/minikube.sh start
122+
- name: Install Istio
123+
run: bash ${SCRIPTS_DIR}/istio.sh -y -f ${COMMON_DIR}/istio-config.yaml
124+
- name: Install aeraki
125+
run: bash ${SCRIPTS_DIR}/aeraki.sh
126+
- name: test
127+
run: go test -v github.com/aeraki-mesh/aeraki/test/e2e/metaprotocol/ -run TestAttributeRouting
128+
TestPercentageRouting:
129+
runs-on: ubuntu-latest
130+
timeout-minutes: 60
131+
strategy:
132+
fail-fast: true
133+
name: TestPercentageRouting
134+
steps:
135+
- name: Check out code
136+
uses: actions/checkout@v2
137+
- name: Setup Go
138+
uses: actions/setup-go@v2
139+
with:
140+
go-version: 1.16
141+
- name: Install dependencies
142+
run: |
143+
go version
144+
go get golang.org/x/tools/cmd/goimports
145+
- name: build docker
146+
run: make docker-build-e2e
147+
- name: Prepare envrionment
148+
run: bash ${SCRIPTS_DIR}/pre.sh
149+
- name: Install Minikube
150+
run: bash ${SCRIPTS_DIR}/minikube.sh start
151+
- name: Install Istio
152+
run: bash ${SCRIPTS_DIR}/istio.sh -y -f ${COMMON_DIR}/istio-config.yaml
153+
- name: Install aeraki
154+
run: bash ${SCRIPTS_DIR}/aeraki.sh
155+
- name: test
156+
run: go test -v github.com/aeraki-mesh/aeraki/test/e2e/metaprotocol/ -run TestPercentageRouting

.github/workflows/e2e-redis.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
ISTIO_VERSION: 1.12.7
88
SCRIPTS_DIR: test/e2e/scripts
99
COMMON_DIR: test/e2e/common
10-
10+
AERAKI_IMG_PULL_POLICY: Never
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest

.github/workflows/e2e-thrift.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ env:
77
ISTIO_VERSION: 1.12.7
88
SCRIPTS_DIR: test/e2e/scripts
99
COMMON_DIR: test/e2e/common
10-
10+
AERAKI_IMG_PULL_POLICY: Never
1111
jobs:
1212
test:
1313
runs-on: ubuntu-latest

api/metaprotocol/v1alpha1/metaprotocol.aeraki.io.v1alpha1.pb.html

+4-2
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ <h2 id="MetaRouter">MetaRouter</h2>
7676
<p>The destination service to which traffic is being sent.
7777
<em>Note for Kubernetes users</em>: It must be a fully qualified domain name
7878
(FQDN), (e.g. &ldquo;thrift-sample-server.meta-thrift.svc.cluster.local&rdquo; )
79-
instead of a short name (e.g. &ldquo;thrift-sample-server&rdquo;).</p>
79+
instead of a short name (e.g. &ldquo;thrift-sample-server&rdquo;).
80+
<em>Note</em>: Only one host is supported now. If multiple hosts are specified,
81+
Only the first one takes effect.</p>
8082

8183
</td>
8284
<td>
@@ -132,7 +134,7 @@ <h2 id="MetaRouter">MetaRouter</h2>
132134
by default.</p>
133135

134136
<p>The value &ldquo;.&rdquo; is reserved and defines an export to the same namespace that
135-
the virtual service is declared in. Similarly the value &ldquo;*&rdquo; is reserved and
137+
the MetaRouter is declared in. Similarly the value &ldquo;*&rdquo; is reserved and
136138
defines an export to all namespaces.</p>
137139

138140
</td>

api/metaprotocol/v1alpha1/metaprotocol_application_protocol.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/metaprotocol/v1alpha1/metaprotocol_application_protocol.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ option go_package = "github.com/aeraki-mesh/aeraki/api/metaprotocol/v1alpha1";
4444
// +cue-gen:ApplicationProtocol:annotations:helm.sh/resource-policy=keep
4545
// +cue-gen:ApplicationProtocol:labels:app=aeraki,chart=aeraki,heritage=Tiller,release=aeraki
4646
// +cue-gen:ApplicationProtocol:subresource:status
47-
// +cue-gen:ApplicationProtocol:scope:Namespaced
47+
// +cue-gen:ApplicationProtocol:scope:Cluster
4848
// +cue-gen:ApplicationProtocol:resource:categories=aeraki-io,metaprotocol-aeraki-io
4949
// +cue-gen:ApplicationProtocol:preserveUnknownFields:false
5050
// -->

api/metaprotocol/v1alpha1/metaprotocol_metarouter.pb.go

+9-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/metaprotocol/v1alpha1/metaprotocol_metarouter_deepcopy.gen.go

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/metaprotocol/v1alpha1/metaprotocol_metarouter_json.gen.go

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client-go/pkg/apis/metaprotocol/v1alpha1/types.gen.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crd/kubernetes/customresourcedefinitions.gen.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ spec:
144144
listKind: ApplicationProtocolList
145145
plural: applicationprotocols
146146
singular: applicationprotocol
147-
scope: Namespaced
147+
scope: Cluster
148148
versions:
149149
- name: v1alpha1
150150
schema:

demo/install-aeraki.sh

+6
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,10 @@ else
2525
export AERAKI_TAG=$AERAKI_TAG
2626
fi
2727

28+
if [ -z "$AERAKI_IMG_PULL_POLICY" ]; then
29+
export $AERAKI_IMG_PULL_POLICY=Always
30+
else
31+
export AERAKI_IMG_PULL_POLICY=$AERAKI_IMG_PULL_POLICY
32+
fi
33+
2834
bash ${SCRIPTS_DIR}/aeraki.sh $1

demo/install-demo.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ DEMO=$1
2121
SCRIPTS_DIR=$BASEDIR/test/e2e/scripts
2222
COMMON_DIR=$BASEDIR/test/e2e/common
2323
export ISTIO_VERSION=1.12.7
24-
export AERAKI_TAG=latest
24+
export AERAKI_TAG=1.1.0
2525

2626
bash ${SCRIPTS_DIR}/istio.sh -y -f ${COMMON_DIR}/istio-config.yaml
2727
bash ${SCRIPTS_DIR}/aeraki.sh

demo/metaprotocol-brpc/brpc-protocol.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ apiVersion: metaprotocol.aeraki.io/v1alpha1
1717
kind: ApplicationProtocol
1818
metadata:
1919
name: brpc
20-
namespace: istio-system
2120
spec:
2221
codec: aeraki.meta_protocol.codec.brpc
2322
protocol: brpc

demo/metaprotocol-qza/qza-protocol.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ apiVersion: metaprotocol.aeraki.io/v1alpha1
1717
kind: ApplicationProtocol
1818
metadata:
1919
name: qza
20-
namespace: istio-system
2120
spec:
2221
codec: aeraki.meta_protocol.codec.qza
2322
protocol: qza

demo/metaprotocol-trpc/trpc-protocol.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ apiVersion: metaprotocol.aeraki.io/v1alpha1
1717
kind: ApplicationProtocol
1818
metadata:
1919
name: trpc
20-
namespace: istio-system
2120
spec:
2221
codec: aeraki.meta_protocol.codec.trpc
2322
protocol: trpc

demo/metaprotocol-videopacket/videopacket-protocol.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ apiVersion: metaprotocol.aeraki.io/v1alpha1
1717
kind: ApplicationProtocol
1818
metadata:
1919
name: videopacket
20-
namespace: istio-system
2120
spec:
2221
codec: aeraki.meta_protocol.codec.videopacket
2322
protocol: videopacket

k8s/aeraki.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ spec:
3636
containers:
3737
- name: aeraki
3838
image: aeraki/aeraki:${AERAKI_TAG}
39+
# imagePullPolicy should be set to Never so Minikube can use local image for e2e testing
40+
imagePullPolicy: ${AERAKI_IMG_PULL_POLICY}
3941
env:
4042
- name: AERAKI_IS_MASTER
4143
value: "${AERAKI_IS_MASTER}"
@@ -201,7 +203,6 @@ apiVersion: metaprotocol.aeraki.io/v1alpha1
201203
kind: ApplicationProtocol
202204
metadata:
203205
name: dubbo
204-
namespace: istio-system
205206
spec:
206207
protocol: dubbo
207208
codec: aeraki.meta_protocol.codec.dubbo
@@ -210,7 +211,6 @@ apiVersion: metaprotocol.aeraki.io/v1alpha1
210211
kind: ApplicationProtocol
211212
metadata:
212213
name: thrift
213-
namespace: istio-system
214214
spec:
215215
protocol: thrift
216216
codec: aeraki.meta_protocol.codec.thrift

k8s/crd.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ spec:
144144
listKind: ApplicationProtocolList
145145
plural: applicationprotocols
146146
singular: applicationprotocol
147-
scope: Namespaced
147+
scope: Cluster
148148
versions:
149149
- name: v1alpha1
150150
schema:

manifests/charts/aeraki/templates/applicationprotocol.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ apiVersion: metaprotocol.aeraki.io/v1alpha1
1717
kind: ApplicationProtocol
1818
metadata:
1919
name: dubbo
20-
namespace: istio-system
2120
spec:
2221
protocol: dubbo
2322
codec: aeraki.meta_protocol.codec.dubbo
@@ -26,7 +25,6 @@ apiVersion: metaprotocol.aeraki.io/v1alpha1
2625
kind: ApplicationProtocol
2726
metadata:
2827
name: thrift
29-
namespace: istio-system
3028
spec:
3129
protocol: thrift
3230
codec: aeraki.meta_protocol.codec.thrift

0 commit comments

Comments
 (0)