apps

package
v0.0.0-...-ae3d3cc Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ImagePullPolicy = v1.PullIfNotPresent
)

Functions

func GetContainer

func GetContainer(spec *v1.PodSpec, name string) *v1.Container

GetContainer Get a container from the pod that match the name

func LinkVolumes

func LinkVolumes(objects []any, volumes []types.LinkVolumeData)

Types

type ContainerBuilder

type ContainerBuilder struct {
	*v1.Container
}

func NewContainer

func NewContainer(name string) *ContainerBuilder

func ToContainerBuilder

func ToContainerBuilder(container *v1.Container) *ContainerBuilder

func (*ContainerBuilder) AddEnvironmentFromSource

func (c *ContainerBuilder) AddEnvironmentFromSource(overwrite bool, envVars ...v1.EnvFromSource) *ContainerBuilder

func (*ContainerBuilder) AddEnvironmentVariable

func (c *ContainerBuilder) AddEnvironmentVariable(overwrite bool, envVars ...v1.EnvVar) *ContainerBuilder

func (*ContainerBuilder) AddEnvironmentVariable2

func (c *ContainerBuilder) AddEnvironmentVariable2(name, value string, overwrite bool) *ContainerBuilder

func (*ContainerBuilder) AddPorts

func (c *ContainerBuilder) AddPorts(overwrite bool, ports ...v1.ContainerPort) *ContainerBuilder

func (*ContainerBuilder) AddPortsRange

func (c *ContainerBuilder) AddPortsRange(startPort v1.ContainerPort, count, step int) *ContainerBuilder

func (*ContainerBuilder) EnvironmentFromSourceExist

func (c *ContainerBuilder) EnvironmentFromSourceExist(envFrom v1.EnvFromSource) (int, bool)

func (*ContainerBuilder) EnvironmentVariableExist

func (c *ContainerBuilder) EnvironmentVariableExist(envVarName string) (int, bool)

func (*ContainerBuilder) PortExist

func (c *ContainerBuilder) PortExist(portName string) (int, bool)

func (*ContainerBuilder) SetArgs

func (c *ContainerBuilder) SetArgs(args []string) *ContainerBuilder

func (*ContainerBuilder) SetCommand

func (c *ContainerBuilder) SetCommand(command []string) *ContainerBuilder

func (*ContainerBuilder) SetImage

func (c *ContainerBuilder) SetImage(image string) *ContainerBuilder

func (*ContainerBuilder) SetImagePullPolicy

func (c *ContainerBuilder) SetImagePullPolicy(imagePullPolicy v1.PullPolicy) *ContainerBuilder

func (*ContainerBuilder) SetLivenessProbe

func (c *ContainerBuilder) SetLivenessProbe(livenessProbe v1.Probe) *ContainerBuilder

SetLivenessProbe Set the liveness probe for the container

func (*ContainerBuilder) SetReadinessProbe

func (c *ContainerBuilder) SetReadinessProbe(readinessProbe v1.Probe) *ContainerBuilder

SetReadinessProbe Set the readiness probe for the container

func (*ContainerBuilder) SetResourceRequirements

func (c *ContainerBuilder) SetResourceRequirements(resources v1.ResourceRequirements) *ContainerBuilder

func (*ContainerBuilder) SetRole

func (c *ContainerBuilder) SetRole(role string) *ContainerBuilder

func (*ContainerBuilder) SetSecurityContext

func (c *ContainerBuilder) SetSecurityContext(securityContext v1.SecurityContext) *ContainerBuilder

func (*ContainerBuilder) SetStartupProbe

func (c *ContainerBuilder) SetStartupProbe(startupProbe v1.Probe) *ContainerBuilder

SetStartupProbe Set the startup probe for the container

func (*ContainerBuilder) SetTTY

func (c *ContainerBuilder) SetTTY(tty bool) *ContainerBuilder

func (*ContainerBuilder) ToContainer

func (c *ContainerBuilder) ToContainer() *v1.Container

type DeploymentBuilder

type DeploymentBuilder struct {
	*PodBuilder
	Deployment *appsv1.Deployment
}

func NewDeploymentBuilder

func NewDeploymentBuilder(name string) *DeploymentBuilder

func (*DeploymentBuilder) AddMatchLabel

func (d *DeploymentBuilder) AddMatchLabel(key, value string)

func (*DeploymentBuilder) AddMatchLabels

func (d *DeploymentBuilder) AddMatchLabels(labels map[string]string)

func (*DeploymentBuilder) DeepCopy

func (d *DeploymentBuilder) DeepCopy() *DeploymentBuilder

func (*DeploymentBuilder) SetReplicas

func (d *DeploymentBuilder) SetReplicas(replicas int32)

func (*DeploymentBuilder) ToResource

func (builder *DeploymentBuilder) ToResource() types.Resource

ToResource Create the interface to the Formation controller

type PodBuilder

type PodBuilder struct {
	*types.ConvergedGroup
	builder.Builder
	Spec *v1.PodSpec
}

func FindAllPodBuilderWithContainerName

func FindAllPodBuilderWithContainerName(builders []*PodBuilder, containerName string) []*PodBuilder

func (*PodBuilder) AddAffinity

func (builder *PodBuilder) AddAffinity(affinity v1.Affinity)

AddAffinity add affinity to the pod

func (*PodBuilder) AddContainer

func (builder *PodBuilder) AddContainer(container *v1.Container) *PodBuilder

AddContainer Add a container to the pod

func (*PodBuilder) AddEnv

func (builder *PodBuilder) AddEnv(containerName string, envs ...v1.EnvVar)

AddEnv add environment variables to the container

func (*PodBuilder) AddEnvFromSourceToContainer

func (builder *PodBuilder) AddEnvFromSourceToContainer(containerName string, envFromSource v1.EnvFromSource)

AddEnvFromSourceToContainer Add environment variables from a source to the container

func (*PodBuilder) AddEnvToAllContainer

func (builder *PodBuilder) AddEnvToAllContainer(envVar ...v1.EnvVar) *PodBuilder

AddEnvToAllContainer Add environment variables to all containers

func (*PodBuilder) AddEnvToContainer

func (builder *PodBuilder) AddEnvToContainer(containerName string, envVar ...v1.EnvVar) *PodBuilder

AddEnvToContainer Add environment variables to the container

func (*PodBuilder) AddImagePullSecrets

func (builder *PodBuilder) AddImagePullSecrets(secretNames ...string)

ImagePullSecrets add image pull secrets to the pod

func (*PodBuilder) AddInitContainer

func (builder *PodBuilder) AddInitContainer(container *v1.Container) *PodBuilder

AddInitContainer Add a init container to the pod

func (*PodBuilder) AddNodeSelector

func (builder *PodBuilder) AddNodeSelector(name string, value string)

AddNodeSelector add node selector to the pod

func (*PodBuilder) AddResourceRequirements

func (builder *PodBuilder) AddResourceRequirements(containerName string, resourceRequirements v1.ResourceRequirements)

AddResourceRequirements add resource requirements to the container

func (*PodBuilder) AddTolerations

func (builder *PodBuilder) AddTolerations(tolerations ...v1.Toleration)

AddTolerations add tolerations to the pod

func (*PodBuilder) AddTopologySpreadConstraints

func (builder *PodBuilder) AddTopologySpreadConstraints(constraints ...v1.TopologySpreadConstraint)

AddTopologySpreadConstraints add topology spread constraints to the pod

func (*PodBuilder) AddVolumeToContainer

func (builder *PodBuilder) AddVolumeToContainer(containerName string, containerVolume v1.VolumeMount, volume v1.VolumeSource)

AddVolumeToContainer Add a volume to the container

func (*PodBuilder) GetContainer

func (builder *PodBuilder) GetContainer(name string) *v1.Container

GetContainer Get a container from the pod that match the name

func (*PodBuilder) GetVolume

func (builder *PodBuilder) GetVolume(name string) *v1.Volume

GetVolume Get a volume from the pod that match the name

func (*PodBuilder) ResourcesName

func (builder *PodBuilder) ResourcesName() []string

ResourcesName returns a list of name of the resources The format is <podName>/<containerName>

func (*PodBuilder) SetImage

func (builder *PodBuilder) SetImage(containerName string, image string)

SetImage set the image of the container

func (*PodBuilder) SetImagePullPolicy

func (builder *PodBuilder) SetImagePullPolicy(containerName string, policy v1.PullPolicy)

SetImagePullPolicy set the image pull policy of the container

func (*PodBuilder) SetLivenessProbe

func (builder *PodBuilder) SetLivenessProbe(containerName string, probe v1.Probe)

SetLivenessProbe set the liveness probe of the container

func (*PodBuilder) SetReadinessProbe

func (builder *PodBuilder) SetReadinessProbe(containerName string, probe v1.Probe)

SetReadinessProbe set the readiness probe of the container

func (*PodBuilder) SetRestartPolicy

func (builder *PodBuilder) SetRestartPolicy(restart v1.RestartPolicy) *PodBuilder

func (*PodBuilder) SetServiceAccount

func (builder *PodBuilder) SetServiceAccount(name string) *PodBuilder

SetServiceAccount Set the service account for the pod

func (*PodBuilder) SetServiceAccountName

func (builder *PodBuilder) SetServiceAccountName(serviceAccountName string)

SetServiceAccountName set the service account of the pod

func (*PodBuilder) SetStartupProbe

func (builder *PodBuilder) SetStartupProbe(containerName string, probe v1.Probe)

SetStartupProbe set the startup probe of the container

type VolumeTemplateBuilder

type VolumeTemplateBuilder interface {
	HandleTemplate(containerName string, containerVolume v1.VolumeMount, pvc v1.PersistentVolumeClaim)
}

Jump to

Keyboard shortcuts

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