bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.61k stars 8.99k forks source link

[bitnami/mongodb] Problem with externalAccess and replicaset both enabled (slice index out of range) #26423

Open octane100 opened 1 month ago

octane100 commented 1 month ago

Name and Version

bitnami/mongodb 15.6.0

What architecture are you using?

amd64

What steps will reproduce the bug?

Deploying a Mongodb cluster with 3 replicasets and externalAccess enabled:

Are you using any custom parameters or values?

values.yaml :

architecture: replicaset
replicaCount: 3
persistence:
  enabled: true
  storageClass: gp3
rbac:
  create: true
externalAccess:
  enabled: true
  autoDiscovery:
    enabled: true
  service:
    annotations:
      service.beta.kubernetes.io/aws-load-balancer-type: external
      service.beta.kubernetes.io/aws-load-balancer-scheme: internal
      service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip
      service.beta.kubernetes.io/aws-load-balancer-attributes: deletion_protection.enabled=false
      external-dns.alpha.kubernetes.io/hostname: "{{`{{ $.targetPod }}`}}.internal.domain.com"
      service.beta.kubernetes.io/aws-load-balancer-healthcheck-healthy-threshold: "2"
pdb:
  create: true
  maxUnavailable: 1
serviceAccount:
  create: true
  automountServiceAccountToken: true
automountServiceAccountToken: true
replicaSetName: "mongo32test"
auth:
  enabled: true
  rootUser: admin
  existingSecret: "mongo-secret"
arbiter:
  enabled: false

What is the expected behavior?

Deployment running without error

What do you see instead?

STDERR:
  Error: Failed to render chart: exit status 1: Error: template: sso/charts/mongodb/templates/replicaset/external-access-svc.yaml:23:49: executing "sso/charts/mongodb/templates/replicaset/external-access-svc.yaml" at <index $root.Values.externalAccess.service.annotationsList $i>: error calling index: reflect: slice index out of range

Additional information

The issue has occurred since version 15.3.0 (https://github.com/bitnami/charts/pull/25397).

I can workaround the issue by adding these lines to the values.yaml :

externalAccess:
  service:
    annotationsList: # Workaround for bug introduced by https://github.com/bitnami/charts/pull/25397
      - 
      - 
      -  
carrodher commented 1 month ago

Thank you for bringing this issue to our attention. We appreciate your involvement! If you're interested in contributing a solution, we welcome you to create a pull request. The Bitnami team is excited to review your submission and offer feedback. You can find the contributing guidelines here.

Your contribution will greatly benefit the community. Feel free to reach out if you have any questions or need assistance.

github-actions[bot] commented 3 weeks ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

kamenskiyyyy commented 3 weeks ago

I have this problem too

I fixed it with:

externalAccess:
  enabled: true
  service:
    type: LoadBalancer
    annotations:
      service.beta.kubernetes.io/openstack-internal-load-balancer: "true"
    loadBalancerIPs:
      - "10.98.3.51"
      - "10.98.3.52"
    annotationsList:
      - external-dns.alpha.kubernetes.io/hostname: ks01mongodb.sales.crm
      - external-dns.alpha.kubernetes.io/hostname: ks01mongodb.sales.crm

but, that's a patch, not a fix.

jotamartos commented 2 weeks ago

Thank you for sharing the information regarding how you fixed the issue. As @carrodher mentioned above, would you like to contribute to this project? The team will review the changes and the whole community will benefit of the the update.

github-actions[bot] commented 3 days ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.