QT-DevOps / DevOpsIssues

This Repo will be used to demonstrate the Skills & Questions in DevOps
Apache License 2.0
27 stars 131 forks source link

How to configure application health endpoint on Kubernetes #905

Closed sharmatanmaya closed 4 years ago

sharmatanmaya commented 4 years ago

I have a springboot application deployed into docker. that container is being manged by kubernetes. sometime the application is runnig out of memory and is down but k8s doesnot have any idea about it. How can i configure k8s to restart my application when the application goes down?

singaravellu commented 4 years ago

use liveliness and readiness probe and configure in manifest file

sharmatanmaya commented 4 years ago

I have configured liveness and readiness for a /healthcheck custom endpoint in a spring boot application controller, which return 200/500 http error depending upon the api status. WIll it capture for any Out of memory error as well?

singaravellu commented 4 years ago

you can also configure the resource limits if it exceeds the specified limits it should restart.