etcd2configsource

package
v0.98.0 Latest Latest
Warning

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

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

README

Etcd2 Config Source (Alpha)

Use the Etcd2 config source to retrieve data from Etcd2 and inject it into your collector configuration.

Configuration

Under the config_sources: use etcd2: or etcd2/<name>: to create a Etcd2 config source. The following parameters are available to customize Etcd2 config sources:

config_sources:
  etcd2:
    # endpoint is the Etcd2 server addresses. Config source will try to connect to
    # these endpoints to access an Etcd2 cluster.
    endpoints: [http://localhost:2379]
    # auth is a optional section used to indicate the authentication method to be used.
    # currently only username and password is supported.
    auth:
      # username is the etcd2 username used to identify the etcd2 user. 
      username: etcd2_username
      # password is password of the user specifying in the username field.
      password: etcd2_password 

If multiple paths are needed create different instances of the config source, example:

config_sources:
    # Assuming that the environment variables ETCD2_ADDR, ETCD2_USERNAME and $ETCD_PASSWORD 
    # are the defined and the different secrets are on the same server but at different paths.
    etcd2:
      endpoints: [$ETCD2_ADDR]
    etcd2/withauth:
      endpoints: [$ETCD2_ADDR]
      auth:
        username: $ETCD2_USERNAME
        password: $ETCD2_PASSWORD

# Both Etcd2 config sources can be used via their full name. Hypothetical example:
components:
  component_using_etcd2:
    token: $etcd2:/data/token

  component_using_etcd2_withauth:
    token: $etcd2/withauth:/data/token

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() configsource.Factory

NewFactory creates a new etcd2Factory instance

Types

type Authentication

type Authentication struct {
	// Username can be optionally used to authenticate with etcd2 cluster.
	Username string `mapstructure:"username"`

	// Password can be optionally used to authenticate with etcd2 cluster.
	Password string `mapstructure:"password"`
}

Authentication holds the authentication configuration for Etcd2 config source objects.

type Config

type Config struct {
	configsource.SourceSettings `mapstructure:",squash"` // squash ensures fields are correctly decoded in embedded struct

	// Authentication defines the authentication method to be used.
	Authentication *Authentication `mapstructure:"auth"`

	// Endpoints is a list of etcd2 server endpoints the etcd2
	// config source should try to connect to.
	Endpoints []string `mapstructure:"endpoints"`
}

Config defines etcd2configsource configuration

Jump to

Keyboard shortcuts

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