存储架构

Docker and Healthchecks outside of Kubernetes

微信扫一扫,分享到朋友圈

Docker and Healthchecks outside of Kubernetes
0

So I’ve been working with a containerized solution recently which runs outside of Kuberenetes
using an Azure VMSS to scale out. I won’t dive into the reasons why we went down this route but one really interesting thing came of out of it.

How do you automatically healthcheck a container outside of Kubernetes?

Well it turns out docker
has this covered in newer versions. You can
specify a HEALTHCHECK
inside the docker file to monitor the containers state

How do you ensure it restarts when unhealthy?

Well here you have a couple of options but both rely on using --restart=always
when starting the container:

  1. You `healthcheck` command runs inside the container so you can have it kill the root process of the container causing the container to restart – Example: https://github.com/opencb/opencga/pull/1121/files
  2. You can use `AutoHeal` container which monitors the docker deamon via it’s socket and handles and containers which report unhealthy https://hub.docker.com/r/willfarrell/autoheal/

Note: I’m trying a new format for shorter slightly rougher blog posts covering specific topics quickly. They’ll appear under Quick-post
tags. Please excuse typos and grammar issues!

阅读原文...


Avatar

Shadow/brightness around CSS image

上一篇

Deploying a Kubernetes Cluster on Azure Stack fails

下一篇

您也可能喜欢

评论已经被关闭。

插入图片
Docker and Healthchecks outside of Kubernetes

长按储存图像,分享给朋友