config

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultFileName     = "nri-kubernetes"
	DefaultFilePath     = "/etc/newrelic-infra"
	DefaultTimeout      = 10 * time.Second
	DefaultRetries      = 3
	DefaultAgentTimeout = 3 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Type string `mapstructure:"type"`
	MTLS *MTLS  `mapstructure:"mtls"`
}

type AutodiscoverControlPlane

type AutodiscoverControlPlane struct {
	Namespace string     `mapstructure:"namespace"`
	Selector  string     `mapstructure:"selector"`
	MatchNode bool       `mapstructure:"matchNode"`
	Endpoints []Endpoint `mapstructure:"endpoints"`
}

type Config

type Config struct {
	Verbose        bool          `mapstructure:"verbose"`
	LogLevel       string        `mapstructure:"logLevel"`
	ClusterName    string        `mapstructure:"clusterName"`
	KubeconfigPath string        `mapstructure:"kubeconfigPath"`
	NodeIP         string        `mapstructure:"nodeIP"`
	NodeName       string        `mapstructure:"nodeName"`
	Interval       time.Duration `mapstructure:"interval"`

	Sink struct {
		HTTP HTTPSink `mapstructure:"http"`
	} `mapstructure:"sink"`

	ControlPlane `mapstructure:"controlPlane"`
	Kubelet      `mapstructure:"kubelet"`
	KSM          `mapstructure:"ksm"`
}

func LoadConfig

func LoadConfig(filePath string, fileName string) (*Config, error)

type ControlPlane

type ControlPlane struct {
	Enabled           bool                  `mapstructure:"enabled"`
	ETCD              ControlPlaneComponent `mapstructure:"etcd"`
	APIServer         ControlPlaneComponent `mapstructure:"apiServer"`
	ControllerManager ControlPlaneComponent `mapstructure:"controllerManager"`
	Scheduler         ControlPlaneComponent `mapstructure:"scheduler"`
	Timeout           time.Duration         `mapstructure:"timeout"`
	Retries           int                   `mapstructure:"retries"`
}

type ControlPlaneComponent

type ControlPlaneComponent struct {
	Enabled        bool                       `mapstructure:"enabled"`
	StaticEndpoint *Endpoint                  `mapstructure:"staticEndpoint"`
	Autodiscover   []AutodiscoverControlPlane `mapstructure:"autodiscover"`
}

type Endpoint

type Endpoint struct {
	URL                string `mapstructure:"url"`
	Auth               *Auth  `mapstructure:"auth"`
	InsecureSkipVerify bool   `mapstructure:"insecureSkipVerify"`
}

type HTTPSink

type HTTPSink struct {
	Port    int           `mapstructure:"port"`
	Timeout time.Duration `mapstructure:"timeout"`
	Retries int           `mapstructure:"retries"`
}

type KSM

type KSM struct {
	Enabled     bool          `mapstructure:"enabled"`
	StaticURL   string        `mapstructure:"staticURL"`
	Scheme      string        `mapstructure:"scheme"`
	Port        int           `mapstructure:"port"`
	Selector    string        `mapstructure:"selector"`
	Namespace   string        `mapstructure:"namespace"`
	Distributed bool          `mapstructure:"distributed"`
	Timeout     time.Duration `mapstructure:"timeout"`
	Retries     int           `mapstructure:"retries"`
	Discovery   struct {
		BackoffDelay time.Duration `mapstructure:"backoffDelay"` // Wait BackoffDelay between discovery attempts.
		Timeout      time.Duration `mapstructure:"timeout"`      // Give up discovery and fail if Timeout has passed since first attempt.
	} `mapstructure:"discovery"`
}

type Kubelet

type Kubelet struct {
	Enabled          bool          `mapstructure:"enabled"`
	Port             int32         `mapstructure:"port"`
	Scheme           string        `mapstructure:"scheme"`
	NetworkRouteFile string        `mapstructure:"networkRouteFile"`
	Timeout          time.Duration `mapstructure:"timeout"`
	Retries          int           `mapstructure:"retries"`
}

type MTLS

type MTLS struct {
	TLSSecretName      string `mapstructure:"secretName"`
	TLSSecretNamespace string `mapstructure:"secretNamespace"`
}

Jump to

Keyboard shortcuts

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