Skip to content

ebauman/prometheus-rancher-exporter

Folders and files

NameName
Last commit message
Last commit date
Jan 5, 2022
Feb 1, 2022
Jan 28, 2022
Feb 1, 2022
Feb 1, 2022
Jan 4, 2022
Jan 5, 2022
Jan 20, 2022
Jan 20, 2022
Jan 28, 2022
Jan 15, 2022

Repository files navigation

Prometheus Exporter for Rancher

Current Metrics Scraped:

  • Rancher Major/Minor/Patch versions
  • Total number of Managed clusters
  • Number of RKE/RKE2/K3s/EKS/AKS/GKE clusters

Prereqs

  • Decide how to auth with the local cluster:

In-cluster config

Uncomment the following from main.go

// Use this for in-cluster config 
//config, err := rest.InClusterConfig()

External cluster config

(default) and is handled by the following code in main.go

// Use this for out of cluster config
currentUser, err := user.Current()
if err != nil {
	log.Fatal(err.Error())
}

kubeconfig := flag.String("kubeconfig", fmt.Sprintf("/home/%s/.kube/config", currentUser.Username), "absolute path to the kubeconfig file")
flag.Parse()
config, err := clientcmd.BuildConfigFromFlags("", *kubeconfig)

Testing

go run main.go and access http://localhost:8080

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published