File tree Expand file tree Collapse file tree 18 files changed +594
-86
lines changed
e2e-tests/tests/gr-one-pod Expand file tree Collapse file tree 18 files changed +594
-86
lines changed Original file line number Diff line number Diff line change @@ -396,6 +396,8 @@ type MySQLRouterSpec struct {
396
396
397
397
Expose ServiceExpose `json:"expose,omitempty"`
398
398
399
+ Ports []corev1.ServicePort `json:"ports,omitempty"`
400
+
399
401
PodSpec `json:",inline"`
400
402
}
401
403
Original file line number Diff line number Diff line change @@ -8496,6 +8496,31 @@ spec:
8496
8496
type : string
8497
8497
type : object
8498
8498
type : object
8499
+ ports :
8500
+ items :
8501
+ properties :
8502
+ appProtocol :
8503
+ type : string
8504
+ name :
8505
+ type : string
8506
+ nodePort :
8507
+ format : int32
8508
+ type : integer
8509
+ port :
8510
+ format : int32
8511
+ type : integer
8512
+ protocol :
8513
+ default : TCP
8514
+ type : string
8515
+ targetPort :
8516
+ anyOf :
8517
+ - type : integer
8518
+ - type : string
8519
+ x-kubernetes-int-or-string : true
8520
+ required :
8521
+ - port
8522
+ type : object
8523
+ type : array
8499
8524
priorityClassName :
8500
8525
type : string
8501
8526
readinessProbe :
Original file line number Diff line number Diff line change @@ -10419,6 +10419,31 @@ spec:
10419
10419
type: string
10420
10420
type: object
10421
10421
type: object
10422
+ ports:
10423
+ items:
10424
+ properties:
10425
+ appProtocol:
10426
+ type: string
10427
+ name:
10428
+ type: string
10429
+ nodePort:
10430
+ format: int32
10431
+ type: integer
10432
+ port:
10433
+ format: int32
10434
+ type: integer
10435
+ protocol:
10436
+ default: TCP
10437
+ type: string
10438
+ targetPort:
10439
+ anyOf:
10440
+ - type: integer
10441
+ - type: string
10442
+ x-kubernetes-int-or-string: true
10443
+ required:
10444
+ - port
10445
+ type: object
10446
+ type: array
10422
10447
priorityClassName:
10423
10448
type: string
10424
10449
readinessProbe:
Original file line number Diff line number Diff line change @@ -258,7 +258,34 @@ spec:
258
258
image : percona/percona-mysql-router:8.0.42
259
259
imagePullPolicy : Always
260
260
# initImage: percona/percona-server-mysql-operator:0.10.0
261
-
261
+ # ports:
262
+ # - name: http
263
+ # port: 8443
264
+ # targetPort: 0
265
+ # - name: rw-default
266
+ # port: 3306
267
+ # targetPort: 6446
268
+ # - name: read-write
269
+ # port: 6446
270
+ # targetPort: 0
271
+ # - name: read-only
272
+ # port: 6447
273
+ # targetPort: 0
274
+ # - name: x-read-write
275
+ # port: 6448
276
+ # targetPort: 0
277
+ # - name: x-read-only
278
+ # port: 6449
279
+ # targetPort: 0
280
+ # - name: x-default
281
+ # port: 33060
282
+ # targetPort: 0
283
+ # - name: rw-admin
284
+ # port: 33062
285
+ # targetPort: 0
286
+ # - name: custom-port
287
+ # port: 1111
288
+ # targetPort: 6446
262
289
size : 3
263
290
264
291
resources :
Original file line number Diff line number Diff line change @@ -10419,6 +10419,31 @@ spec:
10419
10419
type: string
10420
10420
type: object
10421
10421
type: object
10422
+ ports:
10423
+ items:
10424
+ properties:
10425
+ appProtocol:
10426
+ type: string
10427
+ name:
10428
+ type: string
10429
+ nodePort:
10430
+ format: int32
10431
+ type: integer
10432
+ port:
10433
+ format: int32
10434
+ type: integer
10435
+ protocol:
10436
+ default: TCP
10437
+ type: string
10438
+ targetPort:
10439
+ anyOf:
10440
+ - type: integer
10441
+ - type: string
10442
+ x-kubernetes-int-or-string: true
10443
+ required:
10444
+ - port
10445
+ type: object
10446
+ type: array
10422
10447
priorityClassName:
10423
10448
type: string
10424
10449
readinessProbe:
Original file line number Diff line number Diff line change @@ -10419,6 +10419,31 @@ spec:
10419
10419
type: string
10420
10420
type: object
10421
10421
type: object
10422
+ ports:
10423
+ items:
10424
+ properties:
10425
+ appProtocol:
10426
+ type: string
10427
+ name:
10428
+ type: string
10429
+ nodePort:
10430
+ format: int32
10431
+ type: integer
10432
+ port:
10433
+ format: int32
10434
+ type: integer
10435
+ protocol:
10436
+ default: TCP
10437
+ type: string
10438
+ targetPort:
10439
+ anyOf:
10440
+ - type: integer
10441
+ - type: string
10442
+ x-kubernetes-int-or-string: true
10443
+ required:
10444
+ - port
10445
+ type: object
10446
+ type: array
10422
10447
priorityClassName:
10423
10448
type: string
10424
10449
readinessProbe:
Original file line number Diff line number Diff line change @@ -27,6 +27,47 @@ metadata:
27
27
name : gr-one-pod-router
28
28
spec :
29
29
replicas : 1
30
+ template :
31
+ spec :
32
+ containers :
33
+ - args :
34
+ - mysqlrouter
35
+ - -c
36
+ - /tmp/router/mysqlrouter.conf
37
+ command :
38
+ - /opt/percona/router-entrypoint.sh
39
+ env :
40
+ - name : MYSQL_SERVICE_NAME
41
+ value : gr-one-pod-mysql
42
+ name : router
43
+ ports :
44
+ - containerPort : 8443
45
+ name : http
46
+ protocol : TCP
47
+ - containerPort : 6446
48
+ name : rw-default
49
+ protocol : TCP
50
+ - containerPort : 6446
51
+ name : read-write
52
+ protocol : TCP
53
+ - containerPort : 6447
54
+ name : read-only
55
+ protocol : TCP
56
+ - containerPort : 6448
57
+ name : x-read-write
58
+ protocol : TCP
59
+ - containerPort : 6449
60
+ name : x-read-only
61
+ protocol : TCP
62
+ - containerPort : 33060
63
+ name : x-default
64
+ protocol : TCP
65
+ - containerPort : 33062
66
+ name : rw-admin
67
+ protocol : TCP
68
+ - containerPort : 3333
69
+ name : custom-port
70
+ protocol : TCP
30
71
status :
31
72
availableReplicas : 1
32
73
observedGeneration : 1
@@ -58,3 +99,67 @@ status:
58
99
size : 1
59
100
state : ready
60
101
state : ready
102
+ ---
103
+ apiVersion : v1
104
+ kind : Service
105
+ metadata :
106
+ labels :
107
+ app.kubernetes.io/component : router
108
+ app.kubernetes.io/instance : gr-one-pod
109
+ app.kubernetes.io/managed-by : percona-server-operator
110
+ app.kubernetes.io/name : percona-server
111
+ app.kubernetes.io/part-of : percona-server
112
+ name : gr-one-pod-router
113
+ spec :
114
+ internalTrafficPolicy : Cluster
115
+ ipFamilies :
116
+ - IPv4
117
+ ipFamilyPolicy : SingleStack
118
+ ports :
119
+ - name : http
120
+ port : 8443
121
+ protocol : TCP
122
+ targetPort : 8443
123
+ - name : rw-default
124
+ port : 1111
125
+ protocol : TCP
126
+ targetPort : 6446
127
+ - name : read-write
128
+ port : 6446
129
+ protocol : TCP
130
+ targetPort : 6446
131
+ - name : read-only
132
+ port : 6447
133
+ protocol : TCP
134
+ targetPort : 6447
135
+ - name : x-read-write
136
+ port : 6448
137
+ protocol : TCP
138
+ targetPort : 6448
139
+ - name : x-read-only
140
+ port : 6449
141
+ protocol : TCP
142
+ targetPort : 6449
143
+ - name : x-default
144
+ port : 33060
145
+ protocol : TCP
146
+ targetPort : 33060
147
+ - name : rw-admin
148
+ port : 33062
149
+ protocol : TCP
150
+ targetPort : 33062
151
+ - name : custom-port
152
+ port : 2222
153
+ protocol : TCP
154
+ targetPort : 3333
155
+ selector :
156
+ app.kubernetes.io/component : router
157
+ app.kubernetes.io/instance : gr-one-pod
158
+ app.kubernetes.io/managed-by : percona-server-operator
159
+ app.kubernetes.io/name : percona-server
160
+ app.kubernetes.io/part-of : percona-server
161
+ sessionAffinity : None
162
+ type : ClusterIP
163
+ status :
164
+ loadBalancer : {}
165
+
Original file line number Diff line number Diff line change @@ -17,6 +17,11 @@ commands:
17
17
| yq eval ".spec.mysql.size=1" - \
18
18
| yq eval ".spec.proxy.haproxy.enabled=false" - \
19
19
| yq eval ".spec.proxy.router.size=1" - \
20
+ | yq eval '.spec.proxy.router.ports[0].name="rw-default"' - \
21
+ | yq eval ".spec.proxy.router.ports[0].port=1111" - \
22
+ | yq eval '.spec.proxy.router.ports[1].name="custom-port"' - \
23
+ | yq eval ".spec.proxy.router.ports[1].port=2222" - \
24
+ | yq eval ".spec.proxy.router.ports[1].targetPort=3333" - \
20
25
| yq eval ".spec.orchestrator.enabled=false" - \
21
26
| yq eval '.spec.backup.storages.minio.type="s3"' - \
22
27
| yq eval '.spec.backup.storages.minio.s3.bucket="operator-testing"' - \
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ commands:
9
9
10
10
run_mysql \
11
11
"CREATE DATABASE IF NOT EXISTS myDB; CREATE TABLE IF NOT EXISTS myDB.myTable (id int PRIMARY KEY)" \
12
- "-h $(get_router_service $(get_cluster_name)) -uroot -proot_password"
12
+ "-h $(get_router_service $(get_cluster_name)) -P1111 - uroot -proot_password"
13
13
14
14
run_mysql \
15
15
"INSERT myDB.myTable (id) VALUES (100500)" \
16
- "-h $(get_router_service $(get_cluster_name)) -uroot -proot_password"
16
+ "-h $(get_router_service $(get_cluster_name)) -P1111 - uroot -proot_password"
You can’t perform that action at this time.
0 commit comments