Should I deploy traefik 1.7.x as DaemonSet or as A deployment in GKE (Google K8S)?
Environment Description
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 traefik
pod deployed with 10 replicas in each cluster (we use kustomize to deploy the same manifests in all clusters).
We notice slow response time in the cluster that has 18 nodes (europe-west1
region), compared to our cluster in australia-southeast1
region, which has 6 nodes. Both clusters has 10 replicas of traefik.
Deployment Specs
traefik.toml:
[kubernetes]
# all namespaces!
namespaces = []
Service.yaml
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}}
Deployment.yaml
---
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
Questions
- In this scenario (using GKE node autoscaler) what would be the optimal configuration for our clusters? Using Deployment or a DaemonSet for traefik?
- Does the amount of traefik pods has effect on response time according to the cluster size (node count)?
- 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).