Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

K8SPXC-1071: Add Percona scheduler for ProxySQL #1436

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4080,6 +4080,11 @@ spec:
type: object
priorityClassName:
type: string
pxchandler:
enum:
- internal
- scheduler
type: string
readinessDelaySec:
format: int32
type: integer
Expand Down
5 changes: 5 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4817,6 +4817,11 @@ spec:
type: object
priorityClassName:
type: string
pxchandler:
enum:
- internal
- scheduler
type: string
readinessDelaySec:
format: int32
type: integer
Expand Down
1 change: 1 addition & 0 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ spec:
gracePeriod: 30
proxysql:
enabled: false
pxchandler: internal
size: 3
image: perconalab/percona-xtradb-cluster-operator:main-proxysql
# imagePullPolicy: Always
Expand Down
5 changes: 5 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4817,6 +4817,11 @@ spec:
type: object
priorityClassName:
type: string
pxchandler:
enum:
- internal
- scheduler
type: string
readinessDelaySec:
format: int32
type: integer
Expand Down
5 changes: 5 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4817,6 +4817,11 @@ spec:
type: object
priorityClassName:
type: string
pxchandler:
enum:
- internal
- scheduler
type: string
readinessDelaySec:
format: int32
type: integer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-custom
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: custom-env-vars-proxysql
Expand Down Expand Up @@ -142,6 +144,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-custom
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: custom-env-vars-proxysql
Expand Down Expand Up @@ -175,6 +179,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-custom
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: custom-env-vars-proxysql
Expand Down
6 changes: 6 additions & 0 deletions e2e-tests/affinity/compare/statefulset_custom-proxysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-custom
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: custom-env-vars-proxysql
Expand Down Expand Up @@ -142,6 +144,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-custom
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: custom-env-vars-proxysql
Expand Down Expand Up @@ -175,6 +179,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-custom
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: custom-env-vars-proxysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-hostname
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: hostname-env-vars-proxysql
Expand Down Expand Up @@ -115,6 +117,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-hostname
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: hostname-env-vars-proxysql
Expand Down Expand Up @@ -148,6 +152,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-hostname
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: hostname-env-vars-proxysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-hostname
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: hostname-env-vars-proxysql
Expand Down Expand Up @@ -115,6 +117,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-hostname
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: hostname-env-vars-proxysql
Expand Down Expand Up @@ -148,6 +152,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-hostname
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: hostname-env-vars-proxysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-region
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: region-env-vars-proxysql
Expand Down Expand Up @@ -115,6 +117,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-region
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: region-env-vars-proxysql
Expand Down Expand Up @@ -148,6 +152,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-region
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: region-env-vars-proxysql
Expand Down
6 changes: 6 additions & 0 deletions e2e-tests/affinity/compare/statefulset_region-proxysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-region
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: region-env-vars-proxysql
Expand Down Expand Up @@ -115,6 +117,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-region
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: region-env-vars-proxysql
Expand Down Expand Up @@ -148,6 +152,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-region
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: region-env-vars-proxysql
Expand Down
6 changes: 6 additions & 0 deletions e2e-tests/affinity/compare/statefulset_zone-proxysql-oc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-zone
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: zone-env-vars-proxysql
Expand Down Expand Up @@ -115,6 +117,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-zone
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: zone-env-vars-proxysql
Expand Down Expand Up @@ -148,6 +152,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-zone
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: zone-env-vars-proxysql
Expand Down
6 changes: 6 additions & 0 deletions e2e-tests/affinity/compare/statefulset_zone-proxysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-zone
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: zone-env-vars-proxysql
Expand Down Expand Up @@ -115,6 +117,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-zone
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: zone-env-vars-proxysql
Expand Down Expand Up @@ -148,6 +152,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-zone
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: zone-env-vars-proxysql
Expand Down
8 changes: 5 additions & 3 deletions e2e-tests/functions
Original file line number Diff line number Diff line change
Expand Up @@ -561,12 +561,14 @@ compare_mysql_cmd_local() {

get_proxy_primary() {
local uri="$1"
local pod="$2"
local ip=$(run_mysql_local "SELECT hostname FROM runtime_mysql_servers WHERE hostgroup_id=11 AND status='ONLINE';" "$uri" "$pod" 'proxysql')
local cluster_name="$2"
local hostgroup=11

local ip=$(run_mysql_local "SELECT hostname FROM runtime_mysql_servers WHERE hostgroup_id='$hostgroup' AND status='ONLINE';" "$uri" "$cluster_name-proxysql-0" 'proxysql')

while [ $(echo "$ip" | wc -l) != 1 ]; do
sleep 1
ip=$(run_mysql_local "SELECT hostname FROM runtime_mysql_servers WHERE hostgroup_id=11 AND status='ONLINE';" "$uri" "$pod" 'proxysql')
ip=$(run_mysql_local "SELECT hostname FROM runtime_mysql_servers WHERE hostgroup_id='$hostgroup' AND status='ONLINE';" "$uri" "$cluster_name-proxysql-0" 'proxysql')
done

echo $ip | cut -d'.' -f1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down Expand Up @@ -117,6 +119,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down Expand Up @@ -150,6 +154,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down Expand Up @@ -117,6 +119,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down Expand Up @@ -150,6 +154,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down Expand Up @@ -117,6 +119,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down Expand Up @@ -150,6 +154,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down
6 changes: 6 additions & 0 deletions e2e-tests/haproxy/compare/statefulset_haproxy-proxysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down Expand Up @@ -117,6 +119,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down Expand Up @@ -150,6 +154,8 @@ spec:
secretKeyRef:
key: monitor
name: internal-haproxy
- name: PXC_HANDLER
value: internal
envFrom:
- secretRef:
name: haproxy-env-vars-proxysql
Expand Down
Loading