Documentation
¶
Overview ¶
Package diagnostics collects failure diagnostics from an e2e cluster (pod logs, kubectl describes, DaemonSet state) into an artifact directory when a spec fails.
Index ¶
- Constants
- func WithArtifactDir(artifactDir string) func(*Diagnostic)
- func WithKubernetesClient(clientset kubernetes.Interface) func(*Diagnostic)
- func WithNFDClient(nfdClient *nfdclient.Clientset) func(*Diagnostic)
- func WithNamespace(namespace string) func(*Diagnostic)
- func WithObjects(objects ...string) func(*Diagnostic)
- type Collector
- type Config
- type Diagnostic
- type Option
Constants ¶
const ( // Pods is a core-group resource kind the diagnostic collectors handle. Pods = "pods" Nodes = "nodes" Namespaces = "namespaces" // Deployments is an apps-group resource kind the diagnostic collectors handle. Deployments = "deployments" DaemonSets = "daemonsets" // Jobs is a batch-group resource kind the diagnostic collectors handle. Jobs = "jobs" // NodeFeature is an NFD extension kind the diagnostic collectors handle. NodeFeature = "nodeFeature" NodeFeatureRule = "nodeFeatureRule" )
Resource-kind names the diagnostic collectors accept via WithObjects.
Variables ¶
This section is empty.
Functions ¶
func WithArtifactDir ¶
func WithArtifactDir(artifactDir string) func(*Diagnostic)
WithArtifactDir sets the on-disk directory dumps are written to.
func WithKubernetesClient ¶
func WithKubernetesClient(clientset kubernetes.Interface) func(*Diagnostic)
WithKubernetesClient wires in the core Kubernetes clientset the collectors use.
func WithNFDClient ¶
func WithNFDClient(nfdClient *nfdclient.Clientset) func(*Diagnostic)
WithNFDClient wires in the NFD clientset for NodeFeature / NodeFeatureRule dumps.
func WithNamespace ¶
func WithNamespace(namespace string) func(*Diagnostic)
WithNamespace scopes collection to the given namespace.
func WithObjects ¶
func WithObjects(objects ...string) func(*Diagnostic)
WithObjects selects which resource kinds (see the Pods/Nodes/... consts) to dump.
Types ¶
type Config ¶
type Config struct {
Clientset kubernetes.Interface
NfdClient *nfdclientset.Clientset
// contains filtered or unexported fields
}
Config is the shared state Collector implementations read from.
type Diagnostic ¶
type Diagnostic struct {
*Config
// contains filtered or unexported fields
}
Diagnostic is a configured collector set that dumps failure artifacts.
func New ¶
func New(opts ...Option) (*Diagnostic, error)
New builds a Diagnostic from the given options.