According to the documentation: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
Any code greater than or equal to 200 and less than 400 indicates success. Any other code indicates failure.
so if the container returns 301
for the probe, the probe should succeed. But I have a container in which it's not the case. With CURL I get 301
, but probe fails with 503
. The target of the redirect is not available.
Tested in Openshift 3.11 with the following probe:
apiVersion: apps/v1
kind: Deployment
spec:
template:
spec:
containers:
- name: 'redirect'
image: ngingx
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http