Kubernetes ingress tls - route http app issue

Jack Chuong 286 Reputation points
2021-07-09T04:23:00.41+00:00

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 (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
1,842 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful