title: Using traefik as a DaemonSet or as a Deployment?
body: <p>Should I deploy traefik 1.7.x as DaemonSet or as A deployment in GKE (Google K8S)?</p>
  <h3>Environment Description</h3>
  <p>Kubernetes clusters with node autoscaler in Google cloud, hosting several production clusters.
  Clusters can extend up to 90 nodes (minimum is 6 nodes), currently we have <code>traefik</code> pod deployed with 10 replicas in each cluster (we use kustomize to deploy the same manifests in all clusters).</p>
  <p>We notice slow response time in the cluster that has 18 nodes (<code>europe-west1</code> region), compared to our cluster in <code>australia-southeast1</code> region, which has 6 nodes. Both clusters has 10 replicas of traefik.</p>
  <h3>Deployment Specs</h3>
  <p>traefik.toml:</p>
  <pre><code>    [kubernetes]
      # all namespaces!
      namespaces = []
  </code></pre>
  <p>Service.yaml</p>
  <pre><code>apiVersion: v1
  kind: Service
  metadata:
    labels:
      app: traefik
    name: traefik-ingress
    namespace: ingress-traefik
  spec:
    externalTrafficPolicy: Local
    ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: 80
    - name: https
      port: 443
      protocol: TCP
      targetPort: 443
    selector:
      app: traefik
    sessionAffinity: None
    type: LoadBalancer
    loadBalancerIP: {{LOAD_BALANCER_IP}}
  </code></pre>
  <p>Deployment.yaml</p>
  <pre><code>---
  apiVersion: apps/v1
  kind: Deployment
  metadata:
    labels:
      app: traefik
    name: traefik
    namespace: ingress-traefik
  spec:
    replicas: 10
    selector:
      matchLabels:
        app: traefik
  
    template:
      metadata:
        labels:
          app: traefik
      spec:
        containers:
        - args:
          - --configfile=/config/traefik.toml
          image: traefik:1.7.9-alpine
  </code></pre>
  <h3>Questions</h3>
  <ol>
  <li>In this scenario (using GKE node autoscaler) what would be the optimal configuration for our clusters? Using Deployment or a DaemonSet for traefik?</li>
  <li>Does the amount of traefik pods has effect on response time according to the cluster size (node count)?</li>
  <li>Does routing inside the cluster (hops between pod, service and nodes networks) is easier for traefik when using a DaemonSet (pod for each node) or by using a deployment of several replicas for the whole cluster? (We use K8S namespaces for each of our https service and traefik has its own namespace).</li>
  </ol>