bootstrap

package
v0.0.0-...-865e90e Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2018 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EpochFileTemplate is a template for the root config JSON
	EpochFileTemplate = "envoy-rev%d.json"
	DefaultCfgDir     = "/var/lib/istio/envoy/envoy_bootstrap_tmpl.json"

	// MaxClusterNameLength is the maximum cluster name length
	MaxClusterNameLength = 189 // TODO: use MeshConfig.StatNameLength instead
)

Generate the envoy v2 bootstrap configuration, using template.

Variables

View Source
var (
	// IstioCertDir is the location of istio certificates. Visible for testing.
	// Can be set using ISTIO_CERT_DIR environment variable.
	IstioCertDir = "/etc/certs"

	// PilotSAN is the DNS name included in the pilot certificate. It may not match the
	// actual address. Pilot, IstioCA and Sidecar have special certificate that include both
	// SPIFEE and DNS.
	PilotSAN = "istio-pilot.istio-system"
)

Functions

func GetHostPort

func GetHostPort(name, addr string) (host string, port string, err error)

GetHostPort separates out the host and port portions of an address. The host portion may be a name, IPv4 address, or IPv6 address (with square brackets).

func RunProxy

func RunProxy(config *meshconfig.ProxyConfig, node string, epoch int, configFname string, doneChan chan error,
	outWriter io.Writer, errWriter io.Writer, cliarg []string) (*os.Process, error)

RunProxy will run sidecar with a v2 config generated from template according with the config. The doneChan will be notified if the envoy process dies. The returned process can be killed by the caller to terminate the proxy.

func StoreHostPort

func StoreHostPort(host, port, field string, opts map[string]interface{})

StoreHostPort encodes the host and port as key/value pair strings in the provided map.

func WriteBootstrap

func WriteBootstrap(config *meshconfig.ProxyConfig, node string, epoch int, pilotSAN []string, opts map[string]interface{}) (string, error)

WriteBootstrap generates an envoy config based on config and epoch, and returns the filename. TODO: in v2 some of the LDS ports (port, http_port) should be configured in the bootstrap.

Types

type CheckinData

type CheckinData struct {
	AvailabilityZone string
}

CheckinData has data provided by Pilot needed to start and prepare envoy.

func Checkin

func Checkin(secure bool, addr, cluster, node string, delay time.Duration, retries int) (*CheckinData, error)

Checkin will connect to pilot and retrieve initial configuration data needed to start envoy. In 0.8 this includes only AZ. Refactored from 'retrieveAZ'. This will retry multiple times.

Jump to

Keyboard shortcuts

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