nginxinc / kubernetes-ingress

NGINX and NGINX Plus Ingress Controllers for Kubernetes
https://docs.nginx.com/nginx-ingress-controller
Apache License 2.0
4.66k stars 1.97k forks source link

ssl-services seems not working #332

Closed bakayolo closed 6 years ago

bakayolo commented 6 years ago

Describe the bug ssl-services does not enable proxy_pass https://... in the nginx conf.

To Reproduce Steps to reproduce the behavior:

  1. I have this ingress template:
    apiVersion: extensions/v1beta1
    kind: Ingress
    metadata:
    annotations:
    kubernetes.io/ingress.class: nginx
    nginx.org/ssl-services: "test"
    labels:
    chart: test-0.1.0
    heritage: Tiller
    release: test
    spec:
    rules:
    - host: test.kintohub.com
    http:
      paths:
      - backend:
          serviceName: test
          servicePort: 443
        path: /
    tls:
    - hosts:
    - test.kintohub.com
    secretName: ssl-kintohub
  2. When I push this template on K8S, the certs are mounted correctly in the nginx pod. But I cannot reach https://test.kintohub.com -> Error 400 Bad Request
  3. I look at /etc/nginx/nginx.conf and I can see that the proxy_pass is set to http, not to https. Switching manually from http to https and reloading the nginx conf works.

Expected behavior Annotation nginx.org/ssl-services: "test" should update my nginx conf and replace proxy_pass http://test.kintohub.com with proxy_pass https://test.kintohub.com

Your environment

pleshakov commented 6 years ago

@bappr you're using a container image of a different NGINX Ingress controller. That Ingress controller supports the feature in question differently. Please see https://github.com/kubernetes/ingress-nginx for more info.

The container image of the Ingress controller from this repo is available at https://hub.docker.com/r/nginx/nginx-ingress/ See this doc to find out about the key differences between NGINX Ingress controller implementations

bakayolo commented 6 years ago

Arf. Thanks for the reply. Indeed, I should have been more careful when choosing the k8s image. Will switch to the other one right now. Thanks a lot.