Error with Traefik on Google Kubernetes Engine

5/26/2018

I'm trying to deploy Traefik as an ingress controller on my GKE cluster. It's a basic cluster with 3 nodes.

I'm used to deploy Traefik using manifest on a Kubernetes cluster deployed by Kubespray, but we are migrating some of our infrastructures to GCP.

So I tried to deploy Traefik using the community helm chart with the following configuration:

image: traefik
imageTag: 1.6.2

serviceType: LoadBalancer
loadBalancerIP: X.X.X.X

kubernetes:
  ingressClass: traefik

ssl:
  enabled: false
  enforced: false
  insecureSkipVerify: false

acme:
  enabled: false
  email: hello@mydomain.com
  staging: true
  logging: false
  challengeType: http-01

dashboard:
  enabled: true
  domain: traefik.mydomain.com
  ingress:
    annotations:
      kubernetes.io/ingress.class: traefik

gzip:
  enabled: true
accessLogs:
  enabled: true
  format: common 

And then launch it with the following command:

helm install --namespace kube-system --name traefik --values values.yaml stable/traefik

All is well deployed on my K8S cluster, except the dashboard-ingress with the following error:

kevin@MBP-de-Kevin ~/W/g/s/traefik> kubectl describe ingress traefik-dashboard -n kube-system
Name:             traefik-dashboard
Namespace:        kube-system
Address:
Default backend:  default-http-backend:80 (10.20.2.6:8080)
Rules:
  Host                      Path  Backends
  ----                      ----  --------
  traefik.mydomain.com
                               traefik-dashboard:80 (10.20.1.14:8080)
Annotations:
Events:
  Type     Reason  Age   From                     Message
  ----     ------  ----  ----                     -------
  Warning  Sync    4m    loadbalancer-controller  googleapi: Error 400: Invalid value for field 'namedPorts[2].port': '0'. Must be greater than or equal to 1, invalid

Any idea where is my error?

Thanks a lot!

-- Kévin Printz
google-cloud-platform
google-kubernetes-engine
kubernetes
kubernetes-ingress
traefik

3 Answers

7/19/2018

This can also happen when the service that the ingress controller expects does not exists. (maybe it was accidentally deleted)

nginx-ingress-controller on gke works with services exposed as clusterIP

-- David Dehghan
Source: StackOverflow

9/2/2019

you have forgotten to enable rbac.

Sample bellow worked fine

serviceType: LoadBalancer
rbac:
  enabled: true
dashboard:
  enabled: true
  domain: dash.example.com
  ingress:
    annotations:
      kubernetes.io/ingress.class: traefik
kubernetes:
  ingressClass: traefik
  namespaces:
    - default
    - kube-system
-- Fabio Hisamoto
Source: StackOverflow

5/27/2018
Invalid value for field 'namedPorts[0].port': '0'

This error happens when the Service that's being used by GKE Ingress is of type ClusterIP (and not NodePort). GKE Ingress requires backing Services to be of type NodePort.

-- AhmetB - Google
Source: StackOverflow