I'm using NSX/NCP Ingress in a dedicated VMWare PKS cluster. I am attempting to stand up ingress to Elasticsearch and the backend service uses HTTPS. I can not seem to find a way to have NSX Ingress talk to a backend HTTPS service.
The load balancer will terminate TLS and send HTTP requests to the default backend server if there is a TLS Ingress (in the cluster for the Kubernetes/PKS use case, or in the same namespace for the Project Pacific use case) with host which matches the host in the request.
Background:
- In this environment, a k8s PKS cluster has no control over DNS. One IP is allocated per dedicated cluster and a wildcard DNS record is pointed to that IP.
- Only the NSX class Ingress controller gets to use that dedicated IP (
kuberneties.io/ingress.class: nsx
) - NSX Ingress controllers do not support the
ingress.kubernetes.io/secure-backends: 'true'
annotation. - I can deploy other ingress controllers. For instance, I stood up an nginx ingress controller with the
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
annotation and that works. However, these ingress controllers get a randomly assigned IP (which may change) and no DNS records. - I have tried removing the tls section and setting the
ncp/ssl-mode: reencrypt
annotation and only get a 502 error. Would be willing to revisit this.
What I'm looking for:
- Ideally, a way I missed to just have NSX ingress work with a secure backend.
- Failing that, a way to make the
ncp/ssl-mode: reencrypt
option work for this scenario case. I don't want to set a default ingress (no host in the rule) - Failing that, the simplest solution to present the
eventsink-opendistro-es-client-service
port 9200 HTTPS as an HTTP service to an NSX ingress controller. I've considered standing up a separate nginx pod that connects to the service on the backend and presents it as HTTP on the frontend, which the ingress controller can then hit.
I also don't want to rebuild the Elasticsearch image to a non-https custom one, but if there's a helm chart method to make the exposed port 9200 HTTP only, I can do that.
Finally, here is my ingress definition as it stands:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: eventsink-opendistro-es-client
annotations:
kubernetes.io/ingress.class: nsx
ingress.kubernetes.io/secure-backends: 'true'
# ncp/ssl-mode: reencrypt
namespace: default
spec:
rules:
- host: elasticsearch.clustername.pks.example.net
http:
paths:
- backend:
serviceName: eventsink-opendistro-es-client-service
servicePort: 9200
tls:
- hosts:
- elasticsearch.clustername.pks.example.net
secretName: clustername.pks.example.net-ssl