Skip to content

The most flexible way to generate badges representing what happens in your cluster.

License

Notifications You must be signed in to change notification settings

tobilarscheid/kube-badger

Repository files navigation

kube-badger

The most flexible way to generate badges representing what happens in your cluster.

Example

Basically, you can turn every information available from the kubernetes API into a badge:

badge: image petstore:v-1.1.2

badge: desired replicas

badge: available replicas 1

badge: version-label 1.1.2

badge: clusterIP 10.111.204.106

badge: IngressIP 10.0.2.15

How does it work

To generate a badge, you pass the full link to a kubernetes API resource and an optional jq string to filter the resource to the badger:

https://<YOUR-CLUSTER>/badge/<API-RESOURCE>?jq=<FILTER>&<ADDITIONAL-PARAMS>

Suppose you have a deployment in your cluster:

{
    "apiVersion": "extensions/v1beta1",
    "kind": "Deployment",
    "metadata": {
        "labels": {
            "version": "2"
        },
        "name": "petstore",
        "selfLink": "/apis/extensions/v1beta1/namespaces/default/deployments/petstore"
    },
    "spec": {}
}

Now, let's say you wanted a badge stating the currently deployed version. You request it like so (note how you pass the full selfLink of the deployment):

https://your-badger-installation/badge/apis/extensions/v1beta1/namespaces/default/deployments/petstore?jq=.metadata.labels.version

You will receive the following badge:

badge: apis/extensions/v1beta1/namespaces/default/deployments/petstore 2

You can customize the badge by passing some more query parameters:

&label=petstore-version

badge: petstore-version 2

&color=green

badge: apis/extensions/v1beta1/namespaces/default/deployments/petstore 2

Installation

Simple:

helm install https://github.com/tobilarscheid/kube-badger/releases/download/0.1.0/kube-badger-0.1.0.tgz --values=myvalues.yaml

Make sure to provide a values yaml specifiying what API resources your kube-badger should be allowed to access. For details see the chart README.

Security

Running the kube badger in your cluster can potentially provide an attacker with full read access to your clusters API server. You can either restrict this through RBAC (by restricting the kube-badgers serviceaccount) or through Ingress (by restricting the paths someone can pass to the kube-badger). Both ways are described in detail in the helm chart's README.

Credits

All badges are generated by shields.io.

About

The most flexible way to generate badges representing what happens in your cluster.

Resources

License

Stars

Watchers

Forks

Packages

No packages published