Documentation
¶
Overview ¶
Package census surveys container image names in a Kubernetes cluster.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
A Client is a configurable Taker wrapping kubernetes.Interface.
func NewClient ¶
func NewClient(clientset kubernetes.Interface, opts ...Option) (*Client, error)
NewClient returns a Taker that surveys resources from clientset. If no WithLister option is included in opts, no resources will be surveyed.
func NewDefaultClient ¶
func NewDefaultClient(clientset kubernetes.Interface, opts ...Option) (*Client, error)
NewDefaultClient returns a Taker that surveys CronJob, DaemonSet, Deployment, Job, and StatefulSet resources from clientset.
type Option ¶
type Option func(c *Client)
An Option is an option applied when creating a Client.
func WithLister ¶
func WithLister(lister PodSpecLister) Option
WithLister adds a PodSpecLister for a Client to survey.
func WithLogger ¶
WithLogger sets a logger for a Client to output to.
func WithPageSize ¶
WithPageSize sets the maximum number of responses a Client should request in a single Kubernetes API call.
func WithStatsdClient ¶
func WithStatsdClient(client statsd.ClientInterface) Option
WithStatsdClient sets a statsd client to use to report metrics from a Client.
type PodSpecLister ¶
type PodSpecLister interface { // List returns the result of a List method on the clientset for the // resource kind associated with the PodSpecLister. List(ctx context.Context, clientset kubernetes.Interface) (runtime.Object, error) // GetPodSpec returns the PodSpec associated with obj, which will be of // the same type as the elements of the list returned by the List // method. GetPodSpec(ctx context.Context, obj runtime.Object) (v1.PodSpec, error) }
PodSpecLister is implemented for resource kinds which contain a PodSpec and can be listed via the Kubernetes API.
var CronJobLister PodSpecLister = &cronJobLister{}
CronJobLister lists the PodSpecs of all CronJobs in a Kubernetes cluster.
var DaemonSetLister PodSpecLister = &daemonSetLister{}
DaemonSetLister lists the PodSpecs of all DaemonSets in a Kubernetes cluster.
var DeploymentLister PodSpecLister = &deploymentLister{}
DeploymentLister lists the PodSpecs of all Deployments in a Kubernetes cluster.
var JobLister PodSpecLister = &jobLister{}
JobLister lists the PodSpecs of all Jobs in a Kubernetes cluster.
var StatefulSetLister PodSpecLister = &statefulSetLister{}
StatefulSetLister lists the PodSpecs of all StatefulSets in a Kubernetes cluster.