inject

package
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InjectAnnotationsIntoDeployment added in v0.27.0

func InjectAnnotationsIntoDeployment(deployment *appsv1.Deployment, newAnnotations map[string]string) error

InjectAnnotationsIntoDeployment injects the provided Annotations into the container(s) of the given PodSpec.

If the Deployment already defines any Annotations they will NOT be overwritten.

func InjectEnvFromIntoDeployment added in v0.28.0

func InjectEnvFromIntoDeployment(podSpec *corev1.PodSpec, envFromVars []corev1.EnvFromSource) error

InjectEnvFromIntoDeployment injects the envFrom variables into the container(s) of the given PodSpec.

If any Container in PodSpec already defines an envFrom variable as any of the provided envFrom then it will be overwritten.

func InjectEnvIntoDeployment

func InjectEnvIntoDeployment(podSpec *corev1.PodSpec, envVars []corev1.EnvVar) error

InjectEnvIntoDeployment injects the proxy env variables specified in proxyEnvVar into the container(s) of the given PodSpec.

If any Container in PodSpec already defines an env variable of the same name as any of the proxy env variables then it will be overwritten.

func InjectNodeSelectorIntoDeployment

func InjectNodeSelectorIntoDeployment(podSpec *corev1.PodSpec, nodeSelector map[string]string) error

InjectNodeSelectorIntoDeployment injects the provided NodeSelector into the container(s) of the given PodSpec.

If the PodSpec already defines a NodeSelector it will be overwritten.

func InjectResourcesIntoDeployment

func InjectResourcesIntoDeployment(podSpec *corev1.PodSpec, resources *corev1.ResourceRequirements) error

InjectResourcesIntoDeployment will inject provided Resources into given podSpec

If podSpec already defines Resources, it will be overwritten

func InjectTolerationsIntoDeployment

func InjectTolerationsIntoDeployment(podSpec *corev1.PodSpec, tolerations []corev1.Toleration) error

InjectTolerationsIntoDeployment injects provided Tolerations into the given Pod Spec

Tolerations will be appended to the existing once if it does not already exist

func InjectVolumeMountsIntoDeployment

func InjectVolumeMountsIntoDeployment(podSpec *corev1.PodSpec, volumeMounts []corev1.VolumeMount) error

InjectVolumeMountsIntoDeployment injects the provided VolumeMounts into the given PodSpec.

If the PodSpec already defines a VolumeMount of the same name as any of the provided VolumeMounts then it will be overwritten.

func InjectVolumesIntoDeployment

func InjectVolumesIntoDeployment(podSpec *corev1.PodSpec, volumes []corev1.Volume) error

InjectVolumesIntoDeployment injects the provided Volumes into the container(s) of the given PodSpec.

If any Container in PodSpec already defines a Volume of the same name as any of the provided Volumes then it will be overwritten.

func OverrideDeploymentAffinity added in v0.22.0

func OverrideDeploymentAffinity(podSpec *corev1.PodSpec, affinity *corev1.Affinity) error

OverrideDeploymentAffinity will override the corev1.Affinity defined in the Deployment with the given corev1.Affinity. Any nil top-level sub-attributes (e.g. NodeAffinity, PodAffinity, and PodAntiAffinity) will be ignored. Hint: to overwrite those top-level attributes, empty them out. I.e. use the empty/default object ({}) e.g. NodeAffinity{}. In yaml:

affinity:
  nodeAffinity: {}
  podAffinity: {}
  podAntiAffinity: {}

will completely remove the deployment podSpec.affinity and is equivalent to affinity: {}

Types

This section is empty.

Jump to

Keyboard shortcuts

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