Building a Continuous Deployment Pipeline Using LKE (Part 9): Installing Traefik

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.

Cloud Native Continuous Deployment with GitLab, Helm, and Linode Kubernetes Engine: Installing Traefik

Slide deck: Cloud Native Continuous Deployment with GitLab, Helm, and Linode Kubernetes Engine: Installing Traefik (Slide #143)

Installing Traefik

Traefik is a popular Ingress Controller for Kubernetes, which manages external access to the cluster and provides load balancing functionality. This section discusses installing Traefik, configuring an Ingress within our YAML file, and testing things out.

Presentation Text

Here’s a copy of the text contained within this section of the presentation. A link to the source file can be found within each slide of the presentation. Some formatting may have been changed.

Installing Traefik

  • Traefik is going to be our Ingress Controller

  • Let’s install it with a Helm chart, in its own namespace

  • First, let’s add the Traefik chart repository:

    helm repo add traefik
  • Then, install the chart:

    helm upgrade --install traefik traefik/traefik \ --create-namespace --namespace traefik \ --set "ports.websecure.tls.enabled=true"

(that option that we added enables HTTPS, it will be useful later!)

Testing Traefik

  • Let’s create an Ingress resource!

  • If we’re using Kubernetes 1.20 or later, we can simply do this:

    kubectl create ingress web \*=web:80

    (make sure to update and use your own domain)

  • Check that the Ingress was correctly created:

    kubectl get ingress
    kubectl describe ingress

If we’re using Kubernetes 1.19 or earlier, we’ll need some YAML

Creating an Ingress with YAML

  • This is how we do it with YAML:

    kubectl apply -f- <<EOF
    kind: Ingress
      name: web
      - host:
          - path: /
              serviceName: web
              servicePort: 80

Ingress versions…

  • Note how we used the v1beta1 Ingress version on the previous YAML(to be compatible with older Kubernetes versions)
  • This YAML will give you deprecation warnings on recent version of Kubernetes (since the Ingress spec is now at version v1)
  • Don’t worry too much about the deprecation warnings (on Kubernetes, deprecation happens over a long time window, typically 1 year)
  • You will have time to revisit and worry later! 😅

Does it work?

  • Try to connect to the Ingress host name (in my example,
  • Normally, it doesn’t work (yet) 🤔
  • Let’s look at kubectl get ingress again
  • ExternalDNS is trying to create records mapping HOSTS to ADDRESS
  • But the ADDRESS field is currently empty!
  • We need to tell Traefik to fill that ADDRESS field

Reconfiguring Traefik

  • There is a “magic” flag to tell Traefik to update the address status field

  • Let’s update our Traefik install:

    helm upgrade --install traefik traefik/traefik \
        --create-namespace --namespace traefik \
        --set "ports.websecure.tls.enabled=true" \
        --set "providers.kubernetesIngress.publishedService.enabled=true"

Checking what we did

  • Check the output of kubectl get ingress (there should be an address now)
  • Check the logs of ExternalDNS (there should be a mention of the new DNS record)
  • Try again to connect to the HTTP address (now it should work)
  • Note that some of these operations might take a minute or two (be patient!)

This page was originally published on

Create a Linode account to try this guide with a $100 credit.
This credit will be applied to any valid services used during your first 60 days.

Your Feedback Is Important

Let us know if this guide made it easy to get the answer you needed.

Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.