Without this health endpoint, it's hard to setup zero-downtime deployments since we cannot setup readiness and liveness probes. Is there any other workaround?
@maticko
Please add the argument -health-status true in the Ingress controller yaml. When enabled, you can check NGINX health via <pod-ip>/nginx-health URL.
@pleshakov Thanks for this.
Pasting my configuration if someone will have the same trouble.
spec:
containers:
- image: nginxdemos/nginx-ingress:0.9.0-alpine
imagePullPolicy: Always
name: nginx-ingress
ports:
- containerPort: 80
hostPort: 80
- containerPort: 443
hostPort: 443
readinessProbe:
httpGet:
path: /nginx-health
port: 80
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 10
livenessProbe:
httpGet:
path: /nginx-health
port: 80
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 10
args:
- -health-status=true
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 200m
memory: 256Mi
If you tell me where I can update examples documentation...
@maticko
thanks for sharing the example!
We'll add a doc page about command-line arguments and include a health-checking example.
@pleshakov Is this resolved, maybe? Interested in some docs about this..
@mkozjak for now, please use the example above. although, note that a few additional command-line arguments are required for running the IC. Please see https://github.com/nginxinc/kubernetes-ingress/blob/master/deployments/deployment/nginx-ingress.yaml#L35 and https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/cli-arguments.md
for health checking by Kubernetes, we'll be adding an additional endpoint handled by the IC to use in readiness and liveliness probes, and update the manifests and helm chart accordingly.
Hi @pleshakov We also turned on the Nginx white-list to only whitelist the IP address initiating from our API gateway. However, the health probe is initiating from traffic manager (DNS).
Will this health check URL always be allowed to pass through?
@zhouchong90 this depends on how you enabled white-listing. Could you possibly provide the details?
Most helpful comment
@mkozjak for now, please use the example above. although, note that a few additional command-line arguments are required for running the IC. Please see https://github.com/nginxinc/kubernetes-ingress/blob/master/deployments/deployment/nginx-ingress.yaml#L35 and https://github.com/nginxinc/kubernetes-ingress/blob/master/docs/cli-arguments.md
for health checking by Kubernetes, we'll be adding an additional endpoint handled by the IC to use in readiness and liveliness probes, and update the manifests and helm chart accordingly.