You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: pkg/options/options.go
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -45,8 +45,8 @@ type Options struct {
45
45
TotalShardsint
46
46
Podstring
47
47
Namespacestring
48
-
MetricDenylistMetricSet
49
-
MetricAllowlistMetricSet
48
+
MetricDenylistMetricSet`yaml:"metric_denylist"`
49
+
MetricAllowlistMetricSet`yaml:"metric_allowlist"`
50
50
MetricOptInListMetricSet
51
51
Versionbool
52
52
AnnotationsAllowListLabelsAllowList
@@ -60,6 +60,8 @@ type Options struct {
60
60
CustomResourceConfigFilestring
61
61
CustomResourcesOnlybool
62
62
63
+
optsConfigFilestring
64
+
63
65
cmd*cobra.Command
64
66
}
65
67
@@ -133,6 +135,7 @@ func (o *Options) AddFlags(cmd *cobra.Command) {
133
135
o.cmd.Flags().StringVar(&o.Pod, "pod", "", "Name of the pod that contains the kube-state-metrics container. "+autoshardingNotice)
134
136
o.cmd.Flags().StringVar(&o.TLSConfig, "tls-config", "", "Path to the TLS configuration file")
135
137
o.cmd.Flags().StringVar(&o.TelemetryHost, "telemetry-host", "::", `Host to expose kube-state-metrics self metrics on.`)
138
+
o.cmd.Flags().StringVar(&o.optsConfigFile, "options-config-file", "", "Path to the kube-state-metrics options config file")
136
139
o.cmd.Flags().StringVar((*string)(&o.Node), "node", "", "Name of the node that contains the kube-state-metrics pod. Most likely it should be passed via the downward API. This is used for daemonset sharding. Only available for resources (pod metrics) that support spec.nodeName fieldSelector. This is experimental.")
137
140
o.cmd.Flags().Var(&o.AnnotationsAllowList, "metric-annotations-allowlist", "Comma-separated list of Kubernetes annotations keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional annotations provide a list of resource names in their plural form and Kubernetes annotation keys you would like to allow for them (Example: '=namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...)'. A single '*' can be provided per resource instead to allow any annotations, but that has severe performance implications (Example: '=pods=[*]').")
138
141
o.cmd.Flags().Var(&o.LabelsAllowList, "metric-labels-allowlist", "Comma-separated list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'. A single '*' can be provided per resource instead to allow any labels, but that has severe performance implications (Example: '=pods=[*]'). Additionally, an asterisk (*) can be provided as a key, which will resolve to all resources, i.e., assuming '--resources=deployments,pods', '=*=[*]' will resolve to '=deployments=[*],pods=[*]'.")
0 commit comments