Documentation ¶
Index ¶
- func NewContainer(name, image string, options ...ContainerOption) corev1.Container
- func NewDeployment(name string, options ...DeploymentOption) *appsv1.Deployment
- type ContainerOption
- func ContainerCWD(cwd string) ContainerOption
- func ContainerWithArgs(args ...string) ContainerOption
- func ContainerWithCommand(command ...string) ContainerOption
- func ContainerWithEnv(env ...corev1.EnvVar) ContainerOption
- func ContainerWithEnvFrom(env ...corev1.EnvFromSource) ContainerOption
- func ContainerWithLivenessProbe(probe *corev1.Probe) ContainerOption
- func ContainerWithPorts(ports ...corev1.ContainerPort) ContainerOption
- func ContainerWithPullPolicy(policy corev1.PullPolicy) ContainerOption
- func ContainerWithReadinessProbe(probe *corev1.Probe) ContainerOption
- func WithVolumeMounts(mounts ...corev1.VolumeMount) ContainerOption
- type DeploymentOption
- func WithAnnotations(labels map[string]string) DeploymentOption
- func WithContainer(cont ...corev1.Container) DeploymentOption
- func WithInitContainers(cont ...corev1.Container) DeploymentOption
- func WithLabels(labels map[string]string) DeploymentOption
- func WithReplicas(n int) DeploymentOption
- func WithSelector(sel *metav1.LabelSelector) DeploymentOption
- func WithVolumes(vol ...corev1.Volume) DeploymentOption
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 ¶
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