Search code examples
kubernetesazure-aksbridge-to-kubernetes

Can Bridge To Kubernetes support HTTPS for local service?


I am using Bridge To Kubernets to develop a Asp.Net Core API application locally.

The service uses Swagger that has a Login button to get OAuth2 token. The OAuth flow requires HTTPS protocl.

When running the service locally with Bridge to Kubernetes, I noticed that the service only listens on HTTP not HTTPS.

Searched documentation on Microsoft but no mentions of HTTPS. Searched source code in GitHub and seems Bridge To Kubernetes only supports HTTP.

Just want to see if there is a workaround or it does not support HTTPS at all.


Solution

  • Finally, I figured out a way to do it by overwriting an environment variable URLS.

    In the KubernetesLocalProcessConfig.yaml file,

      - name: URLS
        value: https://localhost:5001
    

    This will make local service listening on HTTPS and port 5001.

    The code helps me to see all the environment variables,

    foreach (var c in builder.Configuration.AsEnumerable())
    {
       Console.WriteLine(c.Key + " = " + c.Value);
    }