Hey,
I am not sure but every request to traefik seems very slow to me. I tried different configurations but around 3-5 seconds are needed until the nginx answers to the request (no matter of using HTTP or HTTPS):
> time curl -v http://cik8s-master:32341
* Rebuilt URL to: http://cik8s-master:32341/
* Trying 10.8.96.101...
* TCP_NODELAY set
* Connected to cik8s-master (10.8.96.101) port 32341 (#0)
> GET / HTTP/1.1
> Host: cik8s-master:32341
> User-Agent: curl/7.54.1
> Accept: */*
>
< HTTP/1.1 302 Found
< Location: /dashboard/
< Date: Tue, 04 Jul 2017 13:41:03 GMT
< Content-Length: 34
< Content-Type: text/html; charset=utf-8
<
<a href="/dashboard/">Found</a>.
* Connection #0 to host cik8s-master left intact
0.00user 0.00system 0:05.06elapsed 0%CPU (0avgtext+0avgdata 8728maxresident)k
0inputs+0outputs (0major+452minor)pagefaults 0swaps
The configuration:
---
apiVersion: v1
data:
traefik.toml: |
# traefik.toml
logLevel = "INFO"
defaultEntryPoints = ["http","https"]
[entryPoints]
[entryPoints.http]
address = ":80"
compress = true
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
compress = true
[entryPoints.https.tls]
[[entryPoints.https.tls.certificates]]
CertFile = "/ssl/tls.crt"
KeyFile = "/ssl/tls.key"
[kubernetes]
[web]
address = ":8080"
kind: ConfigMap
metadata:
name: traefik
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: traefik
spec:
replicas: 1
selector:
matchLabels:
app: traefik
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: traefik
spec:
containers:
- args:
- --configfile=/config/traefik.toml
image: traefik:v1.3.2
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 80
timeoutSeconds: 2
name: traefik
readinessProbe:
failureThreshold: 1
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
tcpSocket:
port: 80
timeoutSeconds: 2
resources:
limits:
cpu: 100m
memory: 30Mi
requests:
cpu: 100m
memory: 20Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /config
name: config
- mountPath: /ssl
name: ssl
volumes:
- configMap:
defaultMode: 420
name: traefik
name: config
- name: ssl
secret:
defaultMode: 420
secretName: traefik-default-cert
---
apiVersion: v1
data:
tls.crt: ...
tls.key: ...
kind: Secret
metadata:
name: traefik-default-cert
namespace: kube-system
type: Opaque
---
apiVersion: v1
kind: Service
metadata:
name: traefik
spec:
ports:
- name: http
port: 8080
protocol: TCP
targetPort: 8080
- name: https
port: 443
protocol: TCP
targetPort: 443
selector:
app: traefik
sessionAffinity: None
type: NodePort
I also tried it under different servers / networks, the requests / response takes always around 5 seconds. :(
@saschagrunert wild guess: could you remove the resource constraints from the manifest and see if that helps?
Yep, that helps. :)
Great, riddle solved. 鈽猴笍