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-admin for proxysql #1198

Closed
wants to merge 33 commits into from
Closed
Show file tree
Hide file tree
Changes from 24 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ff6da28
K8SPXC-1071 - Replace proxysql-admin with percona-scheduler-admin for…
tplavcic Aug 3, 2022
db708ea
K8SPXC-1071 - Make percona-scheduler-admin usage optional
tplavcic Aug 23, 2022
0bbb91b
Fix bundle and crd
tplavcic Aug 23, 2022
708f2f1
Add validation
tplavcic Aug 24, 2022
3a120a1
Error fixes
inelpandzic Aug 24, 2022
f0b5f1c
fix build errors
egegunes Aug 24, 2022
43b6eac
K8SPXC-1071 - Add SCHEDULER environment var for proxysql container
tplavcic Aug 24, 2022
838743d
K8SPXC-1071 - Set default value for proxysql scheduler
tplavcic Aug 24, 2022
aebc421
Update manifest
tplavcic Sep 8, 2022
8f347e5
K8SPXC-1071 - Fix validation for proxysql scheduler field
tplavcic Sep 8, 2022
cd47303
Fix tests
tplavcic Sep 9, 2022
be12151
Remove different writer hostgroup for percona scheduler
tplavcic Sep 15, 2022
aa469ca
Remove scheduler as parameter for PrimaryHost function
tplavcic Sep 15, 2022
0877108
Revert proxysql hostgroup to the old one in e2e-tests/functions
tplavcic Sep 16, 2022
370fad6
Leverage k8s API validation for Scheduler field
tplavcic Oct 17, 2022
49a5b87
Check mysql_galera_hostgroups only if proxysql-admin scheduler used
tplavcic Oct 18, 2022
a5fc590
Update tests
tplavcic Oct 28, 2022
8874e75
Merge branch 'main' into proxysql-scheduler
tplavcic Nov 4, 2022
7d4e5ce
Return writeID to original position and type
tplavcic Nov 4, 2022
578029b
Remove empty line
tplavcic Nov 4, 2022
8535d08
Switch default scheduler in code to proxysql-admin
tplavcic Nov 7, 2022
333cf06
Update tests
tplavcic Nov 7, 2022
e53f236
Merge branch 'main' into proxysql-scheduler
tplavcic Nov 14, 2022
71298a3
Rename proxysql scheduler to pxchandler
tplavcic Nov 14, 2022
49a0709
Fix validation for pxchandler for new variabe names
tplavcic Nov 16, 2022
e40e834
Update manifest
tplavcic Nov 16, 2022
1bafb5c
Fix self-healing-chaos test
tplavcic Nov 16, 2022
0a2b381
Merge branch 'main' into proxysql-scheduler
tplavcic Nov 24, 2022
e82bbb7
Update manifests
tplavcic Nov 24, 2022
3c58308
Update manifests
tplavcic Nov 24, 2022
52cd85f
Merge branch 'main' into proxysql-scheduler
tplavcic Jan 5, 2023
e8743f9
Fix merge error
tplavcic Jan 5, 2023
6f56ee0
Fix review comment
tplavcic Jan 5, 2023
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
2 changes: 2 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12577,6 +12577,8 @@ spec:
type: object
runtimeClassName:
type: string
pxchandler:
type: string
schedulerName:
type: string
serviceAccountName:
Expand Down
1 change: 1 addition & 0 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ spec:
gracePeriod: 30
proxysql:
enabled: false
pxchandler: internal
size: 3
image: perconalab/percona-xtradb-cluster-operator:main-proxysql
# imagePullPolicy: Always
Expand Down
2 changes: 2 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12577,6 +12577,8 @@ spec:
type: object
runtimeClassName:
type: string
pxchandler:
type: string
schedulerName:
type: string
serviceAccountName:
Expand Down
2 changes: 2 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12577,6 +12577,8 @@ spec:
type: object
runtimeClassName:
type: string
pxchandler:
type: string
schedulerName:
type: string
serviceAccountName:
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 @@ -479,12 +479,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