inject

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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

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 any Container in 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