options

package
v1.9.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 19, 2021 License: Apache-2.0 Imports: 8 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// DefaultNamespaces is the default namespace selector for selecting and filtering across all namespaces.
	DefaultNamespaces = NamespaceList{metav1.NamespaceAll}

	// DefaultCollectors represents the default set of collectors in kube-state-metrics.
	DefaultCollectors = CollectorSet{
		"certificatesigningrequests":      struct{}{},
		"configmaps":                      struct{}{},
		"cronjobs":                        struct{}{},
		"daemonsets":                      struct{}{},
		"deployments":                     struct{}{},
		"endpoints":                       struct{}{},
		"horizontalpodautoscalers":        struct{}{},
		"ingresses":                       struct{}{},
		"jobs":                            struct{}{},
		"limitranges":                     struct{}{},
		"mutatingwebhookconfigurations":   struct{}{},
		"namespaces":                      struct{}{},
		"networkpolicies":                 struct{}{},
		"nodes":                           struct{}{},
		"persistentvolumes":               struct{}{},
		"persistentvolumeclaims":          struct{}{},
		"poddisruptionbudgets":            struct{}{},
		"pods":                            struct{}{},
		"replicasets":                     struct{}{},
		"replicationcontrollers":          struct{}{},
		"resourcequotas":                  struct{}{},
		"secrets":                         struct{}{},
		"services":                        struct{}{},
		"statefulsets":                    struct{}{},
		"storageclasses":                  struct{}{},
		"validatingwebhookconfigurations": struct{}{},
		"volumeattachments":               struct{}{},
	}
)

Functions

This section is empty.

Types

type CollectorSet

type CollectorSet map[string]struct{}

CollectorSet represents a collection which has a unique set of collectors.

func (CollectorSet) AsSlice added in v1.5.0

func (c CollectorSet) AsSlice() []string

AsSlice returns the Collector in the form of a plain string slice.

func (*CollectorSet) Set

func (c *CollectorSet) Set(value string) error

Set converts a comma-separated string of collectors into a slice and appends it to the CollectorSet.

func (*CollectorSet) String

func (c *CollectorSet) String() string

func (*CollectorSet) Type

func (c *CollectorSet) Type() string

Type returns a descriptive string about the CollectorSet type.

type MetricSet

type MetricSet map[string]struct{}

MetricSet represents a collection which has a unique set of metrics.

func (*MetricSet) Set

func (ms *MetricSet) Set(value string) error

Set converts a comma-separated string of metrics into a slice and appends it to the MetricSet.

func (*MetricSet) String

func (ms *MetricSet) String() string

func (*MetricSet) Type

func (ms *MetricSet) Type() string

Type returns a descriptive string about the MetricSet type.

type NamespaceList

type NamespaceList []string

NamespaceList represents a list of namespaces to query from.

func (*NamespaceList) IsAllNamespaces

func (n *NamespaceList) IsAllNamespaces() bool

IsAllNamespaces checks if the Namespace selector is that of `NamespaceAll` which is used for selecting or filtering across all namespaces.

func (*NamespaceList) Set

func (n *NamespaceList) Set(value string) error

Set converts a comma-separated string of namespaces into a slice and appends it to the NamespaceList

func (*NamespaceList) String

func (n *NamespaceList) String() string

func (*NamespaceList) Type

func (n *NamespaceList) Type() string

Type returns a descriptive string about the NamespaceList type.

type Options

type Options struct {
	Apiserver                            string
	Kubeconfig                           string
	Help                                 bool
	Port                                 int
	Host                                 string
	TelemetryPort                        int
	TelemetryHost                        string
	Collectors                           CollectorSet
	Namespaces                           NamespaceList
	Shard                                int32
	TotalShards                          int
	Pod                                  string
	Namespace                            string
	MetricBlacklist                      MetricSet
	MetricWhitelist                      MetricSet
	Version                              bool
	DisablePodNonGenericResourceMetrics  bool
	DisableNodeNonGenericResourceMetrics bool

	EnableGZIPEncoding bool
	// contains filtered or unexported fields
}

Options are the configurable parameters for kube-state-metrics.

func NewOptions

func NewOptions() *Options

NewOptions returns a new instance of `Options`.

func (*Options) AddFlags

func (o *Options) AddFlags()

AddFlags populated the Options struct from the command line arguments passed.

func (*Options) Parse

func (o *Options) Parse() error

Parse parses the flag definitions from the argument list.

func (*Options) Usage

func (o *Options) Usage()

Usage is the function called when an error occurs while parsing flags.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL