inject

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InjectionPolicy

type InjectionPolicy string

InjectionPolicy determines the policy for injecting the config init container into the watched namespace(s).

const (
	// InjectionPolicyDisabled specifies that the sidecar injector
	// will not inject the sidecar into resources by default for the
	// namespace(s) being watched. Resources can enable injection
	// using the "<annotation prefix>/inject" annotation with value of
	// true.
	InjectionPolicyDisabled InjectionPolicy = "disabled"

	// InjectionPolicyEnabled specifies that the sidecar injector will
	// inject the sidecar into resources by default for the
	// namespace(s) being watched. Resources can disable injection
	// using the "<annotation prefix>/inject" annotation with value of
	// false.
	InjectionPolicyEnabled InjectionPolicy = "enabled"
)

type SidecarInjectionSpec

type SidecarInjectionSpec struct {
	InitContainers []v1.Container   `yaml:"initContainers"`
	VolumeMounts   []v1.VolumeMount `yaml:"volumeMounts"`
	Volumes        []v1.Volume      `yaml:"volumes"`
}

SidecarInjectionSpec collects all container types and volumes for sidecar mesh injection

type SidecarInjectionStatus

type SidecarInjectionStatus struct {
	InitContainers []string `json:"initContainers"`
	VolumeMounts   []string `json:"volumeMounts"`
	Volumes        []string `json:"volumes"`
}

SidecarInjectionStatus contains basic information about the injected sidecar. This includes the names of added containers and volumes.

type Webhook

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

Webhook implements a mutating webhook for automatic config injection.

func NewWebhook

func NewWebhook(p WebhookParameters) (*Webhook, error)

NewWebhook creates a new instance of a mutating webhook for automatic sidecar injection.

func (*Webhook) Run

func (wh *Webhook) Run(stop <-chan struct{})

Run starts the webhook control loop

type WebhookConfig

type WebhookConfig struct {
	AnnotationPrefix string                `yaml:"annotation-prefix"`
	Policy           InjectionPolicy       `yaml:"policy"`
	ContainerImage   string                `yaml:"container-image"`
	Default          WebhookConfigDefaults `yaml:"default"`
}

WebhookConfig struct representing webhook configuration values.

func (*WebhookConfig) UnmarshalYAML

func (w *WebhookConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements Unmarshaler interface for WebhookConfig

type WebhookConfigDefaults

type WebhookConfigDefaults struct {
	ContainerName string `yaml:"container-name"`
	Label         string `yaml:"label"`
	Profile       string `yaml:"profile"`
	VolumeName    string `yaml:"volume-name"`
	VolumeMount   string `yaml:"volume-mount"`
	Source        string `yaml:"source"`
}

WebhookConfigDefaults configures default init container values.

type WebhookParameters

type WebhookParameters struct {
	// ConfigFile is the path to the injection configuration file.
	ConfigFile string

	// CertFile is the path to the x509 certificate for https.
	CertFile string

	// KeyFile is the path to the x509 private key matching `CertFile`.
	KeyFile string

	// Port is the webhook port, e.g. typically 443 for https.
	Port int
}

WebhookParameters configures parameters for the config injection webhook.

Jump to

Keyboard shortcuts

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