Need to expose web application running on kubernetes

Manpreet Singh 0 Reputation points
2025-03-27T06:13:01.2933333+00:00

Hi Team,

I have deployed applications on kubernetes. I need help to expose my application via ingress controller. I have certificate in place. I need ingress controller file with ssl and http-https redirect configuration for Azure.

Please find below ingress file I have used for GCP .

apiVersion: networking.gke.io/v1beta1

kind: FrontendConfig

metadata:

name: hubonweb-frontend-config

spec:

redirectToHttps:

enabled: true

apiVersion: networking.k8s.io/v1

kind: Ingress

metadata:

name: ingress-staging-hubon

annotations:

kubernetes.io/ingress.global-static-ip-name: staging-hubon

networking.gke.io/managed-certificates: managed-cert-staging-hubon

kubernetes.io/ingress.class: "gce"

networking.gke.io/v1beta1.FrontendConfig: hubonweb-frontend-config

spec:

defaultBackend:

service:

  name: hubon-web

  port:

    number: 80

rules:

  • host: "staging.letshubon.com" http: paths:
    • pathType: Prefix path: "/" backend: service:
      name: hubon-web
      
      port:
      
        number: 80
      
  • host: "staging.gardeneur.com" http: paths:
    • pathType: Prefix path: "/lets" backend: service:
      name: hubon-web
      
      port:
      
        number: 80
      
  • host: "staging-api.letshubon.com" http: paths:
    • pathType: Prefix path: "/" backend: service:
      name: hubon-api
      
      port:
      
        number: 3010
      
  • host: "staging-route.letshubon.com" http: paths:
    • pathType: Prefix path: "/" backend: service:
      name: hubon-route
      
      port:
      
        number: 80
      
  • host: "staging.letshubon.com" http: paths:
    • pathType: Prefix path: "/shop" backend: service:
      name: hubon-shop
      
      port:
      
        number: 80
      
  • host: "staging-localpickup.letshubon.com" http: paths:
    • pathType: Prefix path: "/" backend: service:
      name: hubon-localpickup
      
      port:
      
        number: 3000
      
Azure Kubernetes Service
Azure Kubernetes Service
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,448 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Eze-MSFT 5 Reputation points Microsoft Employee
    2025-03-27T10:14:43.4966667+00:00

    Hello ManPreet,

    Hope all is well.

    Here you can find the concepts in AKS ingress:
    https://learn.microsoft.com/en-us/azure/aks/concepts-network-ingress

    In AKS we have the Managed NGINX ingress with the application routing add-on:

    https://learn.microsoft.com/en-us/azure/aks/app-routing

    With several example about how to config it. This is and add-on and you won't have to take care of upgrade nginx ingress controller any more .

    In this link you will be able to find how to use the unmanaged ingress.
    https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/load-bal-ingress-c/create-unmanaged-ingress-controller?tabs=azure-cli

    Regards

    1 person found this answer helpful.
    0 comments No comments

  2. Pramidha Yathipathi 1,135 Reputation points Microsoft External Staff Moderator
    2025-03-28T03:52:03.54+00:00

    Hi Manpreet Singh,

    Export the Certificate from Azure

    1.Navigate to Azure Portal → App Service Certificates.

    2.Find your wildcard certificate and click on it.

    3.Under “Certificate Configuration”, click “Export Certificate”.

    4.Choose PFX format and download the certificate (.pfx file).

    Once you have the .pfx file, you need to extract the certificate and private key using OpenSSL:

    Extract the private key

    openssl pkcs12 -in your-certificate.pfx -nocerts -nodes -out key.pem
    

    Extract the certificate

    openssl pkcs12 -in your-certificate.pfx -clcerts -nokeys -out cert.pem
    

    You will be prompted, specify a password for the export operation. When you upload your TLS/SSL certificate to App Service later, you must provide the password.

    Now, create a Kubernetes secret using the extracted cert.pem and key.pem:

    kubectl create secret tls hubon-tls-secret \
      --cert=cert.pem \
      --key=key.pem \
      -n your-namespace
    

    This will store your wildcard certificate as a TLS secret, which can be referenced in your Ingress configuration.

    Ensure your Ingress YAML file references the hubon-tls-secret:

     tls:
    - hosts:
        - staging.letshubon.com
      secretName: hubon-tls-secret
     
    

    Once applied, your Ingress should use the wildcard certificate for secure HTTPS traffic.

    Please refer this document:

    https://learn.microsoft.com/en-us/azure/app-service/configure-ssl-certificate?tabs=apex%2Crbac%2Cazure-cli

    If the comment was helpful, please don't forget to click "Upvote".

    If you have any further queries, please let us know we are glad to help you.

    Thank You.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.