config

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: Apache-2.0 Imports: 6 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Controller *ControllerConfig
	Consul     *consulapi.Config
}

Config describes the attributes that are uses to create configuration structure

func Load

func Load(clientset *kubernetes.Clientset, namespace string, name string) (*Config, error)

Load function loads configuration from ConfigMap resource in Kubernetes cluster and fills the attributes of ControllerConfig struct

type ControllerConfig

type ControllerConfig struct {
	ConsulAddress            string
	ConsulPort               string
	ConsulScheme             string
	ConsulCAFile             string
	ConsulCertFile           string
	ConsulKeyFile            string
	ConsulInsecureSkipVerify bool
	ConsulToken              string
	ConsulTimeout            time.Duration
	ConsulContainerName      string
	ConsulNodeSelector       string
	PodLabelSelector         string
	K8sTag                   string
	RegisterMode             RegisterMode
	RegisterSource           string
}

ControllerConfig describes the attributes for the controller configuration

type RegisterMode

type RegisterMode string

RegisterMode is a name of register mode

const (
	RegisterSingleMode RegisterMode = "single"
	RegisterNodeMode   RegisterMode = "node"
	RegisterPodMode    RegisterMode = "pod"
)

"RegisterSingleMode", "RegisterNodeMode" and "RegisterPodMode" defines correct value of `register_mode` option. "RegisterSingleMode" determine correct value for `single` mode. "RegisterNodeMode" determine correct value for `node` mode. "RegisterNodeMode" determine correct value for `pod` mode.

Jump to

Keyboard shortcuts

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