meshconnectord

package
v0.0.0-...-cac5726 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Is404

func Is404(err error) bool

Types

type EventHandler

type EventHandler struct {
	// contains filtered or unexported fields
}

func (EventHandler) OnAdd

func (e EventHandler) OnAdd(obj interface{})

func (EventHandler) OnDelete

func (e EventHandler) OnDelete(obj interface{})

func (EventHandler) OnUpdate

func (e EventHandler) OnUpdate(oldObj, obj interface{})

type MeshConnector

type MeshConnector struct {
	SNIListener net.Listener
	HBone       *hbone.HBone
	Mesh        *mesh.KRun

	Namespace     string
	ConfigMapName string

	CAPool   string
	CASRoots string

	// Primary client is the k8s client to use. If not set will be created based on
	// the config.
	Client *kubernetes.Clientset

	Services map[string]*corev1.Service
	EP       map[string]*discoveryv1.EndpointSlice
	// contains filtered or unexported fields
}

func New

func New(kr *mesh.KRun) *MeshConnector

func (*MeshConnector) FindTenant

func (sg *MeshConnector) FindTenant(ctx context.Context) error

FindTenant will try to find the XDSAddr using in-cluster info. This is called after K8S client has been initialized.

For MCP, will expect a config map named 'env-asm-managed' For in-cluster, we'll lookup the connector's LB, which points to istio.istio-system.svc

This depends on MCP and Istiod internal configs - the config map may set with the XDS_ADDR and associated configs, in which case this will not be called.

func (*MeshConnector) GetCitadelRoots

func (sg *MeshConnector) GetCitadelRoots(ctx context.Context) (string, error)

Load the CA roots from istio-ca-root-cert configmap in istio-system. This is typically replicated in each namespace and mounted - but we'll not rely on this, just make mesh-env readable to all authenticated users. This is used to connect to Istiod, and is typically the Citadel root CA. If missing, it means citadel is not used and CAS will be used instead.

Mesh connector will use the mesh roots.

func (*MeshConnector) InitMeshEnv

func (sg *MeshConnector) InitMeshEnv(ctx context.Context) error

InitMeshEnv updates a config map containing env variables that customize the mesh agent. It is NOT USER FACING - controllers create it and patch it. The main rule is that unknown fields are left alone, and only specific fields are reconciled.

func (*MeshConnector) InitMeshEnvGCP

func (sg *MeshConnector) InitMeshEnvGCP(ctx context.Context) error

InitMeshEnvGCP updates the mesh env with GCP specific settings. This controller may run independently, in a GCP binary or in ASM.

func (*MeshConnector) InitSNIGate

func (sg *MeshConnector) InitSNIGate(ctx context.Context, sniPort string, h2rPort string) error

InitSNIGate will start the mesh gateway, with a special SNI router port. The h2rPort is experimental, for dev/debug, for users running/debugging apps locally.

func (*MeshConnector) NewWatcher

func (sg *MeshConnector) NewWatcher()

func (*MeshConnector) SaveToMap

func (sg *MeshConnector) SaveToMap(kr *mesh.KRun, d map[string]string) bool

Internal implementation detail for the 'mesh-env' for Istio and MCP. This may change, it is not a stable API - see loadMeshEnv for the other side.

Note that XDS_ADDR is not included by default - workloads will use the (I)MCON_ADDR or MCP if MESH_TENANT is set. TD will also be set automatically if ASM clusters are not detected.

func (*MeshConnector) UpdateSlice

func (sg *MeshConnector) UpdateSlice(ctx context.Context, kr *mesh.KRun, ns string,
	name string)

func (*MeshConnector) WaitService

func (sg *MeshConnector) WaitService(ctx context.Context, name string) (string, error)

Wait for the hgate and internal hgate service, set the config

Jump to

Keyboard shortcuts

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