Skip to content

Commit 2098af8

Browse files
authored
K8SPS-162: enable X protocol for HAProxy (#376)
* K8SPS-162: enable X protocol for HAProxy https://jira.percona.com/browse/K8SPS-162 * rename `mysql-x` to `mysqlx`
1 parent 0982d37 commit 2098af8

File tree

8 files changed

+41
-4
lines changed

8 files changed

+41
-4
lines changed

e2e-tests/tests/async-ignore-annotations/01-assert.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ spec:
9393
port: 3309
9494
protocol: TCP
9595
targetPort: 3309
96+
- name: mysqlx
97+
port: 33060
98+
protocol: TCP
99+
targetPort: 33060
96100
selector:
97101
app.kubernetes.io/component: haproxy
98102
app.kubernetes.io/instance: async-ignore-annotations

e2e-tests/tests/async-ignore-annotations/02-assert.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ spec:
8989
port: 3309
9090
protocol: TCP
9191
targetPort: 3309
92+
- name: mysqlx
93+
port: 33060
94+
protocol: TCP
95+
targetPort: 33060
9296
selector:
9397
app.kubernetes.io/component: haproxy
9498
app.kubernetes.io/instance: async-ignore-annotations

e2e-tests/tests/async-ignore-annotations/04-assert.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ spec:
9595
port: 3309
9696
protocol: TCP
9797
targetPort: 3309
98+
- name: mysqlx
99+
port: 33060
100+
protocol: TCP
101+
targetPort: 33060
98102
selector:
99103
app.kubernetes.io/component: haproxy
100104
app.kubernetes.io/instance: async-ignore-annotations

e2e-tests/tests/async-ignore-annotations/05-assert.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ spec:
9090
port: 3309
9191
protocol: TCP
9292
targetPort: 3309
93+
- name: mysqlx
94+
port: 33060
95+
protocol: TCP
96+
targetPort: 33060
9397
selector:
9498
app.kubernetes.io/component: haproxy
9599
app.kubernetes.io/instance: async-ignore-annotations

e2e-tests/tests/async-ignore-annotations/06-assert.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ spec:
9090
port: 3309
9191
protocol: TCP
9292
targetPort: 3309
93+
- name: mysqlx
94+
port: 33060
95+
protocol: TCP
96+
targetPort: 33060
9397
selector:
9498
app.kubernetes.io/component: haproxy
9599
app.kubernetes.io/instance: async-ignore-annotations

e2e-tests/tests/async-ignore-annotations/07-assert.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ spec:
8686
port: 3309
8787
protocol: TCP
8888
targetPort: 3309
89+
- name: mysqlx
90+
port: 33060
91+
protocol: TCP
92+
targetPort: 33060
8993
selector:
9094
app.kubernetes.io/component: haproxy
9195
app.kubernetes.io/instance: async-ignore-annotations

e2e-tests/tests/haproxy/01-assert.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ spec:
9393
port: 3309
9494
protocol: TCP
9595
targetPort: 3309
96+
- name: mysqlx
97+
port: 33060
98+
protocol: TCP
99+
targetPort: 33060
96100
selector:
97101
app.kubernetes.io/component: haproxy
98102
app.kubernetes.io/instance: haproxy

pkg/haproxy/haproxy.go

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ const (
2323
)
2424

2525
const (
26-
PortMySQL = 3306
27-
PortMySQLReplicas = 3307
28-
PortProxyProtocol = 3309
29-
PortPMMStats = 8404
26+
PortMySQL = 3306
27+
PortMySQLReplicas = 3307
28+
PortProxyProtocol = 3309
29+
PortMySQLXProtocol = 33060
30+
PortPMMStats = 8404
3031
)
3132

3233
func Name(cr *apiv1alpha1.PerconaServerMySQL) string {
@@ -76,6 +77,10 @@ func Service(cr *apiv1alpha1.PerconaServerMySQL, secret *corev1.Secret) *corev1.
7677
Name: "proxy-protocol",
7778
Port: int32(PortProxyProtocol),
7879
},
80+
{
81+
Name: "mysqlx",
82+
Port: int32(PortMySQLXProtocol),
83+
},
7984
}
8085

8186
if cr.PMMEnabled(secret) {
@@ -229,6 +234,10 @@ func haproxyContainer(cr *apiv1alpha1.PerconaServerMySQL) corev1.Container {
229234
Name: "proxy-protocol",
230235
ContainerPort: int32(PortProxyProtocol),
231236
},
237+
{
238+
Name: "mysqlx",
239+
ContainerPort: int32(PortMySQLXProtocol),
240+
},
232241
},
233242
VolumeMounts: []corev1.VolumeMount{
234243
{

0 commit comments

Comments
 (0)