TRAEFIK v2 (Part 1)

Installing Traefik v2 with Helm

Part 1 describes how to deploy a Kubernetes ingress with Traefik v2 CRD IngressRoute in it’s own namespace using a values.yaml file.

Part 2 describes http to https redirects by changing the values.yaml file.

Part 3 explains the implementation of Let’s Encrypt SSL Certificates on AKS including persistancy for TLS certificates.

Add the Helm repository:

helm repo add traefik https://helm.traefik.io/traefik

Update the repo to get the latest info from the charts in all repositories:

helm repo update

Create the namespace you want to run Traefik in:

kubectl create ns traefik

Download the values.yaml example file from https://github.com/traefik/traefik-helm-chart/blob/master/traefik/values.yaml and customize if needed.

Deploy Traefik:

helm install --namespace=traefik --values=values.yaml traefik traefik/traefik

Now you can deploy your IngressRoute using the IngressRoute CRD. The following example will create an IngressRoute with the name ingress-app1 in the namespace app1, using the entryPoint web for every requestion on www.cloudt.it port 80, which will be sent to the app1-service service

apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
  name: ingress-app1
  namespace: app1
spec:
  entryPoints:
    - web
  routes:
  - match: Host(`www.cloudt.it`)
    kind: Rule
    services:
    - name: app1-service
      port: 80

In the example values.yaml file the entrypoint web is being used. Web is defined in the values.yaml file in the ports: section:

ports:
  web:
    port: 8000
    expose: true
    exposedPort: 80
    protocol: TCP

2 thoughts on “TRAEFIK v2 (Part 1)

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll Up