Reputation: 4995
I have an application deployed in Kubernetes. I am using the Istio service mesh. One of my services needs to be restarted when a particular error occurs. Is this something that can be achieved using Istio?
I don't want to use a cronjob. Also, making the application restart itself seems like an anti-pattern.
The application is a node js app with fastify.
Upvotes: 0
Views: 1155
Reputation: 5277
Istio is a network connection tool. I was creating this answer when David Maze made a very correct mention in a comment:
Istio is totally unrelated to this. Another approach could be to use a Kubernetes liveness probe if the cluster can detect the pod is unreachable; but if you're going to add a liveness hook to your code, the Kubernetes documentation also endorses just crashing on unrecoverable failure.
The kubelet uses liveness probes to know when to restart a container. For example, liveness probes could catch a deadlock, where an application is running, but unable to make progress. Restarting a container in such a state can help to make the application more available despite bugs.
See also:
Upvotes: 1