kubernetes-csi / external-health-monitor

This repo contains sidecar controller and agent for volume health monitoring.
Apache License 2.0
66 stars 52 forks source link
k8s-sig-storage

Volume Health Monitor

The Volume Health Monitor is part of Kubernetes implementation of Container Storage Interface (CSI). It was introduced as an Alpha feature in Kubernetes v1.19. In Kubernetes 1.21, a second Alpha was done due to a design change.

Overview

The Volume Health Monitor is implemented in two components: External Health Monitor Controller and Kubelet.

When this feature was first introduced in Kubernetes 1.19, there was an External Health Monitor Agent that monitors volume health from the node side. In the Kubernetes 1.21 release, the node side volume health monitoring logic was moved to Kubelet to avoid duplicate CSI RPC calls.

The Volume Health Monitoring feature need to invoke the following CSI interfaces.

Compatibility

This information reflects the head of this branch.

Compatible with CSI Version Container Image
CSI Spec v1.3.0 registry.k8s.io/sig-storage.csi-external-health-monitor-controller

Driver Support

Currently, the CSI volume health monitoring interfaces are only implemented in the Mock Driver and the CSI Hostpath driver.

Usage

External Health Monitor Controller needs to be deployed with CSI driver.

Alpha feature gate CSIVolumeHealth needs to be enabled for the node side monitoring to take effect.

Build && Push Image

You can run the command below in the root directory of the project.

make container GOFLAGS_VENDOR=$( [ -d vendor ] && echo '-mod=vendor' )

And then, you can tag and push the csi-external-health-monitor-controller image to your own image repository.

docker tag csi-external-health-monitor-controller:latest <custom-image-repo-addr>/csi-external-health-monitor-controller:<custom-image-tag>

External Health Monitor Controller

cd external-health-monitor
kubectl create -f deploy/kubernetes/external-health-monitor-controller

You can run kubectl get pods command to confirm if they are deployed on your cluster successfully.

Check logs of external health monitor controller as follows:

Check if there are events on PVCs or Pods that report abnormal volume condition when the volume you are using is abnormal.

csi-external-health-monitor-controller-sidecar-command-line-options

Important optional arguments that are highly recommended to be used

Other recognized arguments

Community, discussion, contribution, and support

Learn how to engage with the Kubernetes community on the community page.

You can reach the maintainers of this project at:

Code of conduct

Participation in the Kubernetes community is governed by the Kubernetes Code of Conduct.