corev1

package
v0.0.0-...-cb22ee8 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//CM_MISSING - error message to indicate CM is missing
	CM_MISSING = "cm %s is not found in the namespace %s, create cm before referring in the function"
	//SECRET_MISSING - error message to indicate Secret is missing
	SECRET_MISSING = "secret %s is not found in the namespace %s, create secret before referring in the function"
	//INVALID_ENV_FROM_TYPE - error message to indicate invalid type to mount as env
	INVALID_ENV_FROM_TYPE = "Provide a valid EnvFrom type. Should be 'CM' or 'Secret'"
)

Variables

This section is empty.

Functions

func Client

func Client(c context.Context) *coreClient

func GetContainerSpec

func GetContainerSpec(spec kubernetes.ContainerSpec, options ...ContainerSpecOption) corev1.Container

GetContainerSpec construct container spec based on option provided

func GetEnvFromHTTPParam

func GetEnvFromHTTPParam(queryParams map[string][]string) []corev1.EnvVar

func GetEnvfromSecretorCM

func GetEnvfromSecretorCM(envFrom []kubernetes.EnvFrom) []corev1.EnvFromSource

func GetPodSpec

func GetPodSpec(spec kubernetes.PodSpec, options ...PodSpecOption) corev1.PodSpec

func GetVolumeMounts

func GetVolumeMounts(configmaps []corev1.VolumeMount, secrets []corev1.VolumeMount) []corev1.VolumeMount

func GetVolumeSources

func GetVolumeSources(configmaps []corev1.VolumeMount, secrets []corev1.VolumeMount) []corev1.Volume

Types

type ContainerSpecOption

type ContainerSpecOption func(*corev1.Container)

func WithCommand

func WithCommand(cmd []string) ContainerSpecOption

WithCommand - container startup command

func WithEnv

func WithEnv(envs []corev1.EnvVar) ContainerSpecOption

WithEnv attach env variables

func WithEnvFromSecretorCM

func WithEnvFromSecretorCM(envFromSecretorCM []kubernetes.EnvFrom) ContainerSpecOption

WithEnvFromSecretorCM attach secret/cm as env

func WithImagePullPolicy

func WithImagePullPolicy(pullPolicy corev1.PullPolicy) ContainerSpecOption

WithImagePullPolicy - image pull policy

func WithName

func WithName(name string) ContainerSpecOption

WithName - name of the container

func WithPort

func WithPort(port int32) ContainerSpecOption

WithPort appends the container port

func WithResources

func WithResources(resources []kubernetes.Resource) ContainerSpecOption

WithResources - container resource constraints

func WithSecurityContext

func WithSecurityContext(user int64) ContainerSpecOption

WithSecurityContext attached pod security policy

func WithVolumeMounts

func WithVolumeMounts(cms []corev1.VolumeMount, secrets []corev1.VolumeMount) ContainerSpecOption

WithVolumeMounts mount cm/secret as volume

type PodSpecOption

type PodSpecOption func(*corev1.PodSpec)

func WithContainerOptions

func WithContainerOptions(cspec kubernetes.ContainerSpec, options ...ContainerSpecOption) PodSpecOption

func WithRestartPolicy

func WithRestartPolicy(policy string) PodSpecOption

func WithServiceAccount

func WithServiceAccount(sa string) PodSpecOption

func WithVolumes

func WithVolumes(containers []kubernetes.ContainerSpec) PodSpecOption

Jump to

Keyboard shortcuts

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