question

JackChuong-4637 avatar image
0 Votes"
JackChuong-4637 asked JackChuong-4637 answered

Kubernetes ingress tls - route http app issue

Hi all,
I’m kubernetes newbie, I started to learn about K8S and I have read "Hands-on Kubernetes on Azure, Third Edition" recently.
I get this strange issue when trying to expose my app (nginx+php) with http and https , this is my ingress

 apiVersion: networking.k8s.io/v1
 kind: Ingress
 metadata:
   name: simple-frontend-ingress
   annotations:
     kubernetes.io/ingress.class: azure/application-gateway
 spec:
   tls:
   - hosts:
       - app.mydomain.com
     secretName: my-tls
   rules:
   - host: app.mydomain.com
     http:
       paths:
       - path: /
         pathType: Prefix
         backend:
           service:
             name: web-frontend-service
             port: 
               number: 80

When I try to browse http://app.mydomain.com/test.php , I get error timeout, can’t connect to the server ...
But I can browse https://myapp.mydomain.com/test.php
Instead , I should browse both http and https successfully , right ?
I want to know what's wrong , please let me know if you need more information.

azure-kubernetes-service
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

JackChuong-4637 avatar image
0 Votes"
JackChuong-4637 answered

Resolved, I need 2 individual ingress rules for http and https to expose both.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.