Skip to content

Commit 4c646de

Browse files
egeguneshorsgithub-actions[bot]inelpandzic
authored
K8SPSMDB-929: Add replicaSet horizons (#1293)
* K8SPSMDB-929: Add replicaSet horizons * add test * Update e2e-tests/split-horizon/run Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update e2e-tests/split-horizon/run Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update e2e-tests/split-horizon/run Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update e2e-tests/split-horizon/run Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update e2e-tests/split-horizon/run Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update e2e-tests/split-horizon/run Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update e2e-tests/split-horizon/run Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Update e2e-tests/split-horizon/run Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix build * fix version-service test --------- Co-authored-by: Viacheslav Sarzhan <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Inel Pandzic <[email protected]>
1 parent 45f31b4 commit 4c646de

File tree

21 files changed

+445
-10
lines changed

21 files changed

+445
-10
lines changed

config/crd/bases/psmdb.percona.com_perconaservermongodbs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7130,6 +7130,12 @@ spec:
71307130
size:
71317131
format: int32
71327132
type: integer
7133+
splitHorizons:
7134+
additionalProperties:
7135+
additionalProperties:
7136+
type: string
7137+
type: object
7138+
type: object
71337139
storage:
71347140
properties:
71357141
directoryPerDB:
@@ -14080,6 +14086,12 @@ spec:
1408014086
size:
1408114087
format: int32
1408214088
type: integer
14089+
splitHorizons:
14090+
additionalProperties:
14091+
additionalProperties:
14092+
type: string
14093+
type: object
14094+
type: object
1408314095
storage:
1408414096
properties:
1408514097
directoryPerDB:

deploy/bundle.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7735,6 +7735,12 @@ spec:
77357735
size:
77367736
format: int32
77377737
type: integer
7738+
splitHorizons:
7739+
additionalProperties:
7740+
additionalProperties:
7741+
type: string
7742+
type: object
7743+
type: object
77387744
storage:
77397745
properties:
77407746
directoryPerDB:
@@ -14685,6 +14691,12 @@ spec:
1468514691
size:
1468614692
format: int32
1468714693
type: integer
14694+
splitHorizons:
14695+
additionalProperties:
14696+
additionalProperties:
14697+
type: string
14698+
type: object
14699+
type: object
1468814700
storage:
1468914701
properties:
1469014702
directoryPerDB:

deploy/cr.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,16 @@ spec:
167167
podDisruptionBudget:
168168
maxUnavailable: 1
169169
# minAvailable: 0
170+
# splitHorizons:
171+
# my-cluster-name-rs0-0:
172+
# external: rs0-0.mycluster.xyz
173+
# external-2: rs0-0.mycluster2.xyz
174+
# my-cluster-name-rs0-1:
175+
# external: rs0-1.mycluster.xyz
176+
# external-2: rs0-1.mycluster2.xyz
177+
# my-cluster-name-rs0-2:
178+
# external: rs0-2.mycluster.xyz
179+
# external-2: rs0-2.mycluster2.xyz
170180
expose:
171181
enabled: false
172182
exposeType: ClusterIP

deploy/crd.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7735,6 +7735,12 @@ spec:
77357735
size:
77367736
format: int32
77377737
type: integer
7738+
splitHorizons:
7739+
additionalProperties:
7740+
additionalProperties:
7741+
type: string
7742+
type: object
7743+
type: object
77387744
storage:
77397745
properties:
77407746
directoryPerDB:
@@ -14685,6 +14691,12 @@ spec:
1468514691
size:
1468614692
format: int32
1468714693
type: integer
14694+
splitHorizons:
14695+
additionalProperties:
14696+
additionalProperties:
14697+
type: string
14698+
type: object
14699+
type: object
1468814700
storage:
1468914701
properties:
1469014702
directoryPerDB:

deploy/cw-bundle.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7735,6 +7735,12 @@ spec:
77357735
size:
77367736
format: int32
77377737
type: integer
7738+
splitHorizons:
7739+
additionalProperties:
7740+
additionalProperties:
7741+
type: string
7742+
type: object
7743+
type: object
77387744
storage:
77397745
properties:
77407746
directoryPerDB:
@@ -14685,6 +14691,12 @@ spec:
1468514691
size:
1468614692
format: int32
1468714693
type: integer
14694+
splitHorizons:
14695+
additionalProperties:
14696+
additionalProperties:
14697+
type: string
14698+
type: object
14699+
type: object
1468814700
storage:
1468914701
properties:
1469014702
directoryPerDB:

e2e-tests/functions

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,19 @@ run_mongo() {
693693

694694
}
695695

696+
run_mongo_tls() {
697+
local command="$1"
698+
local uri="$2"
699+
local driver=${3:-mongodb+srv}
700+
local suffix=${4:-.svc.cluster.local}
701+
local client_container=$(kubectl_bin get pods --selector=name=psmdb-client -o 'jsonpath={.items[].metadata.name}')
702+
local mongo_flag="$5"
703+
[[ $uri == *cfg* ]] && replica_set='cfg' || replica_set='rs0'
704+
kubectl_bin exec ${client_container} -- \
705+
bash -c "printf '$command\n' | mongo $driver://$uri$suffix/admin?replicaSet=$replica_set --tls --tlsCAFile /etc/mongodb-ssl/ca.crt --tlsCertificateKeyFile /tmp/tls.pem --tlsAllowInvalidHostnames $mongo_flag"
706+
707+
}
708+
696709
run_mongos() {
697710
local command="$1"
698711
local uri="$2"

e2e-tests/run-distro.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ pitr-physical
2020
recover-no-primary
2121
rs-shard-migration
2222
scaling
23+
split-horizon
2324
tls-issue-cert-manager
2425
upgrade
2526
upgrade-sharded

e2e-tests/run-pr.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ self-healing-chaos
3434
service-per-pod
3535
serviceless-external-nodes
3636
smart-update
37+
split-horizon
3738
storage
3839
tls-issue-cert-manager
3940
upgrade

e2e-tests/run-release.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ self-healing-chaos
3535
service-per-pod
3636
serviceless-external-nodes
3737
smart-update
38+
split-horizon
3839
storage
3940
tls-issue-cert-manager
4041
upgrade
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[
2+
{
3+
"external" : "some-name-rs0-0.clouddemo.xyz:27017"
4+
},
5+
{
6+
"external" : "some-name-rs0-1.clouddemo.xyz:27017"
7+
},
8+
{
9+
"external" : "some-name-rs0-2.clouddemo.xyz:27017"
10+
}
11+
]

0 commit comments

Comments
 (0)