core

package
v2.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetImagePullSecrets added in v2.2.0

func GetImagePullSecrets(s string) []corev1.LocalObjectReference

GetImagePullSecrets parses and transforms the string to corev1.LocalObjectReference. multiple secrets are separated by commas

Types

type Container

type Container struct {
	*corev1.Container
}

container encapsulates kubernetes container type

func NewContainer

func NewContainer() *Container

NewContainer returns a new instance of container

func (*Container) Build

func (c *Container) Build() *corev1.Container

func (*Container) WithArgumentsNew

func (c *Container) WithArgumentsNew(args []string) *Container

WithArgumentsNew sets the command arguments of the container

func (*Container) WithCommandNew

func (c *Container) WithCommandNew(cmd []string) *Container

WithCommandNew sets the command of the container

func (*Container) WithEnvs

func (c *Container) WithEnvs(envs []corev1.EnvVar) *Container

WithEnvs sets the envs of the container

func (*Container) WithEnvsNew

func (c *Container) WithEnvsNew(envs []corev1.EnvVar) *Container

WithEnvsNew sets the envs of the container

func (*Container) WithImage

func (c *Container) WithImage(img string) *Container

WithImage sets the image of the container

func (*Container) WithImagePullPolicy

func (c *Container) WithImagePullPolicy(policy corev1.PullPolicy) *Container

WithImagePullPolicy sets the image pull policy of the container

func (*Container) WithLifeCycle

func (c *Container) WithLifeCycle(lc *corev1.Lifecycle) *Container

WithLifeCycle sets the life cycle of the container

func (*Container) WithLivenessProbe

func (c *Container) WithLivenessProbe(liveness *corev1.Probe) *Container

WithLivenessProbe sets the liveness probe of the container

func (*Container) WithName

func (c *Container) WithName(name string) *Container

WithName sets the name of the container

func (*Container) WithPortsNew

func (c *Container) WithPortsNew(ports []corev1.ContainerPort) *Container

WithPortsNew sets ports of the container

func (*Container) WithPrivilegedSecurityContext

func (c *Container) WithPrivilegedSecurityContext(privileged *bool) *Container

WithPrivilegedSecurityContext sets securitycontext of the container

func (*Container) WithResources

func (c *Container) WithResources(resources corev1.ResourceRequirements) *Container

WithResources sets resources of the container

func (*Container) WithResourcesByRef

func (c *Container) WithResourcesByRef(resources *corev1.ResourceRequirements) *Container

func (*Container) WithVolumeDevicesNew

func (c *Container) WithVolumeDevicesNew(volumeDevices []corev1.VolumeDevice) *Container

WithVolumeDevicesNew sets the containers with the appropriate volumeDevices

func (*Container) WithVolumeMountsNew

func (c *Container) WithVolumeMountsNew(volumeMounts []corev1.VolumeMount) *Container

WithVolumeMountsNew sets the command arguments of the container

type PodTemplateSpec

type PodTemplateSpec struct {
	*corev1.PodTemplateSpec
}

PodTemplateSpec holds the api's podtemplatespec objects

func NewPodTemplateSpec

func NewPodTemplateSpec() *PodTemplateSpec

NewPodTemplateSpec returns new instance of PodTemplateSpec

func (*PodTemplateSpec) Build

func (*PodTemplateSpec) WithAffinity

func (p *PodTemplateSpec) WithAffinity(affinity *corev1.Affinity) *PodTemplateSpec

WithAffinity sets the affinity field of podtemplatespec

func (*PodTemplateSpec) WithAnnotations

func (p *PodTemplateSpec) WithAnnotations(annotations map[string]string) *PodTemplateSpec

WithAnnotations merges existing annotations if any with the ones that are provided here

func (*PodTemplateSpec) WithAnnotationsNew

func (p *PodTemplateSpec) WithAnnotationsNew(annotations map[string]string) *PodTemplateSpec

WithAnnotationsNew resets the annotation field of podtemplatespec with provided arguments

func (*PodTemplateSpec) WithContainers

func (p *PodTemplateSpec) WithContainers(containersList ...*Container) *PodTemplateSpec

WithContainers builds the list of containerbuilder provided and merges it to the containers field of the podtemplatespec

func (*PodTemplateSpec) WithImagePullSecrets added in v2.2.0

func (p *PodTemplateSpec) WithImagePullSecrets(secrets []corev1.LocalObjectReference) *PodTemplateSpec

WithImagePullSecrets sets the pod image pull secrets if the length is zero then no secret is needed to pull the image

func (*PodTemplateSpec) WithLabels

func (p *PodTemplateSpec) WithLabels(labels map[string]string) *PodTemplateSpec

WithLabels merges existing labels if any with the ones that are provided here

func (*PodTemplateSpec) WithLabelsNew

func (p *PodTemplateSpec) WithLabelsNew(labels map[string]string) *PodTemplateSpec

WithLabelsNew resets the labels field of podtemplatespec with provided arguments

func (*PodTemplateSpec) WithName

func (p *PodTemplateSpec) WithName(name string) *PodTemplateSpec

WithName sets the Name field of podtemplatespec with provided value.

func (*PodTemplateSpec) WithNamespace

func (p *PodTemplateSpec) WithNamespace(namespace string) *PodTemplateSpec

WithNamespace sets the Namespace field of PodTemplateSpec with provided value.

func (*PodTemplateSpec) WithNodeSelector

func (p *PodTemplateSpec) WithNodeSelector(nodeselectors map[string]string) *PodTemplateSpec

WithNodeSelector merges the nodeselectors if present with the provided arguments

func (*PodTemplateSpec) WithNodeSelectorByValue

func (p *PodTemplateSpec) WithNodeSelectorByValue(nodeselectors map[string]string) *PodTemplateSpec

func (*PodTemplateSpec) WithNodeSelectorNew

func (p *PodTemplateSpec) WithNodeSelectorNew(nodeselectors map[string]string) *PodTemplateSpec

WithNodeSelectorNew resets the nodeselector field of podtemplatespec with provided arguments

func (*PodTemplateSpec) WithPriorityClassName

func (p *PodTemplateSpec) WithPriorityClassName(prorityClassName string) *PodTemplateSpec

WithPriorityClassName sets the PriorityClassName field of podtemplatespec

func (*PodTemplateSpec) WithServiceAccountName

func (p *PodTemplateSpec) WithServiceAccountName(serviceAccountnNme string) *PodTemplateSpec

WithServiceAccountName sets the ServiceAccountnNme field of podtemplatespec

func (*PodTemplateSpec) WithTolerations

func (p *PodTemplateSpec) WithTolerations(tolerations ...corev1.Toleration) *PodTemplateSpec

WithTolerationsByValue sets pod toleration. If provided tolerations argument is empty it does not complain.

func (*PodTemplateSpec) WithTolerationsNew

func (p *PodTemplateSpec) WithTolerationsNew(tolerations ...corev1.Toleration) *PodTemplateSpec

WithTolerationsNew sets the tolerations field of podtemplatespec

func (*PodTemplateSpec) WithVolumes

func (p *PodTemplateSpec) WithVolumes(volumerList ...*Volume) *PodTemplateSpec

WithVolumes builds the list of volumebuilders provided and merges it to the volumes field of podtemplatespec.

type Service

type Service struct {
	*corev1.Service
}

Service holds the api's service objects

func NewService

func NewService() *Service

NewService returns new instance of service

func (*Service) Build

func (s *Service) Build() *corev1.Service

Build returns the Service API instance

func (*Service) WithAnnotations

func (s *Service) WithAnnotations(annotations map[string]string) *Service

WithAnnotations merges existing annotations if any with the ones that are provided here

func (*Service) WithAnnotationsNew

func (s *Service) WithAnnotationsNew(annotations map[string]string) *Service

WithAnnotationsNew resets the annotation field of service with provided arguments

func (*Service) WithLabels

func (s *Service) WithLabels(labels map[string]string) *Service

WithLabels merges existing labels if any with the ones that are provided here

func (*Service) WithLabelsNew

func (s *Service) WithLabelsNew(labels map[string]string) *Service

WithLabelsNew resets the labels field of service with provided arguments

func (*Service) WithName

func (s *Service) WithName(name string) *Service

WithName sets the Name field of service with provided value.

func (*Service) WithNamespace

func (s *Service) WithNamespace(namespace string) *Service

WithNamespace sets the Namespace field of Service with provided value.

func (*Service) WithOwnerReferenceNew

func (s *Service) WithOwnerReferenceNew(ownerRefernce []metav1.OwnerReference) *Service

WithOwnerReferenceNew sets ownerrefernce if any with ones that are provided here

func (*Service) WithPorts

func (s *Service) WithPorts(ports []corev1.ServicePort) *Service

WithPorts sets the Ports field of Service with provided arguments

func (*Service) WithSelectors

func (s *Service) WithSelectors(selectors map[string]string) *Service

WithSelectors merges existing selectors if any with the ones that are provided here

func (*Service) WithSelectorsNew

func (s *Service) WithSelectorsNew(selectors map[string]string) *Service

WithSelectorsNew resets existing selectors if any with ones that are provided here

func (*Service) WithType

func (s *Service) WithType(svcType corev1.ServiceType) *Service

WithType sets the Type field of Service with provided arguments

type Volume

type Volume struct {
	*corev1.Volume
}

Volume is a wrapper over named volume api object, used within Pods. It provides build, validations and other common logic to be used by various feature specific callers.

func NewVolume

func NewVolume() *Volume

NewVolume returns a new instance of volume

func (*Volume) Build

func (v *Volume) Build() *corev1.Volume

func (*Volume) WithEmptyDir

func (v *Volume) WithEmptyDir(dir *corev1.EmptyDirVolumeSource) *Volume

WithEmptyDir sets the EmptyDir field of the Volume with provided dir

func (*Volume) WithHostDirectory

func (v *Volume) WithHostDirectory(path string) *Volume

WithHostDirectory sets the VolumeSource field of Volume with provided hostpath as type directory.

func (*Volume) WithHostPathAndType

func (v *Volume) WithHostPathAndType(dirpath string, dirtype *corev1.HostPathType) *Volume

WithHostPathAndType sets the VolumeSource field of Volume with provided hostpath as directory path and type as directory type

func (*Volume) WithName

func (v *Volume) WithName(name string) *Volume

WithName sets the Name field of Volume with provided value.

func (*Volume) WithPVCSource

func (v *Volume) WithPVCSource(pvcName string) *Volume

WithPVCSource sets the Volume field of Volume with provided pvc

Jump to

Keyboard shortcuts

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