Git Product home page Git Product logo

kube-annotate's Introduction

kube-annotate

Build Status Go Report Card codecov Automated Docker Build Docker Pulls

Kubernetes mutating admission webhook to automatically annotate pods.

Features:

  • Automatically annotate new pods with certain labels
  • YAML-based configuration for multiple rules
  • Built-in Prometheus metrics exporter

Configurations:

  • LOG_FORMAT: json/text
  • LOG_LEVEL: trace/debug/info/warning/error/fatal/panic
  • RULES_FILE: path to config.yaml
  • TLS_ENABLED: must be true when running inside Kubernetes cluster as admission controller
  • TLS_CRT: path to certfile for TLS config
  • TLS_KEY: path to keyfile for TLS config

Rules config sample:

# config.yaml
- selector:
    app: http-service
  annotations:
    log.config.scalyr.com/include: true
- selector:
    app: postgresql
  annotations:
    log.config.scalyr.com/include: false

Setup:

  1. Make sure the cluster support admission controller (at least Kubernetes 1.9)
  2. Prepare TLS certificate (see Medium post below, you need cluster-admin permission)
  3. Create kubernetes resources (see examples directory, please read the comments especially about CA bundle and certificates)
  4. Label the namespace you want to enable (kubectl label namespace ${namespace} kube-annotate=enabled)

TODO:

  • bind internal endpoints (health, metrics) to separate port
  • proper request/response logging
  • prometheus exporter
  • helm chart for easier setup

References:

kube-annotate's People

Contributors

akhy avatar

Watchers

 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.