# Http to https redirection on K8S Ingress

**URL:** <https://community.traefik.io/t/http-to-https-redirection-on-k8s-ingress/8702>\
**Category:** Traefik v2\
**Tags:** kubernetes-ingress\
**Created:** [November 23, 2020, 8:08am UTC](https://community.traefik.io/t/http-to-https-redirection-on-k8s-ingress/8702 "2020-11-23T08:08:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jbd](https://sea2.discourse-cdn.com/flex020/user_avatar/community.traefik.io/jbd/32/341_2.png) [@jbd](https://community.traefik.io/u/jbd)\
**Post date:** [November 26, 2020, 10:23am UTC](https://community.traefik.io/t/http-to-https-redirection-on-k8s-ingress/8702/3 "2020-11-26T10:23:45Z")

</div>

Hello,

you can use an ingress listening for https with TLS [termination](https://doc.traefik.io/traefik/v2.3/routing/providers/kubernetes-ingress/#on-ingress) and the entrypoint default [configuration](https://doc.traefik.io/traefik/v2.3/routing/entrypoints/#entrypoint).

I could be something like:

```yaml
# Traefik service
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: traefik
  labels:
    app: traefik-lb

spec:
  replicas: 1
  selector:
    matchLabels:
      app: traefik-lb
  template:
    metadata:
      labels:
        app: traefik-lb
    spec:
      serviceAccountName: traefik-controller
      containers:
        - name: traefik
          image: traefik:v2.3
          args:
            - --entrypoints.web.address=:80
            - --entrypoints.web.http.redirections.entryPoint.to=websecure
            - --entrypoints.websecure.address=:443
            - --providers.kubernetesingress
          ports:
            - name: web
              containerPort: 80
            - name: websecure
              containerPort: 443

---
apiVersion: v1
kind: Service
metadata:
  name: traefik
spec:
  selector:
    app: traefik-lb
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
      name: web
    - protocol: TCP
      port: 443
      targetPort: 443
      name: websecure
  type: LoadBalancer

```

```yaml
# ingress
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
  name: whoami-ingress
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: websecure
    traefik.ingress.kubernetes.io/router.tls: "true"

spec:
  rules:
    - host: whoami
      http:
        paths:
          - backend:
              serviceName: whoami
              servicePort: 80
  tls:
    - secretName: mysecret

```

Let me know if it helps. 🙂

---

_[View the full topic](https://community.traefik.io/t/http-to-https-redirection-on-k8s-ingress/8702)._
