Skip to content

Heptio Sonobuoy is a diagnostic tool that makes it easier to understand the state of a Kubernetes cluster by running a set of Kubernetes conformance tests in an accessible and non-destructive manner. Brought to you by Heptio.

License

Notifications You must be signed in to change notification settings

chuckha/sonobuoy

 
 

Repository files navigation

Sonobuoy

Maintainers: Heptio

Build Status

Overview

Heptio Sonobuoy is a diagnostic tool that makes it easier to understand the state of a Kubernetes cluster by running a set of Kubernetes conformance tests in an accessible and non-destructive manner. It is a customizable, extendable, and cluster-agnostic way to generate clear, informative reports about your cluster--regardless of your deployment details.

Its selective data dumps of Kubernetes resource objects and cluster nodes allow for the following use cases:

Quickstart

Heptio provides prebuilt Sonobuoy container images in its Google Container Registry (gcr.io/heptio-images). For the sake of faster setup on your cluster, this quickstart pulls from this registry to skip the container build process. You can use this same process to deploy Sonobuoy to production.

See Build From Scratch for instructions on building Sonobuoy yourself.

This guide executes a Sonobuoy run on your cluster, and records the following results:

  • Basic info about your cluster's hosts, Kubernetes resources, and versions.
  • (Via plugin) systemd logs from each host
  • (Via plugin) The results of a single e2e conformance test ("Pods should be submitted and removed"). See the conformance guide for configuration details.

0. Prerequisites

1. Download

Clone or fork the Sonobuoy repo:

git clone git@github.com:heptio/sonobuoy.git

2. Run

Run the following command in the Sonobuoy root directory to deploy a Sonobuoy pod to your cluster:

kubectl apply -f examples/quickstart/

You can view actively running pods with the following command:

kubectl get pods -l component=sonobuoy --namespace=heptio-sonobuoy

To verify that Sonobuoy has completed successfully, check the logs:

kubectl logs -f sonobuoy --namespace=heptio-sonobuoy

If you see the log line no-exit was specified, sonobuoy is now blocking, the Sonobuoy pod has completed its data collection.

Notes:

  • The Sonobuoy pod in this example continues to run after it finishes data collection, due to the --no-exit flag in its YAML manifest. This allows you to easily grab the results tarball.

  • Sonobuoy collects one data report per run---each time you want a new report you need to delete the existing Sonobuoy YAML files and reapply them (see the tear down step).

  • In practice, you should make sure that the Sonobuoy pod writes its results to a Persistent Volume. The quickstart example writes its output to an emptyDir volume for simplicity.

Troubleshooting errors from kubectl logs:

  • plugin <name> does not exist

    • Delete the sonobuoy pod via kubectl delete pod sonobuoy --namespace heptio-sonobuoy and rerun the kubectl apply command above. This error occurs when Sonobuoy's ConfigMap creations are not completed before its pod creation. While the YAML files in examples/quickstart use numeric prefixes ("00-", "10-", etc.) to specify the order of resource creation, kubectl apply is asynchronous and can result in dependency issues.
  • Other errors

    • If you are able to debug and resolve the issue on your own, make sure to delete and reapply Sonobuoy's YAML manifests. Otherwise, file an issue.

To view the output, copy the output directory from the main Sonobuoy pod to somewhere local:

kubectl cp heptio-sonobuoy/sonobuoy:/tmp/sonobuoy ./results --namespace=heptio-sonobuoy

There should a collection of tarballs inside of ./results , where each tarball corresponds to a single Sonobuoy run. If you unzip one of these data dumps, you should see sub-directories containing info about hosts, plugins, resources, and serverversion. If you have time, look through these directories to get a sense for Sonobuoy's capabilities.

NOTE: At this time, the layout of the contents of the tarball is subject to change.

3. Tear down

To clean up Kubernetes objects created by Sonobuoy, run the following commands:

kubectl delete -f examples/quickstart/

Further documentation

To learn how to configure your Sonobuoy runs and integrate plugins, see the /docs directory.

Troubleshooting

If you encounter any problems that the documentation does not address, file an issue.

Contributing

Thanks for taking the time to join our community and start contributing!

Before you start

  • Please familiarize yourself with the Code of Conduct before contributing.
  • See CONTRIBUTING.md for instructions on the developer certificate of origin that we require.

Pull requests

  • We welcome pull requests. Feel free to dig through the issues and jump in.

Changelog

See the list of releases to find out about feature changes.

About

Heptio Sonobuoy is a diagnostic tool that makes it easier to understand the state of a Kubernetes cluster by running a set of Kubernetes conformance tests in an accessible and non-destructive manner. Brought to you by Heptio.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 97.7%
  • Makefile 1.5%
  • Shell 0.8%