K8s-ingress-health-bot - A K8s Ingress Health Bot is a lightweight application to check the health of the ingress endpoints for a given kubernetes namespace.

Overview

k8s-ingress-health-bot

A K8s Ingress Health Bot is a lightweight application to check the health of qualified ingress endpoints for a given kubernetes namespace.

How it works

The Bot will start a web server in the background.

Users can use one of the http paths to retrieve the health of qualified ingress endpoints in real time or through the latest populated prometheus metrics.

/health

Return status 200 if the Bot is running.

/metrics

Expose the prometheus metrics for all qualified ingress endpoints to be monitored. Periodically (default every minute), the bot will check the health of each qualify ingress endpoint within a given k8s namespace and populate the health metrics for each endpoint.

Prometheus Metrics

endpoint_health - value 0 means endpoint is down, value 1 means endpoint is up.
  endpoint_health{namespace="example",status_code="200",url="https://aaron.example.com/-/healthy"} 1
cert_validity_days - number of days before cert expired.
  cert_validity_days{namespace="example",url="https://aaron.example.com/-/healthy"} 88

/namespace-health

Return the real time health of the all qualified ingress endpoints within a given k8s namespace.

200 OK

All endpoints are up.

404 StatusNotFound

There is no ingress endpoint to monitor.

500 StatusInternalServerError

Internal error, unable to retrieve ingress endpoints.

503 ServiceUnavailable**

One or more endpoints are down.

Build

go mod vendor
go install ./cmd/...

Usage (Flags)

usage: k8s-ingress-health-bot [<flags>]

Flags:

  -appName string
        Application name of this bot. (default "k8s-ingress-health-bot")

  -excludedIngressNames string
        A comma delimited ingress list that the bot won't monitor.

  -httpClientTimeOut duration
        Maximum time that the HTTP client will wait when pinging an endpoint. (default 15s)

  -ingressHealthCheckUrlsAnnotationKey string
        Ingress annotation key that the bot will look for. (default "ingress.endpoint.healthcheck.urls")

  -kubeconfig string
        Path to a kubeconfig. Only required if the application is running outside of K8s cluster.

  -namespace string
        K8s namespace that this bot will watch. (default "default")

  -port int
        Web server Port. (default 8088)

  -prometheusMetricsPopulateInterval duration
        Time between populate Prometheus metrics for a monitored endpoints. (default 1m0s)

  -prometheusMetricsResetPeriod duration
        Controls how often Prometheus health metrics cache will be cleared. (default 10m0s)

  -retryAttempts int
        Number of attempts before declaring the endpoint is not accessible. (default 3)

  -retryInterval duration
        Time to wait before pinging an endpoint in case of error. (default 3s)
You might also like...
Quick find namespace and show log

kubernetes dashboard "替代品" 在terminal发起http请求查看kubernetes相关的信息 注意 本程序以查看当前namespace、deployment、pod等信息为主, 面向业务开发人员,主要原因是权限受限。如果是运维人员绕行即可 当前只是使用与token登录方

To copy a secret to another namespace and sync it up-to-date

Secret Mirror Operator This kubebuilder-based Kubernetes operator copies a Secret to another namespace and synchronizes it with the custom resource Se

Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users.

Quota Operator Enforcing per team quota (sum of used resources across all their namespaces) and delegating the per namespace quota to users. Instructi

Go-namesys - Go-namesys provides publish and resolution support for the /ipns/ namespace

go-namesys go-namesys provides publish and resolution support for the /ipns/ nam

A kubectl plugin to query multiple namespace at the same time.

kubemulti A kubectl plugin to query multiple namespace at the same time. $ kubemulti get pods -n cdi -n default NAMESPACE NAME

Display (Namespace, Pod, Container, Primary PID) from a host PID, fails if the target process is running on host

Display (Namespace, Pod, Container, Primary PID) from a host PID, fails if the target process is running on host

Controller-check - Run checks against K8s controllers to verify if they meets certain conventions

controller-check Run checks against K8s controllers to verify if they meets cert

A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers
A k8s vault webhook is a Kubernetes webhook that can inject secrets into Kubernetes resources by connecting to multiple secret managers

k8s-vault-webhook is a Kubernetes admission webhook which listen for the events related to Kubernetes resources for injecting secret directly from sec

Bootstrap curated Kubernetes stacks. Logging, metrics, ingress and more - delivered with gitops.

Gimlet Stack Bootstrap curated Kubernetes stacks. Logging, metrics, ingress and more - delivered with gitops. You can install logging aggregators, met

Releases(v1.0.0)
Owner
Aaron Tam
Aaron Tam
vcluster - Create fully functional virtual Kubernetes clusters - Each cluster runs inside a Kubernetes namespace and can be started within seconds

Website • Quickstart • Documentation • Blog • Twitter • Slack vcluster - Virtual Clusters For Kubernetes Lightweight & Low-Overhead - Based on k3s, bu

Loft Labs 2.3k Jan 4, 2023
An extensible tool for creating your own in cluster health endpoints

healthyk8s an extensible tool for creating your own "in cluster" health endpoints Why? allows for creating a health endpoint for anything - external r

Nic Grobler 0 Oct 26, 2021
Command kube-tmux prints Kubernetes context and namespace to tmux status line.

kube-tmux Command kube-tmux prints Kubernetes context and namespace to tmux status line.

null 7 Sep 10, 2021
Good enough Kubernetes namespace visualization tool

Kubesurveyor Good enough Kubernetes namespace visualization tool. No provisioning to a cluster required, only Kubernetes API is scrapped. Installation

Peter Gasper 81 Dec 7, 2022
Kubernetes Admission Controller Demo: Validating Webhook for Namespace lifecycle events

Kubernetes Admission Controller Based on How to build a Kubernetes Webhook | Admission controllers Local Kuberbetes cluster # create kubernetes cluste

Marco Lehmann 2 Feb 27, 2022
Kubedd – Check migration issues of Kubernetes Objects while K8s upgrade

Kubedd – Check migration issues of Kubernetes Objects while K8s upgrade

Devtron Labs 195 Dec 19, 2022
Bump-version - Bump a given semantic version, following a given version fragment

bump-version Bump a given semantic version, following a given version fragment.

Weslei Juan Novaes Pereira 3 Feb 7, 2022
Samantha 0 Feb 12, 2022
Xds - A simple xDS server, distributing Kubernetes service endpoints to clients

xDS Server for gRPC on Kubernetes A simple xDS server, distributing Kubernetes s

Wongnai 37 Nov 20, 2022
A simple and flexible health check library for Go.

Health A simple and flexible health check library for Go. Documentation · Report Bug · Request Feature Table of Contents Getting started Synchronous v

Alexander Liesenfeld 637 Jan 4, 2023