Documentation ¶
Index ¶
- func Is404(err error) bool
- type EventHandler
- type MeshConnector
- func (sg *MeshConnector) FindTenant(ctx context.Context) error
- func (sg *MeshConnector) GetCitadelRoots(ctx context.Context) (string, error)
- func (sg *MeshConnector) InitMeshEnv(ctx context.Context) error
- func (sg *MeshConnector) InitMeshEnvGCP(ctx context.Context) error
- func (sg *MeshConnector) InitSNIGate(ctx context.Context, sniPort string, h2rPort string) error
- func (sg *MeshConnector) NewWatcher()
- func (sg *MeshConnector) SaveToMap(kr *mesh.KRun, d map[string]string) bool
- func (sg *MeshConnector) UpdateSlice(ctx context.Context, kr *mesh.KRun, ns string, name string)
- func (sg *MeshConnector) WaitService(ctx context.Context, name string) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
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 ¶
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 (*MeshConnector) WaitService ¶
Wait for the hgate and internal hgate service, set the config