charts icon indicating copy to clipboard operation
charts copied to clipboard

[bitnami/mongodb] fix: initial primary host variable for arbiter and hidden replicas

Open romanj85 opened this issue 1 year ago • 3 comments

Description of the change

The environment variable MONGODB_INITIAL_PRIMARY_HOST was incorrectly populated in the original code with the name of its headless service. I.e. for arbiters -> %s-arbiter-headless and for hidden replicas -> "%s-hidden-headless. The correct arbiter and hidden replicas should always be connected to the headless service running the primary replica - %s-headless - mongodb.service.nameOverride.

Benefits

Arbiter and hidden replicas can join the MongoDB cluster automatically by the first install.

Applicable issues

  • fixes https://github.com/bitnami/charts/issues/29393
  • The environment variable MONGODB_INITIAL_PRIMARY_HOST contains a headless service name for arbiter and hidden statefulsets different than the one for MongoDB replicas.

Checklist

  • [X] Chart version bumped in Chart.yaml according to semver. This is not necessary when the changes only affect README.md files.
  • [X] Title of the pull request follows this pattern [bitnami/<name_of_the_chart>] Descriptive title
  • [X] All commits signed off and in agreement of Developer Certificate of Origin (DCO)

romanj85 avatar Sep 23 '24 21:09 romanj85

This is related to the issue: https://github.com/bitnami/charts/issues/29393

romanj85 avatar Sep 23 '24 22:09 romanj85

Any update on this? At the moment the mongo cluster created by default chart will stop work if the primary or the secondary go down. It's supposed to stay up instead

santimar avatar Oct 03 '24 14:10 santimar

I have removed K8S_SERVICE_NAME completely and also I have aligned hidden service name overriding using helm values with replicaset & arbiter.

romanj85 avatar Oct 13 '24 21:10 romanj85

@jotamartos please may you have look to the failed pipeline job VIB Verify. I see there strange errors:

Run vmware-labs/vmware-image-builder-action@v0
Loading event configuration from /home/runner/work/_temp/_github_workflow/event.json
Resources will be resolved from https://api.github.com/repos/romanj85/bitnami-charts/tarball/main
Initializing GitHub Action...
Running pipeline...
  The pipeline has been validated successfully.
  Running execution graph: https://cp.bromelia.vmware.com/v1/execution-graphs/d90d7617-fd4b-45c2-8895-eb9f214177df
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df in progress, will check in 30s.
  Error: Task deployment (ginkgo) with ID 6504349a-9c4f-4528-b7a4-58d694dcae83 has failed. Error: Unable to create Pull Secret for the credentials provided in the target namespace. service unavailable
  
  Error: Task deployment (goss) with ID 7e7fef31-5ecc-4f43-aa07-6b31beb87b6a has failed. Error: Unable to create Pull Secret for the credentials provided in the target namespace. service unavailable
  
  Error: Task ginkgo with ID bd78a5[22](https://github.com/bitnami/charts/actions/runs/11405001263/job/31735689086?pr=29584#step:5:23)-c09a-4015-b299-76b06e4f8fcd was skipped. Error: Task skipped because the precondition task 6504349a-9c4f-4528-b7a4-58d694dcae83 (deployment) failed.
  Error: Task goss with ID fef565e9-9abb-4931-95d7-cc903306ad37 was skipped. Error: Task skipped because the precondition task 7e7fef31-5ecc-4f43-aa07-6b31beb87b6a (deployment) failed.
  Error: Task undeployment (goss) with ID 08bb9caf-e803-42aa-9913-eb05d3aa46a2 was skipped. Error: Task skipped because the precondition task 7e7fef31-5ecc-4f43-aa07-6b31beb87b6a (deployment) failed.
  Error: Task undeployment (ginkgo) with ID b32b5764-82db-4a88-83c2-147aaf518f2a was skipped. Error: Task skipped because the precondition task 6504349a-9c4f-45[28](https://github.com/bitnami/charts/actions/runs/11405001263/job/31735689086?pr=29584#step:5:30)-b7a4-58d694dcae83 (deployment) failed.
Processing resulting execution graph...
  Warning: Error downloading bundle files for execution graph d90d7617-fd4b-45c2-8895-eb9f214177df, error: Error: ENOENT: no such file or directory, open '/home/runner/work/charts/charts/outputs/8f0f067d-bed8-4f22-90ee-45384b0[33](https://github.com/bitnami/charts/actions/runs/11405001263/job/31735689086?pr=29584#step:5:35)6e5/d90d7617-fd4b-45c2-8895-eb9f214177df/report.json'
  Error: Execution graph d90d7617-fd4b-45c2-8895-eb9f214177df has failed.
Uploading artifacts...
  Starting artifact upload
  For more detailed logs during the artifact upload process, enable step-debugging: https://docs.github.com/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging#enabling-step-debug-logging
  Artifact name is valid!
  Container for artifact "assets-vib-verify-GKE-d90d7617" successfully created. Starting upload of file(s)
  Total size of all the files uploaded is 10813 bytes
  File upload process has finished. Finalizing the artifact upload
  Artifact has been finalized. All files have been successfully uploaded!
  
  The raw size of all the files that were specified for upload is 86155 bytes
  The size of all the files that were uploaded is 10813 bytes. This takes into account any gzip compression used to reduce the upload size, time and storage
  
  Note: The size of downloaded zips can differ significantly from the reported size. For more information see: https://github.com/actions/upload-artifact#zipped-artifact-downloads 
  
Warning: Skipping execution graph summary, either the report could not be dowloaded or final state was not SUCCEEDED

Perhaps it needs just to re-run? Pipelines for other PRs seems to be working now...

roman-jancik avatar Oct 23 '24 10:10 roman-jancik

I resolve some conflicts and updated your branch. Tests will be executed again and will investigate if there is any issue.

jotamartos avatar Oct 28 '24 07:10 jotamartos