Documentation
¶
Overview ¶
Package inject contains code for sidecar injection.
Index ¶
- Constants
- func IntoFile(injectConfig Inject, meshConfig mesh.FullMeshConfig) (string, error)
- func IsNamespaceInjectable(ctx context.Context, k8sClient client.Client, namespace string) (bool, error)
- func ValidateMTLSAnnotation(podAnnotation, globalMode string) error
- type IgnorePorts
- type Inject
- type InjectionConfig
- type PortSet
- type Probe
Constants ¶
const (
RedirectPath = "/health-redirects/"
)
Variables ¶
This section is empty.
Functions ¶
func IntoFile ¶
func IntoFile( injectConfig Inject, meshConfig mesh.FullMeshConfig, ) (string, error)
IntoFile takes a yaml or json resource file and adds the sidecar containers.
func IsNamespaceInjectable ¶
func IsNamespaceInjectable(ctx context.Context, k8sClient client.Client, namespace string) (bool, error)
IsNamespaceInjectable determines if namespace is injectable.
func ValidateMTLSAnnotation ¶
Types ¶
type IgnorePorts ¶
IgnorePorts holds the list of ports to ignore for both incoming and outgoing traffic.
func GetIgnorePorts ¶
func GetIgnorePorts(annotations map[string]string, ports IgnorePorts) (IgnorePorts, error)
GetIgnorePorts returns the ignored ports whether specified via arg or annotation.
func GetIgnorePortsFromAnnotations ¶
func GetIgnorePortsFromAnnotations(annotations map[string]string) (IgnorePorts, error)
GetIgnorePortsFromAnnotations returns the ignored ports that are set in the Pod annotations.
func (IgnorePorts) IsEmpty ¶
func (ip IgnorePorts) IsEmpty() bool
IsEmpty reports whether or not IgnorePorts struct is empty.
func (IgnorePorts) Validate ¶
func (ip IgnorePorts) Validate() error
Validate returns an error if the ports are not valid.
type Inject ¶
type Inject struct { Resources []byte IgnorePorts IgnorePorts }
Inject holds the config for a manual sidecar injection.
type InjectionConfig ¶
type InjectionConfig struct { Annotations map[string]string RegistryKey *v1.Secret Labels map[string]string Volumes []v1.Volume ImagePullSecrets []v1.LocalObjectReference Probes []Probe InitContainers []v1.Container Containers []v1.Container }
InjectionConfig is the proxy sidecar configuration to be injected.
func CreateInjectionConfig ¶
func CreateInjectionConfig( meshConfig mesh.FullMeshConfig, ignorePorts IgnorePorts, containers []v1.Container, parentName, parentNamespace, parentType string, podAnnotations map[string]string, ) (*InjectionConfig, error)
CreateInjectionConfig builds the config for injecting the sidecar proxy.
type Probe ¶
type Probe struct { ProbeType string HTTPGet v1.HTTPGetAction OrigHTTPGet v1.HTTPGetAction ContainerIdx int }