options

package
v2.0.0-beta.0...-3bc1883 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

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}

	// DefaultResources represents the default set of resources in kube-state-metrics.
	DefaultResources = ResourceSet{
		"certificatesigningrequests":      struct{}{},
		"configmaps":                      struct{}{},
		"cronjobs":                        struct{}{},
		"daemonsets":                      struct{}{},
		"deployments":                     struct{}{},
		"endpoints":                       struct{}{},
		"horizontalpodautoscalers":        struct{}{},
		"ingresses":                       struct{}{},
		"jobs":                            struct{}{},
		"leases":                          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 LabelsAllowList

type LabelsAllowList map[string][]string

LabelsAllowList represents a list of allowed labels for metrics.

func (*LabelsAllowList) Set

func (l *LabelsAllowList) Set(value string) error

Set converts a comma-separated string of resources and their allowed Kubernetes labels and appends to the LabelsAllowList. Value is in the following format: resource=[k8s-label-name,another-ks8-label],another-resource[ks8-label] Example: pods=[app.kubernetes.io/component,app],resource=[blah]

func (*LabelsAllowList) String

func (l *LabelsAllowList) String() string

func (*LabelsAllowList) Type

func (l *LabelsAllowList) Type() string

Type returns a descriptive string about the LabelsAllowList 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
	Resources       ResourceSet
	Namespaces      NamespaceList
	Shard           int32
	TotalShards     int
	Pod             string
	Namespace       string
	MetricDenylist  MetricSet
	MetricAllowlist MetricSet
	Version         bool
	LabelsAllowList LabelsAllowList

	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.

type ResourceSet

type ResourceSet map[string]struct{}

ResourceSet represents a collection which has a unique set of resources.

func (ResourceSet) AsSlice

func (r ResourceSet) AsSlice() []string

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

func (*ResourceSet) Set

func (r *ResourceSet) Set(value string) error

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

func (*ResourceSet) String

func (r *ResourceSet) String() string

func (*ResourceSet) Type

func (r *ResourceSet) Type() string

Type returns a descriptive string about the ResourceSet type.

Jump to

Keyboard shortcuts

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