Git Product home page Git Product logo

hoenir's Introduction

Hoenir

Hoenir is a composition of multiple Kubernetes controllers that makes your life easier.

Running the project

To run from source, use ./gradlew run.

A Docker image is also available: docker run -v ~/.kube/config:/root/.kube/config valensas/hoenir.

Hoenir uses the same configuration as kubectl to connect to your cluster. Therefore, you can set any environment variables necessary to connect to your cluster such as KUBECONFIG or KUBECONTEXT. When running within Kubernetes, it will by default pick up the service account credentials and auto-discover the master endpoint.

Grafana Dashboard Controller

Downloads Grafana dashboards into ConfigMaps given a dashboard id and an optional revision. The ConfigMap is then usable as persistent Grafana dashboard.

Usage

Create a ConfigMap with the proper labels

apiVersion: v1
kind: ConfigMap
metadata:
  name: my-dashboard
  labels:
    grafana_dashboard: '1'
    grafana.valensas.com/dashboard: '11074' # The dashboard id from grafana.com
    grafana.valensas.com/revision: '9' # The revision of the dashboard from grafana.com, optional

The data of the ConfigMap will be automatically populated by the controller.

Configuration

Use the following environment variable to configure the controller:

WATCH_NAMESPACE: The namespace to watch for ConfigMaps. Unset to watch all namespaces. Defaults to all namesapces.

GRAFANA_DISABLED: Set to any value to disable the controller.

GRAFANA_DEFAULT_DATASOURCE_NAME: The default datasource to use in dashboards. Defaults to "Prometheus".

GRAFANA_WORKERS: Number of workers to use for the controller. Defaults to cores / 2.

Virtual Service Controller

Creates an Ingress to Istio's Ingress Gateway for a VirtualService definition. This setup is mainly useful when using both an Ingress Controller and Istio but want to have a single point of entry for both.

Usage

Create a VirtualService like the one below:

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: web
  namespace: test
  labels:
    hello: 'world'
    # Set this label for the controller to pick up the VirtualService
    istio.valensas.com/ingress: 'true'
  annotations:
    # Sets the ingressClass for the ingress, optional
    istio.valensas.com/ingress-class: 'nginx'
    # Use TLS for the Ingress 
    istio.valensas.com/ingress-tls: 'true'
    # Use this secret for TLS. f TLS is enabled without a
    # secret, a unique name is generated.
    istio.valensas.com/tls-secret: 'my-secret'
    # The ingress gateway service to use for the created Ingress
    istio.valensas.com/ingressgateway-service: 'istio-ingressgateway'
    # The ingress gateway port to use for the created Ingress
    istio.valensas.com/ingressgateway-port: '8080'
    
spec:
  hosts:
  - example.com
  http:
  - route:
    - destination:
        host: web
        port:
          number: 80

Configuration

Use the following environment variable to configure the controller:

WATCH_NAMESPACE: The namespace to watch for ConfigMaps. Unset to watch all namespaces. Defaults to all namesapces.

VIRTUALSERVICE_DISABLED: Set to any value to disable the controller.

ISTIO_NAMESPACE: The namespace where Istio is installed. Defaults to "istio-system"

ISTIO_INGRESSGATEWAY_SERVICE: Service name of the Istio ingress gateway. Defaults to "istio-ingressgateway".

ISTIO_INGRESSGATEWAY_PORT: The port to use for the Istio ingress gateway. Defaults to 8080.

VIRTUALSERVICE_WORKERS: Number of workers to use for the controller. Defaults to cores / 2.

hoenir's People

Contributors

moray95 avatar

Stargazers

AKIN idil avatar

Watchers

AKIN idil avatar Ahmet Geymen avatar  avatar Semih Turan avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.