1

I've been setting up a kubernetes cluster as a PoC, but currently struggle to find a solution for my problem. A proprietary software that I need to deploy does only expose one port which is https. I tested the service and was able to use the application without problems, but exposing it with ingress returns a invalid response (ERR_INVALID_RESPONSE). Here is my ingress config (ingress is deployed using the offical nginx-ingress helm chart and working for other services):

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: sapcc
  namespace: ingress
annotations:
  kubernetes.io/ingress.class: nginx
  nginx.ingress.kubernetes.io/ssl-redirect: "false"
  nginx.ingress.kubernetes.io/rewrite-target: /$1
spec:
  rules:
  - http:
    paths:
    - backend:
        serviceName: cc1
        servicePort: 8443
      path: /cc1(/|$)(.*)

How can I make this application accessible using ingress?

Thanks for your help!

Timo
  • 113
  • 3

1 Answers1

0

The ingress controller supports case insensitive regular expressions in the spec.rules.http.paths.path field. This can be enabled by setting the nginx.ingress.kubernetes.io/use-regex annotation to true (the default is false). Add following line in annotations fiels:

nginx.ingress.kubernetes.io/use-regex: "true"

Please, provide your deployment and service files. Namespace field in deployment, service and ingress files must be the same.

Have you specified your domain name in spec: rules: -host?

Please refer to this simple tutorial and also for documentation.

aga
  • 128
  • 3
  • I'm will supply deployment files later on, because I don't have them on hand right now. What advantage do I have when using regex? Namespaces are the same and I have specified a domain name. For reproducing you can just setup a nginx server with tls certificate and try to expose it using ingress. – Timo Aug 30 '19 at 06:13
  • Could you provide also output of your service cc1 in post? – aga Sep 03 '19 at 08:16
  • I found a really good and easy solution. You just need to add the following annotation: nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" – Timo Sep 03 '19 at 11:31