k8snode

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Name = "kubernetes_node"

Variables

View Source
var DefaultArguments = Config{
	KubernetesAPIConfig: otelcol.KubernetesAPIConfig{
		AuthType: otelcol.KubernetesAPIConfig_AuthType_None,
	},
	NodeFromEnvVar: "K8S_NODE_NAME",
	ResourceAttributes: ResourceAttributesConfig{
		K8sNodeName: rac.ResourceAttributeConfig{Enabled: true},
		K8sNodeUID:  rac.ResourceAttributeConfig{Enabled: true},
	},
}

Functions

This section is empty.

Types

type Config

type Config struct {
	KubernetesAPIConfig otelcol.KubernetesAPIConfig `alloy:",squash"`
	// NodeFromEnv can be used to extract the node name from an environment
	// variable. The value must be the name of the environment variable.
	// This is useful when the node where Alloy will run on cannot be
	// predicted. In such cases, the Kubernetes downward API can be used to
	// add the node name to each pod as an environment variable. K8s tagger
	// can then read this value and filter pods by it.
	//
	// For example, node name can be passed to Alloy with the downward API as follows
	//
	// env:
	//   - name: K8S_NODE_NAME
	//     valueFrom:
	//       fieldRef:
	//         fieldPath: spec.nodeName
	//
	// Then the NodeFromEnv field can be set to `K8S_NODE_NAME` to filter all pods by the node that
	// Alloy is running on.
	//
	// More on downward API here: https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/
	NodeFromEnvVar     string                   `alloy:"node_from_env_var,attr,optional"`
	ResourceAttributes ResourceAttributesConfig `alloy:"resource_attributes,block,optional"`
}

func (Config) Convert

func (args Config) Convert() map[string]interface{}

func (*Config) SetToDefault

func (c *Config) SetToDefault()

SetToDefault implements syntax.Defaulter.

type ResourceAttributesConfig

type ResourceAttributesConfig struct {
	K8sNodeName rac.ResourceAttributeConfig `alloy:"k8s.node.name,block,optional"`
	K8sNodeUID  rac.ResourceAttributeConfig `alloy:"k8s.node.uid,block,optional"`
}

ResourceAttributesConfig provides config for k8snode resource attributes.

func (ResourceAttributesConfig) Convert

func (r ResourceAttributesConfig) Convert() map[string]interface{}

Jump to

Keyboard shortcuts

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