I deployed mongodb in a Kubernetes cluster with this helm chart : https://github.com/helm/charts/tree/master/stable/mongodb. All is right. I can connect to mongo from within a replicatset container or from outside the cluster with a port-forward, or with a NodePort service. But I can't connect via an ingress.
When the ingress is deployed, I can curl mongodb and have this famous message : "It looks like you are trying to access MongoDB over HTTP on the native driver port.". But I can't connect with a mongo client, the connection stucks and I can see in mongodb logs that I never reach mongo.
Does someone have any information about accessing mongodb via an ingress object ? Maybe it's a protocol problem ?
The ingress manifests :
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "mongodb.fullname" . }}
annotations:
kubernetes.io/ingress.class: traefik
spec:
rules:
- host: {{ .Values.ingress.hostName }}
http:
paths:
- path: /
backend:
serviceName: "{{ template "mongodb.fullname" $ }}"
servicePort: mongodb
tls:
- hosts:
- {{ .Values.ingress.hostName }}
secretName: secret
Thank you very much !