Skip to content

Commit f8e2e19

Browse files
committed
tests: dnspolicy scale testing (kind)
* Add hack/dnspolicy-scale-testing to run multi cluster testing scenarios manually on kind clusters * Add basic dns testing config for aws,azure,gcp and inmem providers Signed-off-by: Michael Nairn <[email protected]>
1 parent b91fec4 commit f8e2e19

File tree

13 files changed

+575
-2
lines changed

13 files changed

+575
-2
lines changed

config/install/namespaced-dns-operator/dns-operator/kustomization.template.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
44
- github.com/kuadrant/dns-operator/config/local-setup/dns-operator?ref=${DNS_OPERATOR_GITREF}
5-
# - github.com/kuadrant/dns-operator/config/prometheus?ref=${DNS_OPERATOR_GITREF} # Uncomment to enable prometheus monitor
5+
# - github.com/kuadrant/dns-operator/config/prometheus?ref=${DNS_OPERATOR_GITREF} # Uncomment to enable prometheus monitor

config/install/namespaced-dns-operator/dns-operator/kustomization.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
44
- github.com/kuadrant/dns-operator/config/local-setup/dns-operator?ref=main
5-
# - github.com/kuadrant/dns-operator/config/prometheus?ref=main # Uncomment to enable prometheus monitor
5+
# - github.com/kuadrant/dns-operator/config/prometheus?ref=main # Uncomment to enable prometheus monitor
+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
## DNSPolicy Scale Testing
2+
3+
Create two kind clusters with Kuadrant installed:
4+
```bash
5+
CLUSTER_COUNT=2 ./hack/dnspolicy-scale-testing/test.sh kind-create
6+
```
7+
8+
Installed namespaced dns operators (optional):
9+
```bash
10+
CLUSTER_COUNT=2 ./hack/dnspolicy-scale-testing/test.sh kind-install-namespaced-dns-operator
11+
```
12+
13+
Run a test:
14+
```bash
15+
CLUSTER_COUNT=2 TEST_NS_COUNT=5 ./hack/dnspolicy-scale-testing/test.sh test_dnspolicy_loadbalanced aws
16+
```
17+
18+
Cleanup after test:
19+
20+
Delete all dnspolices created by tests first and ensure all dnsrecords are removed
21+
```shell
22+
kubectl get dnspolicy -l kuadrant.io/test-suite=manual -A --context kind-kuadrant-local-1
23+
kubectl delete dnspolicy -l kuadrant.io/test-suite=manual -A --context kind-kuadrant-local-1
24+
kubectl get dnsrecord -A --context kind-kuadrant-local-1
25+
```
26+
27+
Delete all other test suite resources
28+
```shell
29+
kubectl get all,httproutes,gateway,tlspolicy,secrets,issuers -l kuadrant.io/test-suite=manual -A --context kind-kuadrant-local-1
30+
kubectl delete all,httproutes,gateway,tlspolicy,secrets,issuers -l kuadrant.io/test-suite=manual -A --context kind-kuadrant-local-1
31+
```
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
apiVersion: kuadrant.io/v1
2+
kind: DNSPolicy
3+
metadata:
4+
name: prod-web-inmemory
5+
labels:
6+
kuadrant.io/test-dns-provider: inmemory
7+
spec:
8+
targetRef:
9+
name: prod-web-istio-inmemory
10+
group: gateway.networking.k8s.io
11+
kind: Gateway
12+
providerRefs:
13+
- name: dns-provider-credentials-inmemory
14+
loadBalancing:
15+
defaultGeo: true
16+
geo: US
17+
weight: 100
18+
---
19+
apiVersion: kuadrant.io/v1
20+
kind: DNSPolicy
21+
metadata:
22+
name: prod-web-aws
23+
labels:
24+
kuadrant.io/test-dns-provider: aws
25+
spec:
26+
targetRef:
27+
name: prod-web-istio-aws
28+
group: gateway.networking.k8s.io
29+
kind: Gateway
30+
providerRefs:
31+
- name: dns-provider-credentials-aws
32+
loadBalancing:
33+
defaultGeo: true
34+
geo: US
35+
weight: 100
36+
---
37+
apiVersion: kuadrant.io/v1
38+
kind: DNSPolicy
39+
metadata:
40+
name: prod-web-gcp
41+
labels:
42+
kuadrant.io/test-dns-provider: gcp
43+
spec:
44+
targetRef:
45+
name: prod-web-istio-gcp
46+
group: gateway.networking.k8s.io
47+
kind: Gateway
48+
providerRefs:
49+
- name: dns-provider-credentials-gcp
50+
loadBalancing:
51+
defaultGeo: true
52+
geo: us-east1
53+
weight: 100
54+
---
55+
apiVersion: kuadrant.io/v1
56+
kind: DNSPolicy
57+
metadata:
58+
name: prod-web-azure
59+
labels:
60+
kuadrant.io/test-dns-provider: azure
61+
spec:
62+
targetRef:
63+
name: prod-web-istio-azure
64+
group: gateway.networking.k8s.io
65+
kind: Gateway
66+
providerRefs:
67+
- name: dns-provider-credentials-azure
68+
loadBalancing:
69+
defaultGeo: true
70+
geo: GEO-NA
71+
weight: 100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resources:
2+
- dnspolicy_prod-web-istio-loadbalanced.yaml
3+
4+
labels:
5+
- pairs:
6+
kuadrant.io/test-suite: manual
7+
kuadrant.io/test: dnspolicy_prod-web-istio-loadbalanced
8+
includeTemplates: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
apiVersion: kuadrant.io/v1
2+
kind: DNSPolicy
3+
metadata:
4+
name: prod-web-inmemory
5+
labels:
6+
kuadrant.io/test-dns-provider: inmemory
7+
spec:
8+
targetRef:
9+
name: prod-web-istio-inmemory
10+
group: gateway.networking.k8s.io
11+
kind: Gateway
12+
providerRefs:
13+
- name: dns-provider-credentials-inmemory
14+
---
15+
apiVersion: kuadrant.io/v1
16+
kind: DNSPolicy
17+
metadata:
18+
name: prod-web-aws
19+
labels:
20+
kuadrant.io/test-dns-provider: aws
21+
spec:
22+
targetRef:
23+
name: prod-web-istio-aws
24+
group: gateway.networking.k8s.io
25+
kind: Gateway
26+
providerRefs:
27+
- name: dns-provider-credentials-aws
28+
---
29+
apiVersion: kuadrant.io/v1
30+
kind: DNSPolicy
31+
metadata:
32+
name: prod-web-gcp
33+
labels:
34+
kuadrant.io/test-dns-provider: gcp
35+
spec:
36+
targetRef:
37+
name: prod-web-istio-gcp
38+
group: gateway.networking.k8s.io
39+
kind: Gateway
40+
providerRefs:
41+
- name: dns-provider-credentials-gcp
42+
---
43+
apiVersion: kuadrant.io/v1
44+
kind: DNSPolicy
45+
metadata:
46+
name: prod-web-azure
47+
labels:
48+
kuadrant.io/test-dns-provider: azure
49+
spec:
50+
targetRef:
51+
name: prod-web-istio-azure
52+
group: gateway.networking.k8s.io
53+
kind: Gateway
54+
providerRefs:
55+
- name: dns-provider-credentials-azure
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
resources:
2+
- dnspolicy_prod-web-istio-simple.yaml
3+
4+
labels:
5+
- pairs:
6+
kuadrant.io/test-suite: manual
7+
kuadrant.io/test: dnspolicy_prod-web-istio-simple
8+
includeTemplates: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: echo
5+
spec:
6+
ports:
7+
- name: http-port
8+
port: 8080
9+
targetPort: http-port
10+
protocol: TCP
11+
selector:
12+
app: echo
13+
---
14+
apiVersion: apps/v1
15+
kind: Deployment
16+
metadata:
17+
name: echo
18+
spec:
19+
replicas: 1
20+
selector:
21+
matchLabels:
22+
app: echo
23+
template:
24+
metadata:
25+
labels:
26+
app: echo
27+
spec:
28+
containers:
29+
- name: echo
30+
image: docker.io/jmalloc/echo-server
31+
ports:
32+
- name: http-port
33+
containerPort: 8080
34+
protocol: TCP
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
resources:
2+
- echo-app.yaml
3+
4+
labels:
5+
- pairs:
6+
kuadrant.io/test-suite: manual
7+
includeTemplates: true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
apiVersion: gateway.networking.k8s.io/v1beta1
2+
kind: Gateway
3+
metadata:
4+
name: prod-web-istio-inmemory
5+
labels:
6+
kuadrant.io/test-dns-provider: inmemory
7+
spec:
8+
gatewayClassName: istio
9+
listeners:
10+
- allowedRoutes:
11+
namespaces:
12+
from: Same
13+
name: api
14+
hostname: "myapp.kuadrant.local"
15+
port: 80
16+
protocol: HTTP
17+
- allowedRoutes:
18+
namespaces:
19+
from: Same
20+
name: api2
21+
hostname: "myapp2.kuadrant.local"
22+
port: 80
23+
protocol: HTTP
24+
- allowedRoutes:
25+
namespaces:
26+
from: Same
27+
name: api-secure
28+
hostname: "myapp.kuadrant.local"
29+
port: 443
30+
protocol: HTTPS
31+
- allowedRoutes:
32+
namespaces:
33+
from: Same
34+
name: api2-secure
35+
hostname: "myapp2.kuadrant.local"
36+
port: 443
37+
protocol: HTTPS
38+
---
39+
apiVersion: gateway.networking.k8s.io/v1beta1
40+
kind: Gateway
41+
metadata:
42+
name: prod-web-istio-aws
43+
labels:
44+
kuadrant.io/test-dns-provider: aws
45+
spec:
46+
gatewayClassName: istio
47+
listeners:
48+
- allowedRoutes:
49+
namespaces:
50+
from: Same
51+
name: api
52+
hostname: "myapp.scale.hcpapps.net"
53+
port: 80
54+
protocol: HTTP
55+
- allowedRoutes:
56+
namespaces:
57+
from: Same
58+
name: api2
59+
hostname: "myapp2.scale.hcpapps.net"
60+
port: 80
61+
protocol: HTTP
62+
- allowedRoutes:
63+
namespaces:
64+
from: Same
65+
name: api-secure
66+
hostname: "myapp.scale.hcpapps.net"
67+
port: 443
68+
protocol: HTTPS
69+
- allowedRoutes:
70+
namespaces:
71+
from: Same
72+
name: api2-secure
73+
hostname: "myapp2.scale.hcpapps.net"
74+
port: 443
75+
protocol: HTTPS
76+
---
77+
apiVersion: gateway.networking.k8s.io/v1beta1
78+
kind: Gateway
79+
metadata:
80+
name: prod-web-istio-gcp
81+
labels:
82+
kuadrant.io/test-dns-provider: gcp
83+
spec:
84+
gatewayClassName: istio
85+
listeners:
86+
- allowedRoutes:
87+
namespaces:
88+
from: Same
89+
name: api
90+
hostname: "myapp.scale.google.hcpapps.net"
91+
port: 80
92+
protocol: HTTP
93+
- allowedRoutes:
94+
namespaces:
95+
from: Same
96+
name: api2
97+
hostname: "myapp2.scale.google.hcpapps.net"
98+
port: 80
99+
protocol: HTTP
100+
- allowedRoutes:
101+
namespaces:
102+
from: Same
103+
name: api-secure
104+
hostname: "myapp.scale.google.hcpapps.net"
105+
port: 443
106+
protocol: HTTPS
107+
- allowedRoutes:
108+
namespaces:
109+
from: Same
110+
name: api2-secure
111+
hostname: "myapp2.scale.google.hcpapps.net"
112+
port: 443
113+
protocol: HTTPS
114+
---
115+
apiVersion: gateway.networking.k8s.io/v1beta1
116+
kind: Gateway
117+
metadata:
118+
name: prod-web-istio-azure
119+
labels:
120+
kuadrant.io/test-dns-provider: azure
121+
spec:
122+
gatewayClassName: istio
123+
listeners:
124+
- allowedRoutes:
125+
namespaces:
126+
from: Same
127+
name: api
128+
hostname: "myapp.scale.azure.hcpapps.net"
129+
port: 80
130+
protocol: HTTP
131+
- allowedRoutes:
132+
namespaces:
133+
from: Same
134+
name: api2
135+
hostname: "myapp2.scale.azure.hcpapps.net"
136+
port: 80
137+
protocol: HTTP
138+
- allowedRoutes:
139+
namespaces:
140+
from: Same
141+
name: api-secure
142+
hostname: "myapp.scale.azure.hcpapps.net"
143+
port: 443
144+
protocol: HTTPS
145+
- allowedRoutes:
146+
namespaces:
147+
from: Same
148+
name: api2-secure
149+
hostname: "myapp2.scale.azure.hcpapps.net"
150+
port: 443
151+
protocol: HTTPS

0 commit comments

Comments
 (0)