Giter VIP home page Giter VIP logo

kube-metrics-server-exporter's Introduction

kube-metrics-server-exporter

GitHub tag (latest by date) GitHub last commit

Generic badge Docker Version Docker Pulls Docker Cloud Automated build Docker Cloud Build Status

kube-metrics-server-exporter provides cpu and memory metrics for Kubernetes nodes and pods, directly querying the metrics-server API /apis/metrics.k8s.io/v1beta1/{pods, nodes}

Features

Node metrics

  • kube_metrics_server_nodes_mem
    • Provides nodes memory information in kibibytes.
  • kube_metrics_server_nodes_cpu
    • Provides nodes CPU information in nanocores.

labels

  • instance

Pod metrics

  • kube_metrics_server_pods_mem
    • Provides pods/container memory information.
  • kube_metrics_server_pods_cpu
    • Provides pods/container memory information.

labels

  • pod_name
  • pod_namespace
  • pod_container_name

API metrics

  • kube_metrics_server_response_time
    • Provides API response time in seconds.

Variables

  • K8S_ENDPOINT

    • Url of API of kubernetes (default kubernetes.default.svc)
  • K8S_TOKEN

    • The authorization token (default ServiceAccount token)
  • K8S_FILEPATH_TOKEN

    • Path of ServiceAccount token file (default /var/run/secrets/kubernetes.io/serviceaccount/token)
  • K8S_CA_CERT_PATH

    • Path of Kubernetes CA certificate (default /var/run/secrets/kubernetes.io/serviceaccount/ca.crt)
  • NAMES_BLACKLIST

    • A list of names from pods, containers or namespaces to exclude from metrics.
  • NAMESPACE_WHITELIST

    • A list of namespace to scrape from this way you can create namespaced rolebinding instead of cluster binding. ( quite useful for larger clusters ) ( default : '' (all namespaces))
  • LABEL_SELECTOR

    • A list of Label Selectors.

Options

  • --insecure-tls
    • Disables TLS verification of the Kubernetes API Server. (Not recommended in production)

Blacklist

If you want, you could blacklist some names of namespaces, pods or containers, you just need to apply this ConfigMap, replacing the example names:

apiVersion: v1
kind: ConfigMap
metadata:
  name: metrics-server-exporter
  labels:
    k8s-app: metrics-server-exporter
data:
  NAMES_BLACKLIST: kube-proxy,calico-node,kube2iam  # example names

Usage

You will need K8S_TOKEN and K8S_ENDPOINT to access the api-server. Use "--insecure-tls" or mount the CA certificate into the container. Kubernetes will provide the CA certificate in a Kubernetes installation.

docker run -p 8000:8000 -e "K8S_ENDPOINT=${K8S_ENDPOINT}" -e "K8S_TOKEN=${K8S_TOKEN}" vivareal/metrics-server-exporter --insecure-tls

Build

docker buildx build --push --platform=linux/amd64,linux/arm64 -t vfabi/kube-metrics-server-exporter:latest -f Dockerfile .

Deploy

Use helm chart from deploy/helm folder.

helm install --name=metrics-server-exporter --namespace kube-system deploy/helm

Docker

Generic badge
Generic badge

kube-metrics-server-exporter's People

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.