bitnami / charts

Bitnami Helm Charts
https://bitnami.com
Other
8.97k stars 9.2k forks source link

[bitnami/mongodb-sharded] extenralIP is not supported correctly #9522

Closed skyrain closed 2 years ago

skyrain commented 2 years ago

Name and Version

bitnami/mongodb-sharded

What steps will reproduce the bug?

bitnami/mongodb-sharded is supposed to support externalIP, however service.externalIPs field is not referenced anywhere in helm chart, and as I set up following value file

service:
  name: "vip"
  externalIPs: [192.168.1.1]

Are you using any custom parameters or values?

No response

What is the expected behavior?

No response

What do you see instead?

➜  mongodb kubectl get svc -n mongodb            
NAME                                TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)     AGE
my-mongo-mongodb-sharded-headless   ClusterIP   None            <none>        27017/TCP   9m6s
vip                                 ClusterIP   172.18.243.41   <none>        27017/TCP   9m6s

➜  mongodb kubectl get svc -o yaml -n mongodb vip
apiVersion: v1
kind: Service
metadata:
  annotations:
    meta.helm.sh/release-name: my-mongo
    meta.helm.sh/release-namespace: mongodb
  creationTimestamp: "2022-03-22T21:11:20Z"
  labels:
    app.kubernetes.io/component: mongos
    app.kubernetes.io/instance: my-mongo
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: mongodb-sharded
    helm.sh/chart: mongodb-sharded-4.0.11
  name: vip
  namespace: mongodb
  resourceVersion: "503396476"
  selfLink: /api/v1/namespaces/mongodb/services/vip
  uid: 87a89ee1-629e-4ae2-b96d-d5541c0680e3
spec:
  clusterIP: 172.18.243.41
  ports:
  - name: mongodb
    port: 27017
    protocol: TCP
    targetPort: mongodb
  selector:
    app.kubernetes.io/component: mongos
    app.kubernetes.io/instance: my-mongo
    app.kubernetes.io/name: mongodb-sharded
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

As above, the extenralIP field is not created in service

Additional information

No response

javsalgar commented 2 years ago

Hi,

Thank you so much for reporting! Would you like to submit a PR adding this section?

  {{- if .Values.service.externalIPs }}
  externalIPs: {{- toYaml .Values.service.externalIPs | nindent 4 }}
  {{- end }}
skyrain commented 2 years ago

Hi,

Thank you so much for reporting! Would you like to submit a PR adding this section?

  {{- if .Values.service.externalIPs }}
  externalIPs: {{- toYaml .Values.service.externalIPs | nindent 4 }}
  {{- end }}

Just opened another PR to fix some bug related to externalIP, can you review again?