I am trying to use wget in my liveness probe in Kubernetes. Here is the code:
apiVersion: v1
kind: Pod
metadata:
namespace: test
labels:
test: liveness
name: liveness-exec
spec:
containers:
- name: busybox
image: busybox
command:
- sleep
- "99999999"
livenessProbe:
exec:
command:
- wget
- -O-
- --header=
- "DD-APPLICATION-KEY: abcde"
- --header=
- "DD-API-KEY: a123456"
- https://api.datadoghq.com/api/v1/monitor/1234567 | grep \"overall_state\":\"OK\"
initialDelaySeconds: 10
periodSeconds: 10
But I am facing the following error when I use describe command in the pod:
Liveness probe failed: wget: bad port ' abcde'
My goal is to check an alert in Datadog. If the alert is red the pod will restart.
The wget command works in the terminal. It looks like the YAML file is facing some problems using the headers.