container

package
v0.100.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 10 Imported by: 3

Documentation

Overview

+groupName=container.deployer.landscaper.gardener.cloud

Index

Constants

View Source
const BasePath = "/data/ls"

BasePath is the base path inside a container that contains the container deployer specific data.

View Source
const ComponentDescriptorPathName = "COMPONENT_DESCRIPTOR_PATH"

ComponentDescriptorPathName is the name of the env var that points to the component descriptor.

View Source
const ConfigurationFilename = "configuration.json"

ConfigurationFilename is the name of the file that contains the provider configuration as json.

View Source
const ConfigurationPathName = "CONFIGURATION_PATH"

ConfigurationPathName is the name of the env var that points to the provider configuration file.

View Source
const ContainerDeployerDeployItemGenerationLabel = "deployitem.container.deployer.landscaper.gardener.cloud/generation"

ContainerDeployerDeployItemGenerationLabel is the name of the label that indicates the deploy item generation.

View Source
const ContainerDeployerDeployItemNameLabel = "deployitem.container.deployer.landscaper.gardener.cloud/name"

ContainerDeployerDeployItemNameLabel is the name of the label that is used to identify the deploy item of a pod.

View Source
const ContainerDeployerDeployItemNamespaceLabel = "deployitem.container.deployer.landscaper.gardener.cloud/namespace"

ContainerDeployerDeployItemNamespaceLabel is the name of the label that is used to identify the deploy item of a pod.

View Source
const ContainerDeployerFinalizer = "container.deployer.landscaper.gardener.cloud/finalizer"

ContainerDeployerFinalizer is the finalizer that is set by the container deployer

View Source
const ContainerDeployerIDLabel = "container.deployer.landscaper.gardener.cloud/deployer-id"

ContainerDeployerIDLabel is the unique id of the deployer managing the deploy item.

View Source
const ContainerDeployerNameLabel = "container.deployer.landscaper.gardener.cloud/name"

ContainerDeployerNameLabel is the name of the label that is used to identify managed pods.

View Source
const ContainerDeployerOperationForceCleanupAnnotation = "container.deployer.landscaper.gardener.cloud/force-cleanup"

ContainerDeployerOperationForceCleanupAnnotation is the name of the annotation that triggers the force deletion of the deploy item. Force deletion means that the delete container is skipped and all other resources are cleaned up.

View Source
const ContainerDeployerStateNumAnnotation = "container.deployer.landscaper.gardener.cloud/num"

ContainerDeployerStateNumAnnotation is a annotation that is used to define the order of chunks that are stored in the secrets.

View Source
const ContainerDeployerStateUUIDAnnotation = "container.deployer.landscaper.gardener.cloud/uuid"

ContainerDeployerStateUUIDAnnotation is a annotation that is used to group chunks that are stored in the secrets.

View Source
const ContainerDeployerTypeLabel = "container.deployer.landscaper.gardener.cloud/type"

ContainerDeployerTypeLabel is a label that is used to identify secrets that contain the state of a container.

View Source
const ContentPathName = "CONTENT_PATH"

ContentPathName is the name of the env var that points to the blob content of the definition.

View Source
const DeployItemName = "DEPLOY_ITEM_NAME"

DeployItemName is the name of the env var that contains name of the source DeployItem.

View Source
const DeployItemNamespaceName = "DEPLOY_ITEM_NAMESPACE"

DeployItemNamespaceName is the name of the env var that contains namespace of the source DeployItem.

View Source
const ExportsPathName = "EXPORTS_PATH"

ExportsPathName is the name of the env var that points to the exports file.

View Source
const GroupName = "container.deployer.landscaper.gardener.cloud"

GroupName is the name of the Garden API group.

View Source
const ImportsFilename = "import.json"

ImportsFilename is the name of the file that contains the import values as json.

View Source
const ImportsPathName = "IMPORTS_PATH"

ImportsPathName is the name of the env var that points to the imports file.

View Source
const InitContainerConditionType = "InitContainer"

InitContainerConditionType defines the condition for the current init container

View Source
const InitContainerName = "init"

InitContainerName is the name of the container running the init container.

View Source
const MainContainerName = "main"

MainContainerName is the name of the container running the user workload.

View Source
const OperationName = "OPERATION"

OperationName is the name of the env var that specifies the current operation that the image should execute

View Source
const PodName = "POD_NAME"

PodName is the name of the env var that contains the name of the pod.

View Source
const PodNamespaceName = "POD_NAMESPACE"

PodNamespaceName is the name of the env var that contains the namespace of the pod.

View Source
const RegistrySecretBasePathName = "REGISTRY_SECRETS_DIR"

RegistrySecretBasePathName is the environment variable pointing to the file system location of all OCI pull secrets

View Source
const StatePathName = "STATE_PATH"

StatePathName is the name of the env var that points to the directory where the state can be stored.

View Source
const TargetFileName = "target.json"

TargetFileName is the name of the file that contains the target content.

View Source
const TargetPathName = "TARGET_PATH"

TargetPathName is the name of the env var that points to the target content.

View Source
const WaitContainerConditionType = "WaitContainer"

WaitContainerConditionType defines the condition of the current wait container

View Source
const WaitContainerName = "wait"

WaitContainerName is the name of the container running the sidecar container.

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

	AddToScheme = localSchemeBuilder.AddToScheme
)
View Source
var ComponentDescriptorPath = filepath.Join(SharedBasePath, "component_descriptor.json")

ComponentDescriptorPath is the path to the component descriptor file.

View Source
var ConfigurationPath = filepath.Join(BasePath, "internal", ConfigurationFilename)

ConfigurationPath is the path to the configuration file.

View Source
var ContentPath = filepath.Join(SharedBasePath, "content")

ContentPath is the path to the content directory.

View Source
var (
	DefaultEnvVars = []corev1.EnvVar{
		{
			Name:  ImportsPathName,
			Value: ImportsPath,
		},
		{
			Name:  ExportsPathName,
			Value: ExportsPath,
		},
		{
			Name:  ComponentDescriptorPathName,
			Value: ComponentDescriptorPath,
		},
		{
			Name:  TargetPathName,
			Value: TargetPath,
		},
		{
			Name:  ContentPathName,
			Value: ContentPath,
		},
		{
			Name:  StatePathName,
			Value: StatePath,
		},
		{
			Name: PodName,
			ValueFrom: &corev1.EnvVarSource{
				FieldRef: &corev1.ObjectFieldSelector{
					FieldPath: "metadata.name",
				},
			},
		},
		{
			Name: PodNamespaceName,
			ValueFrom: &corev1.EnvVarSource{
				FieldRef: &corev1.ObjectFieldSelector{
					FieldPath: "metadata.namespace",
				},
			},
		},
	}
)
View Source
var ExportsPath = filepath.Join(SharedBasePath, "exports", "values")

ExportsPath is the path to the export file.

View Source
var ImportsPath = filepath.Join(SharedBasePath, "imports", ImportsFilename)

ImportsPath is the path to the imports file.

View Source
var RegistrySecretBasePath = filepath.Join(BasePath, "registry_secrets")

RegistrySecretBasePath is the path to all OCI pull secrets

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: GroupName, Version: runtime.APIVersionInternal}

SchemeGroupVersion is group version used to register these objects

View Source
var SharedBasePath = filepath.Join(BasePath, "shared")

SharedBasePath is the base path inside the container that is shared between the main and ls containers

View Source
var StatePath = filepath.Join(SharedBasePath, "state")

StatePath is the path to the state directory.

View Source
var TargetInitDir = filepath.Join(BasePath, "targets")

TargetInitDir is the directory in which the target is mounted in the init container, which then copies it to TargetPath.

View Source
var TargetPath = filepath.Join(SharedBasePath, "targets", TargetFileName)

TargetPath is the path to the target content file.

View Source
var UseOCMName = "USE_OCM"

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func RegisterDefaults

func RegisterDefaults(scheme *runtime.Scheme) error

RegisterDefaults adds defaulters functions to the given scheme. Public to allow building arbitrary schemes. All generated defaulters are covering - they call all nested defaulters.

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

func SetObjectDefaults_Configuration

func SetObjectDefaults_Configuration(in *Configuration)

Types

type Configuration

type Configuration struct {
	metav1.TypeMeta `json:",inline"`

	// Identity identity describes the unique identity of the deployer.
	// +optional
	Identity string `json:"identity,omitempty"`

	// OCI configures the oci client of the controller
	// +optional
	OCI *config.OCIConfiguration `json:"oci,omitempty"`

	// TargetSelector describes all selectors the deployer should depend on.
	TargetSelector []lsv1alpha1.TargetSelector `json:"targetSelector,omitempty"`

	// Namespace defines the namespace where the pods should be executed.
	Namespace string `json:"namespace"`

	// DefaultImage configures the default images that is used if the DeployItem
	// does not specify one.
	DefaultImage ContainerSpec `json:"defaultImage"`

	// InitContainerImage defines the image that is used to init the container.
	// This container bootstraps the necessary directories and files.
	InitContainer ContainerSpec `json:"initContainer"`

	// SidecarContainerImage defines the image that is used as a
	// sidecar to the defined main container.
	// The sidecar container is responsible to collect the exports and the state of the main container.
	WaitContainer ContainerSpec `json:"waitContainer"`

	// GarbageCollection configures the container deployer garbage collector.
	GarbageCollection GarbageCollection `json:"garbageCollection"`

	// DebugOptions configure additional debug options.
	DebugOptions *DebugOptions `json:"debug,omitempty"`

	// HPAConfiguration contains the configuration for horizontal pod autoscaling.
	HPAConfiguration *HPAConfiguration `json:"hpa,omitempty"`

	// Controller contains configuration concerning the controller framework.
	Controller Controller `json:"controller,omitempty"`

	// +optional
	UseOCMLib bool `json:"useOCMLib,omitempty"`
}

Configuration is the container deployer configuration that configures the controller

func (*Configuration) DeepCopy

func (in *Configuration) DeepCopy() *Configuration

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

func (*Configuration) DeepCopyInto

func (in *Configuration) DeepCopyInto(out *Configuration)

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

func (*Configuration) DeepCopyObject

func (in *Configuration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ContainerSpec

type ContainerSpec struct {
	// Docker image name.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	// The image will be defaulted by the container deployer to the configured default.
	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"`
	// 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"`
	// 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"`
}

ContainerSpec defines a container specification

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.

type ContainerStatus

type ContainerStatus struct {
	// A human readable message indicating details about why the pod is in this condition.
	// +optional
	Message string `json:"message,omitempty"`
	// A brief CamelCase message indicating details about why the pod is in this state.
	// e.g. 'Evicted'
	// +optional
	Reason string `json:"reason,omitempty"`
	// Details about the container's current condition.
	// +optional
	State corev1.ContainerState `json:"state,omitempty"`
	// The image the container is running.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	Image string `json:"image"`
	// ImageID of the container's image.
	ImageID string `json:"imageID"`
	// ExitCode of the main container.
	// +optional
	ExitCode *int32 `json:"exitCode,omitempty"`
}

ContainerStatus describes the status of a pod with its init, wait and main container.

func (*ContainerStatus) DeepCopy

func (in *ContainerStatus) DeepCopy() *ContainerStatus

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

func (*ContainerStatus) DeepCopyInto

func (in *ContainerStatus) DeepCopyInto(out *ContainerStatus)

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

type Controller

type Controller struct {
	lsconfigv1alpha1.CommonControllerConfig
}

Controller contains configuration concerning the controller framework.

func (*Controller) DeepCopy

func (in *Controller) DeepCopy() *Controller

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

func (*Controller) DeepCopyInto

func (in *Controller) DeepCopyInto(out *Controller)

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

type DebugOptions

type DebugOptions struct {
	// KeepPod will only remove the finalizer on the pod but will not delete the pod.
	KeepPod bool `json:"keepPod,omitempty"`
}

DebugOptions defines optional debug options.

func (*DebugOptions) DeepCopy

func (in *DebugOptions) DeepCopy() *DebugOptions

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

func (*DebugOptions) DeepCopyInto

func (in *DebugOptions) DeepCopyInto(out *DebugOptions)

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

type GarbageCollection

type GarbageCollection struct {
	// Disable disables the garbage collector and the resources clean-up.
	Disable bool `json:"disable"`
	// Worker defines the number of parallel garbage collection routines.
	// Defaults to 5.
	Worker int `json:"worker"`
	// RequeueTime specifies the duration after which the object, which is not yet ready to be garbage collected, is requeued.
	// Defaults to 3600.
	RequeueTimeSeconds int `json:"requeueTimeSeconds"`
}

GarbageCollection defines the container deployer garbage collection configuration.

func (*GarbageCollection) DeepCopy

func (in *GarbageCollection) DeepCopy() *GarbageCollection

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

func (*GarbageCollection) DeepCopyInto

func (in *GarbageCollection) DeepCopyInto(out *GarbageCollection)

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

type HPAConfiguration

type HPAConfiguration struct {
	MaxReplicas int32 `json:"maxReplicas,omitempty"`
}

HPAConfiguration contains the configuration for horizontal pod autoscaling.

func (*HPAConfiguration) DeepCopy

func (in *HPAConfiguration) DeepCopy() *HPAConfiguration

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

func (*HPAConfiguration) DeepCopyInto

func (in *HPAConfiguration) DeepCopyInto(out *HPAConfiguration)

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

type OperationType

type OperationType string

OperationType defines the value of a Operation that is propagated to the container.

const OperationDelete OperationType = "DELETE"

OperationDelete is the value of the Operation env var that defines a delete operation.

const OperationReconcile OperationType = "RECONCILE"

OperationReconcile is the value of the Operation env var that defines a reconcile operation.

type PodStatus

type PodStatus struct {
	// PodName is the name of the created pod.
	PodName string `json:"podName"`
	// LastRun is the time when the pod was executed the last time.
	LastRun *metav1.Time `json:"lastRun,omitempty"`
	// LastSuccessfulJobID is set to the current JobID when the pod successfully finished.
	// If the pod has not yet finished, this field will be nil.
	LastSuccessfulJobID *string `json:"lastSuccessfulJobID,omitempty"`
	// ContainerStatus contains the status of the pod that
	// executes the configured container.
	ContainerStatus ContainerStatus `json:"containerStatus"`
	// InitContainerStatus contains the status of the init container.
	InitContainerStatus ContainerStatus `json:"initContainerStatus"`
	// WaitContainerStatus contains the status of the wait container.
	WaitContainerStatus ContainerStatus `json:"waitContainerStatus"`
}

PodStatus describes the status of a pod with its init, wait and main container

func (*PodStatus) DeepCopy

func (in *PodStatus) DeepCopy() *PodStatus

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

func (*PodStatus) DeepCopyInto

func (in *PodStatus) DeepCopyInto(out *PodStatus)

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

type ProviderConfiguration

type ProviderConfiguration struct {
	metav1.TypeMeta `json:",inline"`

	// Docker image name.
	// More info: https://kubernetes.io/docs/concepts/containers/images
	// The image will be defaulted by the container deployer to the configured default.
	// +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"`
	// 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"`
	// ImportValues contains the import values for the container.
	// +optional
	ImportValues json.RawMessage `json:"importValues,omitempty"`
	// Blueprint is the resolved reference to the Blueprint definition
	// +optional
	Blueprint *lsv1alpha1.BlueprintDefinition `json:"blueprint,omitempty"`
	// ComponentDescriptor is the resolved reference to the ComponentDescriptor defnition
	// +optional
	ComponentDescriptor *lsv1alpha1.ComponentDescriptorDefinition `json:"componentDescriptor,omitempty"`
	// RegistryPullSecrets defines a list of registry credentials that are used to
	// pull blueprints and component descriptors from the respective registry.
	// For more info see: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
	// Note that the type information is used to determine the secret key and the type of the secret.
	// +optional
	RegistryPullSecrets []lsv1alpha1.ObjectReference `json:"registryPullSecrets,omitempty"`
	// ContinuousReconcile contains the schedule for continuous reconciliation.
	// +optional
	ContinuousReconcile *cr.ContinuousReconcileSpec `json:"continuousReconcile,omitempty"`
}

ProviderConfiguration is the container deployer configuration that is expected in a DeployItem

func (*ProviderConfiguration) DeepCopy

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

func (*ProviderConfiguration) DeepCopyInto

func (in *ProviderConfiguration) DeepCopyInto(out *ProviderConfiguration)

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

func (*ProviderConfiguration) DeepCopyObject

func (in *ProviderConfiguration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type ProviderStatus

type ProviderStatus struct {
	metav1.TypeMeta `json:",inline"`
	// LastOperation defines the last run operation of the pod.
	// The operation can be either reconcile or deletion.
	LastOperation string `json:"lastOperation"`
	// PodStatus indicated the status of the executed pod.
	PodStatus *PodStatus `json:"podStatus,omitempty"`
}

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object ProviderStatus is the container provider specific status

func (*ProviderStatus) DeepCopy

func (in *ProviderStatus) DeepCopy() *ProviderStatus

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

func (*ProviderStatus) DeepCopyInto

func (in *ProviderStatus) DeepCopyInto(out *ProviderStatus)

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

func (*ProviderStatus) DeepCopyObject

func (in *ProviderStatus) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

Directories

Path Synopsis
+groupName=container.deployer.landscaper.gardener.cloud
+groupName=container.deployer.landscaper.gardener.cloud

Jump to

Keyboard shortcuts

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