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: 47 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfigMapKey should match the expected MeshConfig file name
	ConfigMapKey = "mesh"
	// CopilotTimeout when to cancel remote gRPC call to copilot
	CopilotTimeout = 5 * time.Second
)

Variables

View Source
var (
	// FilepathWalkInterval dictates how often the file system is walked for config
	FilepathWalkInterval = 100 * time.Millisecond

	// ConfigDescriptor describes all supported configuration kinds.
	// TODO: use model.IstioConfigTypes once model.IngressRule is deprecated
	ConfigDescriptor = model.ConfigDescriptor{
		model.RouteRule,
		model.VirtualService,
		model.Gateway,
		model.EgressRule,
		model.ServiceEntry,
		model.DestinationPolicy,
		model.DestinationRule,
		model.EnvoyFilter,
		model.HTTPAPISpec,
		model.HTTPAPISpecBinding,
		model.QuotaSpec,
		model.QuotaSpecBinding,
		model.AuthenticationPolicy,
		model.AuthenticationMeshPolicy,
		model.ServiceRole,
		model.ServiceRoleBinding,
		model.RbacConfig,
	}

	// PilotCertDir is the default location for mTLS certificates used by pilot
	// Visible for tests - at runtime can be set by PILOT_CERT_DIR environment variable.
	PilotCertDir = "/etc/certs/"

	// DefaultPlugins is the default list of plugins to enable, when no plugin(s)
	// is specified through the command line
	DefaultPlugins = []string{
		plugin.Authn,
		plugin.Authz,
		plugin.Envoyfilter,
		plugin.Health,
		plugin.Mixer,
	}
)

Functions

func GetMeshConfig

func GetMeshConfig(kube kubernetes.Interface, namespace, name string) (*v1.ConfigMap, *meshconfig.MeshConfig, error)

GetMeshConfig fetches the ProxyMesh configuration from Kubernetes ConfigMap.

Types

type ConfigArgs

type ConfigArgs struct {
	ClusterRegistriesConfigmap string
	ClusterRegistriesNamespace string
	KubeConfig                 string
	CFConfig                   string
	ControllerOptions          kube.ControllerOptions
	FileDir                    string

	// Controller if specified, this controller overrides the other config settings.
	Controller model.ConfigStoreCache
}

ConfigArgs provide configuration options for the configuration controller. If FileDir is set, that directory will be monitored for CRD yaml files and will update the controller as those files change (This is used for testing purposes). Otherwise, a CRD client is created based on the configuration.

type ConsulArgs

type ConsulArgs struct {
	Config    string
	ServerURL string
	Interval  time.Duration
}

ConsulArgs provides configuration for the Consul service registry.

type EurekaArgs

type EurekaArgs struct {
	ServerURL string
	Interval  time.Duration
}

EurekaArgs provides configuration for the Eureka service registry

type MeshArgs

type MeshArgs struct {
	ConfigFile      string
	MixerAddress    string
	RdsRefreshDelay *durpb.Duration
}

MeshArgs provide configuration options for the mesh. If ConfigFile is provided, an attempt will be made to load the mesh from the file. Otherwise, a default mesh will be used with optional overrides.

type PilotArgs

type PilotArgs struct {
	DiscoveryOptions envoy.DiscoveryServiceOptions
	Namespace        string
	Mesh             MeshArgs
	Config           ConfigArgs
	Service          ServiceArgs
	MeshConfig       *meshconfig.MeshConfig
	CtrlZOptions     *ctrlz.Options
	Plugins          []string
}

PilotArgs provides all of the configuration parameters for the Pilot discovery service.

type Server

type Server struct {
	HTTPListeningAddr       net.Addr
	GRPCListeningAddr       net.Addr
	SecureGRPCListeningAddr net.Addr
	MonitorListeningAddr    net.Addr

	// TODO(nmittler): Consider alternatives to exposing these directly
	EnvoyXdsServer    *envoyv2.DiscoveryServer
	ServiceController *aggregate.Controller
	// contains filtered or unexported fields
}

Server contains the runtime configuration for the Pilot discovery service.

func NewServer

func NewServer(args PilotArgs) (*Server, error)

NewServer creates a new Server instance based on the provided arguments.

func (*Server) Start

func (s *Server) Start(stop chan struct{}) (net.Addr, error)

Start starts all components of the Pilot discovery service on the port specified in DiscoveryServiceOptions. If Port == 0, a port number is automatically chosen. This method returns the address on which the server is listening for incoming connections. Content serving is started by this method, but is executed asynchronously. Serving can be cancelled at any time by closing the provided stop channel.

type ServiceArgs

type ServiceArgs struct {
	Registries []string
	Consul     ConsulArgs
	Eureka     EurekaArgs
}

ServiceArgs provides the composite configuration for all service registries in the system.

Jump to

Keyboard shortcuts

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