Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Health status #188

Closed
maticko opened this issue Sep 19, 2017 · 8 comments
Closed

Health status #188

maticko opened this issue Sep 19, 2017 · 8 comments
Labels
documentation Pull requests/issues for documentation

Comments

@maticko
Copy link

maticko commented Sep 19, 2017

#90 and #100 add support for health check but I cannot see any instructions on how to use this. After some digging around the code, it looks like I would have to build an image on my own and set some flag to enable that. Is there a way that this could be enabled by annotations?

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?

@pleshakov
Copy link
Contributor

@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 pleshakov added the documentation Pull requests/issues for documentation label Sep 19, 2017
@maticko
Copy link
Author

maticko commented Sep 20, 2017

@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...

@pleshakov
Copy link
Contributor

pleshakov commented Sep 22, 2017

@maticko
thanks for sharing the example!
We'll add a doc page about command-line arguments and include a health-checking example.

@mkozjak
Copy link

mkozjak commented Nov 30, 2018

@pleshakov Is this resolved, maybe? Interested in some docs about this..

@pleshakov
Copy link
Contributor

@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.

@zhouchong90
Copy link

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?

@pleshakov
Copy link
Contributor

@zhouchong90 this depends on how you enabled white-listing. Could you possibly provide the details?

@Dean-Coakley
Copy link
Contributor

Added in: #1029

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Pull requests/issues for documentation
Projects
None yet
Development

No branches or pull requests

5 participants