bootstrap

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

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 (
	// EpochFileTemplate is a template for the root config JSON
	EpochFileTemplate = "envoy-rev%d.%s"
	DefaultCfgDir     = "./var/lib/istio/envoy/envoy_bootstrap_tmpl.json"
)

Variables

View Source
var DefaultStatTags = []string{
	"reporter",
	"source_namespace",
	"source_workload",
	"source_workload_namespace",
	"source_principal",
	"source_app",
	"source_version",
	"source_cluster",
	"destination_namespace",
	"destination_workload",
	"destination_workload_namespace",
	"destination_principal",
	"destination_app",
	"destination_version",
	"destination_service",
	"destination_service_name",
	"destination_service_namespace",
	"destination_port",
	"destination_cluster",
	"request_protocol",
	"request_operation",
	"request_host",
	"response_flags",
	"grpc_response_status",
	"connection_security_policy",
	"source_canonical_service",
	"destination_canonical_service",
	"source_canonical_revision",
	"destination_canonical_revision",
}

DefaultStatTags for telemetry v2 tag extraction.

View Source
var StripFragment = env.RegisterBoolVar("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 thru

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
}

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

	// CreateFileForEpoch generates an Envoy bootstrap file for a particular epoch.
	CreateFileForEpoch(epoch int) (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
	XDSRootCert         string
	OutlierLogPath      string
	ProvCert            string

	EnvoyStatusPort             int
	EnvoyPrometheusPort         int
	ExitOnZeroActiveConnections 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