HTTPS on a custom port using ingress (AGIC)

Firoj Siddique 20 Reputation points
2024-11-05T07:39:57.5666667+00:00

I am trying to create a listener on a custom port. The minute I start using custom port my listener in application gateway is created on http protocol and if i am not specifying the custom port it is coming on https on port 443. Below are the annotations i am using.

	kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/ssl-redirect: "true"  
    appgw.ingress.kubernetes.io/appgw-ssl-certificate: "
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.
2,188 questions
{count} votes

Accepted answer
  1. Prrudram-MSFT 26,686 Reputation points
    2024-11-05T09:40:48.8133333+00:00

    Hello @Firoj Siddique

    It sounds like you're on the right track with your annotations!
    To create a listener on a custom port and ensure it uses HTTPS, you'll need to specify the protocol, custom port and the SSL certificate in your annotations.
    Here are the required annotations, please feel free to refer to the document links shared at the end for precise and updated versions of these annotations.

    kubernetes.io/ingress.class: azure/application-gateway

    appgw.ingress.kubernetes.io/appgw-ssl-certificate: "your-ssl-certificate-name"

    appgw.ingress.kubernetes.io/frontend-port: "your-custom-port"

    appgw.ingress.kubernetes.io/backend-protocol: "HTTPS"

    Replace "your-ssl-certificate-name" with the name of your SSL certificate and "your-custom-port" with the custom port number you want to use.

    Refer to the following document links for details:

    https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-annotations#override-frontend-port

    https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-annotations#backend-protocol

    https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-annotations#application-gateway-ssl-certificate
    Let me know if this has answered your question by upvoting this solution, post which we can promote this as answer


0 additional answers

Sort by: Most helpful

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.