Documentation ¶
Index ¶
- func GetImagePullSecrets(s string) []corev1.LocalObjectReference
- type Container
- func (c *Container) Build() *corev1.Container
- func (c *Container) WithArgumentsNew(args []string) *Container
- func (c *Container) WithCommandNew(cmd []string) *Container
- func (c *Container) WithEnvs(envs []corev1.EnvVar) *Container
- func (c *Container) WithEnvsNew(envs []corev1.EnvVar) *Container
- func (c *Container) WithImage(img string) *Container
- func (c *Container) WithImagePullPolicy(policy corev1.PullPolicy) *Container
- func (c *Container) WithLifeCycle(lc *corev1.Lifecycle) *Container
- func (c *Container) WithLivenessProbe(liveness *corev1.Probe) *Container
- func (c *Container) WithName(name string) *Container
- func (c *Container) WithPortsNew(ports []corev1.ContainerPort) *Container
- func (c *Container) WithPrivilegedSecurityContext(privileged *bool) *Container
- func (c *Container) WithResources(resources corev1.ResourceRequirements) *Container
- func (c *Container) WithResourcesByRef(resources *corev1.ResourceRequirements) *Container
- func (c *Container) WithTTY(tty bool) *Container
- func (c *Container) WithVolumeDevicesNew(volumeDevices []corev1.VolumeDevice) *Container
- func (c *Container) WithVolumeMountsNew(volumeMounts []corev1.VolumeMount) *Container
- type PodTemplateSpec
- func (p *PodTemplateSpec) Build() *corev1.PodTemplateSpec
- func (p *PodTemplateSpec) WithAffinity(affinity *corev1.Affinity) *PodTemplateSpec
- func (p *PodTemplateSpec) WithAnnotations(annotations map[string]string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithAnnotationsNew(annotations map[string]string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithContainers(containersList ...*Container) *PodTemplateSpec
- func (p *PodTemplateSpec) WithImagePullSecrets(secrets []corev1.LocalObjectReference) *PodTemplateSpec
- func (p *PodTemplateSpec) WithLabels(labels map[string]string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithLabelsNew(labels map[string]string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithName(name string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithNamespace(namespace string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithNodeSelector(nodeselectors map[string]string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithNodeSelectorByValue(nodeselectors map[string]string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithNodeSelectorNew(nodeselectors map[string]string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithPriorityClassName(prorityClassName string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithRestartPolicy(policy corev1.RestartPolicy) *PodTemplateSpec
- func (p *PodTemplateSpec) WithServiceAccountName(serviceAccountnNme string) *PodTemplateSpec
- func (p *PodTemplateSpec) WithTolerations(tolerations ...corev1.Toleration) *PodTemplateSpec
- func (p *PodTemplateSpec) WithTolerationsNew(tolerations ...corev1.Toleration) *PodTemplateSpec
- func (p *PodTemplateSpec) WithVolumes(volumerList ...*Volume) *PodTemplateSpec
- type Service
- func (s *Service) Build() *corev1.Service
- func (s *Service) WithAnnotations(annotations map[string]string) *Service
- func (s *Service) WithAnnotationsNew(annotations map[string]string) *Service
- func (s *Service) WithLabels(labels map[string]string) *Service
- func (s *Service) WithLabelsNew(labels map[string]string) *Service
- func (s *Service) WithName(name string) *Service
- func (s *Service) WithNamespace(namespace string) *Service
- func (s *Service) WithOwnerReferenceNew(ownerRefernce []metav1.OwnerReference) *Service
- func (s *Service) WithPorts(ports []corev1.ServicePort) *Service
- func (s *Service) WithSelectors(selectors map[string]string) *Service
- func (s *Service) WithSelectorsNew(selectors map[string]string) *Service
- func (s *Service) WithType(svcType corev1.ServiceType) *Service
- type Volume
- func (v *Volume) Build() *corev1.Volume
- func (v *Volume) WithEmptyDir(dir *corev1.EmptyDirVolumeSource) *Volume
- func (v *Volume) WithHostDirectory(path string) *Volume
- func (v *Volume) WithHostPathAndType(dirpath string, dirtype *corev1.HostPathType) *Volume
- func (v *Volume) WithName(name string) *Volume
- func (v *Volume) WithPVCSource(pvcName string) *Volume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetImagePullSecrets ¶
func GetImagePullSecrets(s string) []corev1.LocalObjectReference
GetImagePullSecrets parses and transforms the string to corev1.LocalObjectReference. multiple secrets are separated by commas
Types ¶
type Container ¶
container encapsulates kubernetes container type
func (*Container) WithArgumentsNew ¶
WithArgumentsNew sets the command arguments of the container
func (*Container) WithCommandNew ¶
WithCommandNew sets the command of the container
func (*Container) WithEnvsNew ¶
WithEnvsNew sets the envs 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 ¶
WithLifeCycle sets the life cycle of the container
func (*Container) WithLivenessProbe ¶
WithLivenessProbe sets the liveness probe of the container
func (*Container) WithPortsNew ¶
func (c *Container) WithPortsNew(ports []corev1.ContainerPort) *Container
WithPortsNew sets ports of the container
func (*Container) WithPrivilegedSecurityContext ¶
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 (p *PodTemplateSpec) Build() *corev1.PodTemplateSpec
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 ¶
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) WithRestartPolicy ¶
func (p *PodTemplateSpec) WithRestartPolicy(policy corev1.RestartPolicy) *PodTemplateSpec
WithRestartPolicy sets the restart-policy for pod-spec
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 ¶
Service holds the api's service objects
func (*Service) WithAnnotations ¶
WithAnnotations merges existing annotations if any with the ones that are provided here
func (*Service) WithAnnotationsNew ¶
WithAnnotationsNew resets the annotation field of service with provided arguments
func (*Service) WithLabels ¶
WithLabels merges existing labels if any with the ones that are provided here
func (*Service) WithLabelsNew ¶
WithLabelsNew resets the labels field of service with provided arguments
func (*Service) WithNamespace ¶
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 ¶
WithSelectors merges existing selectors if any with the ones that are provided here
func (*Service) WithSelectorsNew ¶
WithSelectorsNew resets existing selectors if any with ones that are provided here
type 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 (*Volume) WithEmptyDir ¶
func (v *Volume) WithEmptyDir(dir *corev1.EmptyDirVolumeSource) *Volume
WithEmptyDir sets the EmptyDir field of the Volume with provided dir
func (*Volume) WithHostDirectory ¶
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) WithPVCSource ¶
WithPVCSource sets the Volume field of Volume with provided pvc