Trying traefik’s ingress controller
Course: Kubernetes Part 2 - chapter 12
Traefik is another popular ingress controller. Let’s try to our apps using it next
- Install traefik ingress controller using helm
helm repo add traefik https://helm.traefik.io/traefikhelm repo updatehelm install traefik traefi/traefik --namespace traefik --create-namespace- Make sure an ingressClass is created for traefik
kubectl get IngressClass- Notice it created a
LoadBalancersvc for you
kubectl get svc -n traefik- Create a
Ingressthat uses the traefik ingressClass and traefik annotations (traefik.yml)
apiVersion: networking.k8s.io/v1kind: Ingressmetadata: name: traefik-web-apps-ingress namespace: defaultspec: ingressClassName: traefik rules: - host: traefik-domain.com http: paths: - path: /nginx pathType: Prefix backend: service: name: nginx-service port: number: 80 - path: /apache pathType: Prefix backend: service: name: apache-service port: number: 80- Add an entry to your
/etc/hosts(IP should be your loadbalancer IP)
65.20.90.183 traefik-domain.com- Visit the website
traefik-domain.com/nginxtraefik-domain.com/apache💡
Can you guess what is going wrong? Why are you not seeing anything on this final page?

Assignment
Section titled “Assignment”Try to figure out how can you rewrite the path to / if you’re using traefik as the ingress class