<p>I'm trying to redirect an ingress for the service deployed in Azure Kubernetes to https. Whatever I try doesn't work. I tried configuring Ingress and Traefik itself (via ConfigMap) with no effect.</p>

<p>The config for Traefik looks as the following:</p>

<pre><code>---
# Traefik_config.yaml
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: traefik-conf
  namespace: kube-system
# traefik.toml
data:
  traefik.toml: |
    defaultEntryPoints = ["http","https"]

    [entryPoints]
      [entryPoints.http]
        address = ":80"
        [entryPoints.http.redirect]
          entryPoint = "https"
      [entryPoints.https]
        address = ":443"
        [entryPoints.https.tls]

    [frontends]
      [frontends.frontend2]
        backend = "backend1"
        passHostHeader = true
        # overrides default entry points
        entrypoints = ["http", "https"]

    [backends]
      [backends.backend1]
        [backends.backend1.servers.server1]
           url = "http://auth.mywebsite.com"
</code></pre>

<p>The subject for redirection is containerized IdentityServer API website with no TLS encryption. There are a couple of questions on the matter:</p>

<ul>
<li>What's the best way to redirect the frontend app in Azure Kubernetes with Traefik</li>
<li>In the config the frontend is numbered, i.e. "frontend2". I assume this a sequential number of the app on the Traefik's dashboard. The problem is, the dashboard only shows the total sum of apps. If there are many of them, how to figure what the number is?</li>
<li>When I apply annotations to the Ingress, like "traefik.ingress.kubernetes.io/redirect-permanent: true" the respective labels are not showing up in the Traefik's dashboard for the respective app. Is there any reason for that?</li>
</ul>

<p>Your configuration for redirecting http to https looks good. If you have followed the official Doc of Traefik to deploy on kubernetes, The Traefik ingress controller service will not have 443. Make sure you have port 443 opened on the Service with service type as <code>LoadBalancer</code>. Once we open a port in service, Then Azure opens the same port in the Azure load balancer. Service yaml is here.</p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: traefik-ingress-service
  namespace: kube-system
spec:
  selector:
    k8s-app: traefik-ingress-lb
  ports:
    - protocol: TCP
      port: 80
      name: web
    - protocol: TCP
      port: 8080
      name: admin
  type: LoadBalancer
</code></pre>

<p>If you want to redirect all the http to https in your cluster, You can go for the redirection in the configuration file. 
If you want to redirect only some of the services, then add annotations in the Ingress to achieve redirection for specific services.</p>

<pre><code>traefik.ingress.kubernetes.io/frontend-entry-points: http,https
traefik.ingress.kubernetes.io/redirect-entry-point: https
</code></pre>

<p>After setting up the redirection, Traffic Dashboard reflects that here.
You can also set up a permanent rediection using <code>traefik.ingress.kubernetes.io/redirect-permanent: "true</code>
<a href="https://i.stack.imgur.com/VTxED.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VTxED.png" alt="enter image description here"></a></p>
