k8s-agent

module
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2024 License: Apache-2.0

README

k8s resource collector

K8s resource collector subscribes to the changes in the K8s API server for a specified set of resource types. By default, it collects updates to the following resource types.

  • configMap
  • cronJob
  • daemonSet
  • deployment
  • event
  • job
  • namespace
  • node
  • persistentVolumeClaim
  • persistentVolume
  • pod
  • podTemplate
  • replicaSet
  • resourceQuota
  • secret
  • serviceAccount
  • service
  • statefulSet
  • ingressClass
  • ingress
  • networkPolicy
  • hpa objects (if hpa is used)
  • vpa objects (if vpa is used)
  • keda objects (if keda is used)

For configmaps and secrets, the data field is deleted since it may contain sensitive information.

Deploy to your cluster

kubectl apply -f manifests/k8s-agent.yaml

Uninstall

kubectl delete -f manifests/k8s-agent.yaml

Stream to webb.ai

You will need to edit the CLIENT_ID and API_KEY env var in manifests/k8s-resource-collector.yaml to stream the data to webb.ai. Reach out to us to get a CLIENT_ID and API_KEY.

See staged data

pod_name=$(kubectl get pods -n webbai | grep resource-collector | awk '{print $1}')
kubectl exec --stdin --tty $pod_name -n webbai -- /bin/sh
cd /app/data/
cat k8s_resource.log
cat k8s_traffic.log

Each row of k8s_resource.log and k8s_traffic.log is a json.

Directories

Path Synopsis
cmd
pkg
api
k8s

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL