Documentation ¶
Overview ¶
Copyright 2018 Istio Authors
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- Constants
- Variables
- func DrainEnvoy(base string, cfg *meshv1.ProxyConfig)
- type ConfigArgs
- type ConsulArgs
- type GalleyCfgSourceFn
- type GalleyServer
- type MeshArgs
- type PilotArgs
- type Server
- func (s *Server) AddStartFunc(fn startFunc)
- func (s *Server) InitCommon(args *PilotArgs)
- func (s *Server) InitConfig() error
- func (s *Server) InitDiscovery() error
- func (s *Server) Start(stop <-chan struct{}, onXDSStart func(model.XDSUpdater)) error
- func (s *Server) StartEnvoy(baseDir string, mcfg *meshv1.MeshConfig) error
- func (s *Server) WaitDrain(baseDir string)
- func (s *Server) WatchMeshConfig(args string) error
- type ServiceArgs
Constants ¶
const ( // ConfigMapKey should match the expected MeshConfig file name ConfigMapKey = "mesh" // DefaultMCPMaxMsgSize is the default maximum message size DefaultMCPMaxMsgSize = 1024 * 1024 * 4 // DefaultMCPInitialWindowSize is the default InitialWindowSize value for the gRPC connection. DefaultMCPInitialWindowSize = 1024 * 1024 // DefaultMCPInitialConnWindowSize is the default Initial ConnWindowSize value for the gRPC connection. DefaultMCPInitialConnWindowSize = 1024 * 1024 )
Variables ¶
var ( // FilepathWalkInterval dictates how often the file system is walked for config FilepathWalkInterval = 100 * time.Millisecond // 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.Health, plugin.Mixer, } )
Functions ¶
func DrainEnvoy ¶
func DrainEnvoy(base string, cfg *meshv1.ProxyConfig)
Should be called at the end, if we receive SIGINT or SIGTERM
Types ¶
type ConfigArgs ¶
type ConfigArgs struct { ClusterRegistriesNamespace string KubeConfig string FileDir string DisableInstallCRDs bool // 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 ¶
ConsulArgs provides configuration for the Consul service registry.
type GalleyCfgSourceFn ¶
type GalleyCfgSourceFn func(resources schema.KubeResources) (src event.Source, err error)
Abstract the factory to create the config source
type GalleyServer ¶
type GalleyServer struct { Sources []event.Source Resources schema.KubeResources // contains filtered or unexported fields }
func NewGalleyServer ¶
func NewGalleyServer(a *settings.Args) *GalleyServer
NewGalleyServer returns a new processing component.
func (*GalleyServer) Address ¶
func (p *GalleyServer) Address() net.Addr
Address returns the Address of the MCP service.
func (*GalleyServer) ConfigZTopic ¶
func (p *GalleyServer) ConfigZTopic() fw.Topic
ConfigZTopic returns the ConfigZTopic for the processor.
func (*GalleyServer) Start ¶
func (p *GalleyServer) Start() (err error)
Start implements process.Component
type MeshArgs ¶
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 DomainSuffix string MeshConfig *meshconfig.MeshConfig NetworksConfigFile string CtrlZOptions *ctrlz.Options Plugins []string MCPMaxMessageSize int MCPInitialWindowSize int MCPInitialConnWindowSize int KeepaliveOptions *istiokeepalive.Options // ForceStop is set as true when used for testing to make the server stop quickly ForceStop bool }
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 EnvoyXdsServer *envoyv2.DiscoveryServer ServiceController *aggregate.Controller Mesh *meshconfig.MeshConfig MeshNetworks *meshconfig.MeshNetworks ConfigStores []model.ConfigStoreCache // Underlying config stores. To simplify, this is a configaggregate instance, created just before // start from the configStores ConfigController model.ConfigStoreCache // Interface abstracting all config operations, including the high-level objects // and the low-level untyped model.ConfigStore IstioConfigStore model.IstioConfigStore Args *PilotArgs CertKey []byte CertChain []byte RootCA []byte Galley *GalleyServer Environment *model.Environment // contains filtered or unexported fields }
Server contains the runtime configuration for the Pilot discovery service.
func InitConfig ¶
Start all components of istio, using local config files.
A minimal set of Istio Env variables are also used. This is expected to run in a Docker or K8S environment, with a volume with user configs mounted.
Defaults: - http port 15007 - grpc on 15010 - config from $ISTIO_CONFIG or ./conf
func NewServer ¶
NewServer creates a new Server instance, using defaults for combined Istio and loading optional mesh config file.
func (*Server) AddStartFunc ¶
func (s *Server) AddStartFunc(fn startFunc)
func (*Server) InitCommon ¶
func (*Server) InitConfig ¶
InitConfig will initialize the ConfigStores.
func (*Server) InitDiscovery ¶
InitDiscovery is called after InitConfig, will initialize the discovery services and discovery server.
func (*Server) Start ¶
func (s *Server) Start(stop <-chan struct{}, onXDSStart func(model.XDSUpdater)) 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. Content serving is started by this method, but is executed asynchronously. Serving can be canceled at any time by closing the provided stop channel.
func (*Server) StartEnvoy ¶
func (s *Server) StartEnvoy(baseDir string, mcfg *meshv1.MeshConfig) error
startEnvoy starts the envoy sidecar for Istio control plane, for TLS and load balancing. Should be called after cert generation
func (*Server) WatchMeshConfig ¶
WatchMeshConfig creates the mesh in the pilotConfig from the input arguments. Will set s.Mesh, and keep it updated. On change, ConfigUpdate will be called.
type ServiceArgs ¶
type ServiceArgs struct { Registries []string Consul ConsulArgs }
ServiceArgs provides the composite configuration for all service registries in the system.