Skip to content

Instantly share code, notes, and snippets.

@ducas
Created June 7, 2019 01:47
Show Gist options
  • Save ducas/b007535bd43854d161ba513097c56a98 to your computer and use it in GitHub Desktop.
Save ducas/b007535bd43854d161ba513097c56a98 to your computer and use it in GitHub Desktop.
DaemonSet that queries a web endpoint and prints out timing used for determining where latency may be introduced
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: curl-check
labels:
app: curl-check
spec:
template:
metadata:
labels:
app: curl-check
spec:
containers:
- name: curl
image: byrnedo/alpine-curl
command: ["/bin/sh"]
env:
- name: HTTP_ENDPOINT
value: https://google.com/
args:
- -c
- 'while true; do curl -w "code: %{http_code}, namelookup: %{time_namelookup}, connect: %{time_connect}, appconnect: %{time_appconnect}, pretransfer: %{time_pretransfer}, redirect: %{time_redirect}, starttransfer: %{time_starttransfer}, total: %{time_total}" -o /dev/null -s $HTTP_ENDPOINT; echo ", date: $(date --utc +%FT%TZ)"; sleep 10; done'
imagePullPolicy: Always
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment