I am trying to enable Readiness probe on my deployment yaml file as below but I am getting Readiness probe failed: HTTP probe failed with statuscode: 401, I verified by decoding the secret and my authorization code is correct.
spec:
containers:
- name: mycontainer
image: myimage
env:
- name: MY_SECRET
valueFrom:
secretKeyRef:
name: actuator-token
key: token
livenessProbe:
httpGet:
path: test/actuator/health
port: 9001
httpHeaders:
- name: Authorization
value: $MY_SECRET
UPDATES
If I hardcode the token in value field.. it works fine.
Any help is highly appreciated.
kubectl get secrets actuator-token -o yaml. By the way, what's the kubernetes version? - BMW