Skip to content

ChrsMark/k8sdiscovery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

K8s Pod discovery

This small project provides a Pod Autodiscovery example based on github.com/elastic/elastic-agent-autodiscover library.

Building

docker build -t k8sdiscovery .
docker tag k8sdiscovery:latest chrismark/k8sdiscovery:v0.0.1

Uploading to a registry

docker tag k8sdiscovery:latest chrismark/k8sdiscovery:v0.0.1
docker push chrismark/k8sdiscovery:v0.0.1

Load in a kind cluster to use it locally

kind load docker-image chrismark/k8sdiscovery:v0.0.1

And uncomment the imagePullPolicy: Never inside the manifest

Run on Kubernetes

kubectl apply -f k8sdiscovery-kubernetes.yml
kubectl -n kube-system port-forward pod/k8sdiscovery 6060:6060

Profiling the program

After having deployed everything on the cluster, run the following command to take the heap profile of the program: 1go tool pprof -png http://localhost:6060/debug/pprof/heap > out.png

In order to take profiles over time run: bash profiler.sh and check the profiles stored under /profiles directory.

About

K8s Pod Autodiscovery sample app

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published