Health Operator watches for changes in Kubernetes Deployments, StatefulSets and DaemonSets and creates a summary status resource aka health CR.
kubectl get health -o yaml -n $target_namespace
- apiVersion: common.amadev.ru/v1
kind: Health
status:
nova:
metadata:
generation: 2
status: ready
os-api:
generation: 2
status: ready
scheduler:
generation: 2
status: ready
octavia:
api:
generation: 2
status: ready
housekeeping:
generation: 2
status: ready
worker:
generation: 2
status: ready
It watches for changes on a cluster level but updates health CR on per namespace basis only if health CR is already present in the namespace.
To determine an application and a component name, an `application’ and `component` label used on Kubernetes objects. If none of these found, Health Operator tries to parse application and component name from a k8s object name.
The status of a component can be either “ready” or “notready”. Health Operator never deletes any app statuses.
# create health custom resource definition
kubectl apply -f https://raw.githubusercontent.com/amadev/health-operator/master/config/install_crd.yaml
# create health resource for a desired namespace
export target_namespace=openstack
kubectl apply -f https://raw.githubusercontent.com/amadev/health-operator/master/config/samples/common_v1alpha1_health.yaml -n $target_namespace
# install operator
kubectl apply -f https://raw.githubusercontent.com/amadev/health-operator/master/config/install.yaml
# get summary health status
kubectl -n $target_namespace get health -o yaml