container

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2020 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MutateContainer

func MutateContainer(r Mutate, obj *corev1.Container) error

Types

type Container

type Container struct {
	*ContainerSpec           `json:",inline"`
	*parameters.SettingsSpec `json:"parameters,omitempty"`
}

Container is the specification of the desired behavior of the Container. It is a stripped down version of https://godoc.org/k8s.io/api/core/v1#Container with only user definied specs

Parameters are used to define how settings are passed on to the container.

+kubebuilder:object:generate=true

func (*Container) DeepCopy

func (in *Container) DeepCopy() *Container

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Container.

func (*Container) DeepCopyInto

func (in *Container) DeepCopyInto(out *Container)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Container) Init

func (obj *Container) Init()

type ContainerSpec

type ContainerSpec struct {
	// Name of the container specified as a DNS_LABEL.
	// Each container in a pod must have a unique name (DNS_LABEL).
	// Cannot be updated.
	Name string `json:"name,omitempty"`
	// Docker image name.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	// This field is optional to allow higher level config management to default or override
	// container images in workload controllers like Deployments and StatefulSets.
	// +optional
	Image string `json:"image,omitempty"`
	// Entrypoint array. Not executed within a shell.
	// The docker image's ENTRYPOINT is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
	// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
	// regardless of whether the variable exists or not.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	// +optional
	Command []string `json:"command,omitempty" protobuf:"bytes,3,rep,name=command"`
	// Arguments to the entrypoint.
	// The docker image's CMD is used if this is not provided.
	// Variable references $(VAR_NAME) are expanded using the container's environment. If a variable
	// cannot be resolved, the reference in the input string will be unchanged. The $(VAR_NAME) syntax
	// can be escaped with a double $$, ie: $$(VAR_NAME). Escaped references will never be expanded,
	// regardless of whether the variable exists or not.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell
	// +optional
	Args []string `json:"args,omitempty"`
	// List of ports to expose from the container. Exposing a port here gives
	// the system additional information about the network connections a
	// container uses, but is primarily informational. Not specifying a port here
	// DOES NOT prevent that port from being exposed. Any port which is
	// listening on the default "0.0.0.0" address inside a container will be
	// accessible from the network.
	// Cannot be updated.
	Ports []corev1.ContainerPort `json:"ports,omitempty"`
	// Image pull policy.
	// One of Always, Never, IfNotPresent.
	// Defaults to Always if :latest tag is specified, or IfNotPresent otherwise.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/containers/images#updating-images
	// +optional
	ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
	Probes          `json:"inline,omitempty"`
}

+kubebuilder:object:generate=true

func (*ContainerSpec) DeepCopy

func (in *ContainerSpec) DeepCopy() *ContainerSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerSpec.

func (*ContainerSpec) DeepCopyInto

func (in *ContainerSpec) DeepCopyInto(out *ContainerSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ContainerSpec) GetContainerArgs

func (c *ContainerSpec) GetContainerArgs() []string

func (*ContainerSpec) GetContainerCommand

func (c *ContainerSpec) GetContainerCommand() []string

func (*ContainerSpec) GetContainerImage

func (c *ContainerSpec) GetContainerImage() string

func (*ContainerSpec) GetContainerImagePullPolicy

func (c *ContainerSpec) GetContainerImagePullPolicy() corev1.PullPolicy

func (*ContainerSpec) GetContainerLivenessProbe

func (c *ContainerSpec) GetContainerLivenessProbe() *corev1.Probe

func (*ContainerSpec) GetContainerName

func (c *ContainerSpec) GetContainerName() string

func (*ContainerSpec) GetContainerPorts

func (c *ContainerSpec) GetContainerPorts() []corev1.ContainerPort

func (*ContainerSpec) GetContainerReadinessProbe

func (c *ContainerSpec) GetContainerReadinessProbe() *corev1.Probe

type Mutate

type Mutate interface {
	// Parameters
	GetVolumeMounts() []corev1.VolumeMount
	GetEnvFrom() []corev1.EnvFromSource
	GetEnvVar() []corev1.EnvVar
	// Runtime
	GetContainerName() string
	GetContainerImage() string
	GetContainerImagePullPolicy() corev1.PullPolicy
	GetContainerPorts() []corev1.ContainerPort
	GetContainerLivenessProbe() *corev1.Probe
	GetContainerReadinessProbe() *corev1.Probe
	GetContainerArgs() []string
	GetContainerCommand() []string
}

type Probes

type Probes struct {
	// Periodic probe of container liveness.
	// Container will be restarted if the probe fails.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
	// +optional
	ReadinessProbe *corev1.Probe `json:"readinessProbe,omitempty" protobuf:"bytes,11,opt,name=readinessProbe"`
	// Periodic probe of container liveness.
	// Container will be restarted if the probe fails.
	// Cannot be updated.
	// More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
	// +optional
	LivenessProbe *corev1.Probe `json:"livenessProbe,omitempty" protobuf:"bytes,10,opt,name=livenessProbe"`
}

Periodic probe for container health

+kubebuilder:object:generate=true

func (*Probes) DeepCopy

func (in *Probes) DeepCopy() *Probes

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Probes.

func (*Probes) DeepCopyInto

func (in *Probes) DeepCopyInto(out *Probes)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Jump to

Keyboard shortcuts

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