gyselroth / kube-icinga

Monitor kubernetes services / resources using icinga2 (including autodiscovery support)
MIT License
35 stars 4 forks source link

Deploy pods to icinga2 #13

Open raffis opened 5 years ago

raffis commented 5 years ago

Is your feature request related to a problem? Please describe

Missing pods.

Describe the solution you'd like

Include pods as a new resource.

There are reasons to monitor single pods besides services:

Note that pod provisioning shall be disabled by default.

Sec42 commented 5 years ago

ideally you would want a health check on each pod similar to what https://github.com/Nexinto/check_kubernetes does

raffis commented 5 years ago

ideally you would want a health check on each pod similar to what https://github.com/Nexinto/check_kubernetes does

Yes indeed, but check_kubernetes is not a plugin shipped by icinga2. Therefore you need to manually configure kube-icinga to use that command by configuring: kubernetes.pods.hostDefinition or kubernetes.pods.serviceDefinition to something like: {"check_command":"check_kubernetes"}.

It's not possible to dynamically add plugins for icinga2 due security reasons, if you have this plugin installed you may just do the custom config above.

Pods will probably be created via the check_dummy check_command by default since we can not be sure that icinga2 is deployed on kubernetes directly, if outside then icinga2 can't usually reach pods directly. But there are other ways as well. You may deploy a custom zone (An icinga satelite zone on kubernetes) and monitor resources via that satelite if icinga2 is deployed outside kubernetes. For example: kubernetes.pods.hostDefinition or kubernetes.pods.serviceDefinition to something like: {"check_command":"check_ping","zone":"kubernetes-cluster.local","command_endpoint":"kubernetes-endpoint.local"}

Sec42 commented 5 years ago

Sorry if I was being unclear. I know plugins can not be dynamically added. I was trying to point out it already exists - just to trying to show there is interest and to encourage you to implement this feature :-)

I agree with the rest of your statements. My test setup icinga2 is already able to reach the pods.