command
module
Version:
v0.3.4
Opens a new window with list of versions in this module.
Published: Dec 23, 2018
License: MIT
Opens a new window with license information.
Imports: 15
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
kube-annotate
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:
- Make sure the cluster support admission controller (at least Kubernetes 1.9)
- Prepare TLS certificate (see Medium post below, you need cluster-admin permission)
- Create kubernetes resources (see
examples
directory, please read the comments especially about CA bundle and certificates)
- 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:
Documentation
¶
There is no documentation for this package.
Source Files
¶
Directories
¶
Click to show internal directories.
Click to hide internal directories.