Skip to content

Commit

Permalink
Merge branch 'main' into K8SPSMDB-1088
Browse files Browse the repository at this point in the history
  • Loading branch information
inelpandzic authored Nov 28, 2024
2 parents 1348d2d + 437ac69 commit 705f75c
Show file tree
Hide file tree
Showing 64 changed files with 1,482 additions and 263 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ You can get early access to new product features, invite-only ”ask me anything

# Roadmap

We have an experimental public roadmap which can be found [here](https://github.com/percona/roadmap/projects/1). Please feel free to contribute and propose new features by following the roadmap [guidelines](https://github.com/percona/roadmap).
We have a public roadmap which can be found [here](https://github.com/orgs/percona/projects/10). Please feel free to contribute and propose new features by following the roadmap [guidelines](https://github.com/percona/roadmap).

# Submitting Bug Reports

Expand Down
5 changes: 4 additions & 1 deletion deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ spec:
# clusterServiceDNSMode: "Internal"
# pause: true
# unmanaged: false
# enableVolumeExpansion: true
# enableVolumeExpansion: false
crVersion: 1.19.0
image: perconalab/percona-server-mongodb-operator:main-mongod7.0
imagePullPolicy: Always
Expand Down Expand Up @@ -231,6 +231,7 @@ spec:
# labels:
# rack: rack-22
# internalTrafficPolicy: Local
# externalTrafficPolicy: Local
resources:
limits:
cpu: "300m"
Expand Down Expand Up @@ -443,6 +444,7 @@ spec:
# labels:
# rack: rack-22
# internalTrafficPolicy: Local
# externalTrafficPolicy: Local
resources:
limits:
cpu: "300m"
Expand Down Expand Up @@ -554,6 +556,7 @@ spec:
# rack: rack-22
# nodePort: 32017
# internalTrafficPolicy: Local
# externalTrafficPolicy: Local
# hostAliases:
# - ip: "10.10.0.2"
# hostnames:
Expand Down
20 changes: 11 additions & 9 deletions e2e-tests/cross-site-sharded/run
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ replica_cluster="cross-site-sharded-replica"
wait_for_members() {
local endpoint="$1"
local rsName="$2"
local nodes_amount=0
until [[ ${nodes_amount} == 6 ]]; do
nodes_amount=$(run_mongos 'rs.conf().members.length' "clusterAdmin:clusterAdmin123456@$endpoint" "mongodb" ":27017" \
local target_count=$3

local nodes_count=0
until [[ ${nodes_count} == ${target_count} ]]; do
nodes_count=$(run_mongos 'rs.conf().members.length' "clusterAdmin:clusterAdmin123456@$endpoint" "mongodb" ":27017" \
| egrep -v 'I NETWORK|W NETWORK|Error saving history file|Percona Server for MongoDB|connecting to:|Unable to reach primary for set|Implicit session:|versions do not match|Error saving history file:|bye' \
| $sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxx.svc/')

echo "waiting for all members to be configured in ${rsName}"
echo -n "waiting for all members to be configured in ${rsName}"
let retry+=1
if [ $retry -ge 15 ]; then
echo "Max retry count $retry reached. something went wrong with mongo cluster. Config for endpoint $endpoint has $nodes_amount but expected 6."
echo "Max retry count ${retry} reached. something went wrong with mongo cluster. Config for endpoint ${endpoint} has ${nodes_count} but expected ${target_count}."
exit 1
fi
echo -n .
echo .
sleep 10
done
}
Expand Down Expand Up @@ -164,9 +166,9 @@ kubectl_bin patch psmdb ${main_cluster} --type=merge --patch '{
}
}'

wait_for_members $replica_cfg_0_endpoint cfg
wait_for_members $replica_rs0_0_endpoint rs0
wait_for_members $replica_rs1_0_endpoint rs1
wait_for_members $replica_cfg_0_endpoint cfg 6
wait_for_members $replica_rs0_0_endpoint rs0 6
wait_for_members $replica_rs1_0_endpoint rs1 6

kubectl_bin config set-context $(kubectl_bin config current-context) --namespace="$replica_namespace"

Expand Down
122 changes: 122 additions & 0 deletions e2e-tests/custom-users-roles-sharded/compare/role-one-50.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
switched to db admin
{
"_id" : "admin.role-one",
"role" : "role-one",
"db" : "admin",
"privileges" : [
{
"resource" : {
"cluster" : true
},
"actions" : [
"addShard"
]
},
{
"resource" : {
"db" : "config",
"collection" : ""
},
"actions" : [
"find",
"insert",
"remove",
"update"
]
}
],
"roles" : [
{
"role" : "read",
"db" : "admin"
}
],
"authenticationRestrictions" : [
[
{
"clientSource" : [
"127.0.0.1"
],
"serverAddress" : [
"127.0.0.1"
]
}
]
],
"inheritedRoles" : [
{
"role" : "read",
"db" : "admin"
}
],
"inheritedPrivileges" : [
{
"resource" : {
"cluster" : true
},
"actions" : [
"addShard"
]
},
{
"resource" : {
"db" : "config",
"collection" : ""
},
"actions" : [
"find",
"insert",
"remove",
"update"
]
},
{
"resource" : {
"db" : "admin",
"collection" : ""
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "admin",
"collection" : "system.js"
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
}
],
"inheritedAuthenticationRestrictions" : [
[
{
"clientSource" : [
"127.0.0.1"
],
"serverAddress" : [
"127.0.0.1"
]
}
]
],
"isBuiltin" : false
}
bye
78 changes: 78 additions & 0 deletions e2e-tests/custom-users-roles-sharded/compare/role-two-50.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
switched to db admin
{
"_id" : "admin.role-two",
"role" : "role-two",
"db" : "admin",
"privileges" : [
{
"resource" : {
"db" : "config",
"collection" : ""
},
"actions" : [
"find"
]
}
],
"roles" : [
{
"role" : "read",
"db" : "admin"
}
],
"authenticationRestrictions" : [ ],
"inheritedRoles" : [
{
"role" : "read",
"db" : "admin"
}
],
"inheritedPrivileges" : [
{
"resource" : {
"db" : "config",
"collection" : ""
},
"actions" : [
"find"
]
},
{
"resource" : {
"db" : "admin",
"collection" : ""
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
},
{
"resource" : {
"db" : "admin",
"collection" : "system.js"
},
"actions" : [
"changeStream",
"collStats",
"dbHash",
"dbStats",
"find",
"killCursors",
"listCollections",
"listIndexes",
"planCacheRead"
]
}
],
"inheritedAuthenticationRestrictions" : [ ],
"isBuiltin" : false
}
bye
4 changes: 4 additions & 0 deletions e2e-tests/custom-users-roles-sharded/run
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ compare() {
local uri="$3"
local target="$4"

if [[ $IMAGE_MONGOD =~ 5\.0 ]] && [ -f ${test_dir}/compare/$target-50.json ]; then
target=$target-50
fi

run_mongos "use ${database}\n ${command}" "$uri" "mongodb" \
| egrep -v 'I NETWORK|W NETWORK|F NETWORK|Error saving history file|Percona Server for MongoDB|connecting to:|Unable to reach primary for set|Implicit session:|versions do not match|Error saving history file:' \
| $sed -re 's/ObjectId\("[0-9a-f]+"\)//; s/-[0-9]+.svc/-xxxesvc/' \
Expand Down
Loading

0 comments on commit 705f75c

Please sign in to comment.