Skip to content

Kepler Operator on Kind


Before you start make sure you have:

  • kubectl installed
  • kind installed
  • Clone the kepler-operator repository
  • Sign in as kubeadmin or a user with cluster-admin role


Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster kubectl cluster-info shows).

Run a kind cluster locally

cd kepler-operator
make cluster-up

Run kepler-operator

  • You can use the image from to deploy kepler-operator.

    make deploy[VERSION]
    kubectl apply -k config/samples/
  • Alternatively, if you like to setup cluster, build and use your own images

    make fresh

    The above will create a kind cluster build and push operator and bundle images to local registry.

Set up Grafana Dashboard

Using GRAFANA_ENABLE=true and PROMETHEUS_ENABLE=true when running make cluster-up configures the kube-prometheus monitoring stack in the namespace monitoring. To access the Grafana Console locally on the browser port-forward on 3000 using the following command:

kubectl port-forward svc/grafana 3000:3000 -n monitoring


Grafana Console can be accessed on http://localhost:3000

Service Monitor

For kube-prometheus to scrape kepler-exporter service endpoint you need to configure a service monitor.


By default kube-prometheus does not let you scrape services deployed in namespaces other than monitoring. So if you are running Kepler outside monitoring follow this to set up Prometheus to scrape all namespaces.

kubectl apply -n monitoring -f - << EOF
kind: ServiceMonitor
  labels: exporter kepler-exporter kepler
  name: monitor-kepler-exporter
  - interval: 3s
    port: http
    - action: replace
      regex: (.*)
      replacement: $1
      - __meta_kubernetes_pod_node_name
      targetLabel: instance
    scheme: http
    any: true
    matchLabels: exporter kepler-exporter

Grafana Dashboard

To set up the Grafana dashboard follow these steps:

Uninstall the operator

To delete the CRDs, roles, roleBindings etc from the cluster:

make undeploy


Scrape all namespaces

kube-prometheus by default does not let you scrape services in namespaces outside monitoring. This is controlled by RBAC. The clusterrole prometheus-k8s should have below policy to scrape services in all namespaces.

kubectl describe clusterrole prometheus-k8s
Name:         prometheus-k8s
Annotations:  <none>
  Resources                    Non-Resource URLs  Resource Names  Verbs
  ---------                    -----------------  --------------  -----
  endpoints                    []                 []              [get list watch]
  pods                         []                 []              [get list watch]
  services                     []                 []              [get list watch]  []                 []              [get list watch]
                               [/metrics]         []              [get]
  nodes/metrics                []                 []              [get]

Copyright Contributors to the Kepler's project.

The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see Trademark Usage.