File issues using the standard Github issue tracker for the repo.
- Run ./build.sh
- To run the tests:
go test -v ./kubestate
You will need a Kubernetes cluster to fetch metrics from. A quick way to get going is to use Minikube.
You can use client_test.go as way to test if you can successfully contact the cluster. Remove Skip
from SkipConvey
to enable the tests and then run go test -v ./kubestate
To test the snap task locally with the snap server (snapd or snapteld):
- Load the plugin:
snapctl plugin load build/snap-plugin-collector-kubestate
orsnaptel plugin load build/snap-plugin-collector-kubestate
if you have latest version of Snap. - If you want to publish the results to a file, you need to download the file publisher plugin and load that too:
snapctl plugin load snap-plugin-publisher-file_linux_x86_64
- Create a task using the example task after editing the config to point to your Kubernetes config file:
snapctl task create -t examples/task.json
snapctl task list
to check if it is running and thensnapctl task watch <task id>
to see the value being fetched.