bootstrap

package
v0.0.0-...-bf9fd61 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 30 Imported by: 25

Documentation

Index

Constants

View Source
const (
	// IstioMetaPrefix is used to pass env vars as node metadata.
	IstioMetaPrefix = "ISTIO_META_"

	// IstioMetaJSONPrefix is used to pass annotations and similar environment info.
	IstioMetaJSONPrefix = "ISTIO_METAJSON_"
)
View Source
const (
	// EnvoyFileTemplate is a template for the root config JSON
	EnvoyFileTemplate = "envoy-rev.%s"
	DefaultCfgDir     = "./var/lib/istio/envoy/envoy_bootstrap_tmpl.json"
)
View Source
const (
	// DefaultDeploymentUniqueLabelKey is the default key of the selector that is added
	// to existing ReplicaSets (and label key that is added to its pods) to prevent the existing ReplicaSets
	// to select new pods (and old pods being select by new ReplicaSet).
	DefaultDeploymentUniqueLabelKey string = "pod-template-hash"
)

Variables

View Source
var StripFragment = env.Register("HTTP_STRIP_FRAGMENT_FROM_PATH_UNSAFE_IF_DISABLED", true, "").Get()

Functions

func ConvertNodeToXDSNode

func ConvertNodeToXDSNode(node *model.Node) *core.Node

ConvertNodeToXDSNode creates an Envoy node descriptor from Istio node descriptor.

func ConvertXDSNodeToNode

func ConvertXDSNodeToNode(node *core.Node) *model.Node

ConvertXDSNodeToNode parses Istio node descriptor from an Envoy node descriptor, using only typed metadata.

func GetEffectiveTemplatePath

func GetEffectiveTemplatePath(pc *model.NodeMetaProxyConfig) string

GetEffectiveTemplatePath gets the template file that should be used for bootstrap

func GetNodeMetaData

func GetNodeMetaData(options MetadataOptions) (*model.Node, error)

GetNodeMetaData function uses an environment variable contract ISTIO_METAJSON_* env variables contain json_string in the value. The name of variable is ignored. ISTIO_META_* env variables are passed through

func ParseDownwardAPI

func ParseDownwardAPI(i string) (map[string]string, error)

ParseDownwardAPI parses fields which are stored as format `%s=%q` back to a map

func ReadPodAnnotations

func ReadPodAnnotations(path string) (map[string]string, error)

Types

type Config

type Config struct {
	*model.Node
	// CompliancePolicy to decouple the environment variable dependency.
	CompliancePolicy string
	LogAsJSON        bool
}

Config for creating a bootstrap file.

type Instance

type Instance interface {
	// WriteTo writes the content of the Envoy bootstrap to the given writer.
	WriteTo(templateFile string, w io.Writer) error

	// CreateFile generates an Envoy bootstrap file.
	CreateFile() (string, error)
}

Instance of a configured Envoy bootstrap writer.

func New

func New(cfg Config) Instance

New creates a new Instance of an Envoy bootstrap writer.

type MetadataOptions

type MetadataOptions struct {
	Envs                   []string
	Platform               platform.Environment
	InstanceIPs            []string
	StsPort                int
	ID                     string
	ProxyConfig            *meshAPI.ProxyConfig
	PilotSubjectAltName    []string
	CredentialSocketExists bool
	XDSRootCert            string
	OutlierLogPath         string

	EnvoyStatusPort             int
	EnvoyPrometheusPort         int
	ExitOnZeroActiveConnections bool
	MetadataDiscovery           bool
	// contains filtered or unexported fields
}

MetadataOptions for constructing node metadata.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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