k8s

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewContainer

func NewContainer(name, image string, options ...ContainerOption) corev1.Container

NewContainer creates a new kubernetes containers with the given options applied to it

func NewDeployment

func NewDeployment(name string, options ...DeploymentOption) *appsv1.Deployment

NewDeployment creates a deployment with the given options applied to it

Types

type ContainerOption

type ContainerOption func(*corev1.Container)

ContainerOption is a type that changes a container's configuration on instantiation

func ContainerCWD

func ContainerCWD(cwd string) ContainerOption

ContainerCWD changes the CWD of a container

func ContainerWithArgs

func ContainerWithArgs(args ...string) ContainerOption

ContainerWithArgs adds arguments to the entrypoint of the container

func ContainerWithCommand

func ContainerWithCommand(command ...string) ContainerOption

ContainerWithCommand changes the command for the container

func ContainerWithEnv

func ContainerWithEnv(env ...corev1.EnvVar) ContainerOption

ContainerWithEnv adds environment variables to a container

func ContainerWithEnvFrom

func ContainerWithEnvFrom(env ...corev1.EnvFromSource) ContainerOption

ContainerWithEnvFrom adds environment variables from a source to a container

func ContainerWithLivenessProbe

func ContainerWithLivenessProbe(probe *corev1.Probe) ContainerOption

ContainerWithLivenessProbe adds a liveness probe to a k8s container

func ContainerWithPorts

func ContainerWithPorts(ports ...corev1.ContainerPort) ContainerOption

ContainerWithPorts adds ports to a k8s container

func ContainerWithPullPolicy

func ContainerWithPullPolicy(policy corev1.PullPolicy) ContainerOption

ContainerWithPullPolicy adds a pull policy to a container

func ContainerWithReadinessProbe

func ContainerWithReadinessProbe(probe *corev1.Probe) ContainerOption

ContainerWithReadinessProbe adds a readiness probe to a k8s container

func WithVolumeMounts

func WithVolumeMounts(mounts ...corev1.VolumeMount) ContainerOption

WithVolumeMounts adds volume mounts to a container

type DeploymentOption

type DeploymentOption func(*appsv1.Deployment)

DeploymentOption is a type to change a deployment on instantiation

func WithAnnotations

func WithAnnotations(labels map[string]string) DeploymentOption

WithAnnotations adds annotations to the deployment and it's templates

func WithContainer

func WithContainer(cont ...corev1.Container) DeploymentOption

WithContainer adds containers to the deployment

func WithInitContainers

func WithInitContainers(cont ...corev1.Container) DeploymentOption

WithInitContainers adds initialization containers to the deployment

func WithLabels

func WithLabels(labels map[string]string) DeploymentOption

WithLabels adds labels to the deployment. Also sets the label selector for deployment pods

func WithReplicas

func WithReplicas(n int) DeploymentOption

WithReplicas changes the number of replicas of a deployment

func WithSelector

func WithSelector(sel *metav1.LabelSelector) DeploymentOption

WithSelector changes the selector for the deployment

func WithVolumes

func WithVolumes(vol ...corev1.Volume) DeploymentOption

WithVolumes adds volumes to a deployment

Jump to

Keyboard shortcuts

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