inject

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2018 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InitContainerResources added in v0.0.3

type InitContainerResources struct {
	Requests InitContainerResourcesList `json:"requests"`
	Limits   InitContainerResourcesList `json:"limits"`
}

InitContainerResources resources for init container

type InitContainerResourcesList added in v0.0.3

type InitContainerResourcesList struct {
	CPU    string `json:"cpu"`
	Memory string `json:"memory"`
}

InitContainerResourcesList resources for init container

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) Check added in v0.0.4

func (wh *Webhook) Check() health.Health

Check check that webhook is up

func (*Webhook) Run

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

Run starts the webhook control loop

type WebhookConfig

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

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 `json:"container-name"`
	Label         string `json:"label"`
	Profile       string `json:"profile"`
	VolumeName    string `json:"volume-name"`
	VolumeMount   string `json:"volume-mount"`
	Source        string `json:"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