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

K8SPSMDB-807: Allow customizing replset name with custom config #1252

Merged
merged 13 commits into from
Sep 11, 2023
Merged

Conversation

egegunes
Copy link
Contributor

@egegunes egegunes commented Jul 11, 2023

K8SPSMDB-807 Powered by Pull Request Badge

CHANGE DESCRIPTION

Problem:
There are two problems:

  1. Config server replset name is hardcoded to cfg.
  2. Since the replset name is used in statefulset and service names, it needs to conform Kubernetes naming rules.

Solution:
Implemented a solution to override replset name using custom configuration:

configuration: |
  replication:
    replSetName: customCfgRS

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are the manifests (crd/bundle) regenerated if needed?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported MongoDB version?
  • Does the change support oldest and newest supported Kubernetes version?

@pull-request-size pull-request-size bot added the size/M 30-99 lines label Jul 11, 2023
* fix

* fix sharding

---------

Co-authored-by: Andrii Dema <[email protected]>
@pull-request-size pull-request-size bot added size/L 100-499 lines and removed size/M 30-99 lines labels Aug 23, 2023
wait_backup_agent $cluster-shard7-0
wait_backup_agent $cluster-shard7-1
wait_backup_agent $cluster-shard7-2
backup_name_aws="backup-aws-s3"
Copy link
Contributor

@nmarukovich nmarukovich Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we use only even shard numbers?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the CR is from a customer environment, following their setup

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember it. Oks. Could we add comment about it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, what do you want to see in comment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for me, It would be nice to add an explanation why we use this shards configuration

endpointUrl: https://storage.googleapis.com
image: percona/percona-server-mongodb:4.4.10-11
imagePullPolicy: Always
mongod:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@egegunes, we do not have mongod at all now. That is why you have a problem with this test.

Comment on lines 10 to 13
IMAGE_MONGOD_CHAIN=${IMAGE_MONGOD_CHAIN:-$'
perconalab/percona-server-mongodb-operator:main-mongod4.4
perconalab/percona-server-mongodb-operator:main-mongod5.0
perconalab/percona-server-mongodb-operator:main-mongod6.0'}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use this var in mongod-major-upgrade test.

Comment on lines 240 to 242

container.LivenessProbe.Exec.Command[0] = "/opt/percona/mongodb-healthcheck"
container.ReadinessProbe.Exec.Command[0] = "/opt/percona/mongodb-healthcheck"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to add for >= 1.15.0

@hors hors self-requested a review September 11, 2023 10:59
@JNKPercona
Copy link
Collaborator

Test name Status
arbiter passed
balancer passed
custom-replset-name passed
cross-site-sharded passed
data-at-rest-encryption passed
data-sharded passed
demand-backup passed
demand-backup-eks-credentials passed
demand-backup-physical passed
demand-backup-physical-sharded passed
demand-backup-sharded passed
expose-sharded passed
ignore-labels-annotations passed
init-deploy passed
finalizer passed
limits passed
liveness passed
mongod-major-upgrade passed
mongod-major-upgrade-sharded passed
monitoring-2-0 passed
multi-cluster-service passed
non-voting passed
one-pod passed
operator-self-healing-chaos passed
pitr passed
pitr-sharded passed
recover-no-primary passed
rs-shard-migration passed
scaling passed
scheduled-backup passed
security-context passed
self-healing-chaos passed
service-per-pod passed
serviceless-external-nodes passed
smart-update passed
storage passed
upgrade passed
upgrade-consistency passed
upgrade-consistency-sharded passed
upgrade-sharded passed
users passed
version-service passed
We run 42 out of 42

commit: 5d9ea86
image: perconalab/percona-server-mongodb-operator:PR-1252-5d9ea86b

@hors hors merged commit ec5a87c into main Sep 11, 2023
8 checks passed
@hors hors deleted the K8SPSMDB-807 branch September 11, 2023 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size/L 100-499 lines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants