Documentation ¶
Index ¶
- func GetGVR() schema.GroupVersionResource
- type AdditionalOptions
- type Builder
- func List(apiClient *clients.Settings, nsname string, options ...metav1.ListOptions) ([]*Builder, error)
- func ListInAllNamespaces(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*Builder, error)
- func NewBuilder(apiClient *clients.Settings, name, nsname string, labels map[string]string, ...) *Builder
- func Pull(apiClient *clients.Settings, name, nsname string) (*Builder, error)
- func (builder *Builder) Create() (*Builder, error)
- func (builder *Builder) CreateAndWaitUntilReady(timeout time.Duration) (*Builder, error)
- func (builder *Builder) Delete() error
- func (builder *Builder) DeleteAndWait(timeout time.Duration) error
- func (builder *Builder) Exists() bool
- func (builder *Builder) IsReady(timeout time.Duration) bool
- func (builder *Builder) Update() (*Builder, error)
- func (builder *Builder) WaitUntilCondition(condition appsv1.DeploymentConditionType, timeout time.Duration) error
- func (builder *Builder) WaitUntilDeleted(timeout time.Duration) error
- func (builder *Builder) WithAdditionalContainerSpecs(specs []corev1.Container) *Builder
- func (builder *Builder) WithAffinity(affinity *corev1.Affinity) *Builder
- func (builder *Builder) WithHostNetwork(enableHostnetwork bool) *Builder
- func (builder *Builder) WithHugePages() *Builder
- func (builder *Builder) WithLabel(labelKey, labelValue string) *Builder
- func (builder *Builder) WithNodeSelector(selector map[string]string) *Builder
- func (builder *Builder) WithOptions(options ...AdditionalOptions) *Builder
- func (builder *Builder) WithReplicas(replicas int32) *Builder
- func (builder *Builder) WithSchedulerName(schedulerName string) *Builder
- func (builder *Builder) WithSecondaryNetwork(networks []*multus.NetworkSelectionElement) *Builder
- func (builder *Builder) WithSecurityContext(securityContext *corev1.PodSecurityContext) *Builder
- func (builder *Builder) WithServiceAccountName(serviceAccountName string) *Builder
- func (builder *Builder) WithToleration(toleration corev1.Toleration) *Builder
- func (builder *Builder) WithVolume(deployVolume corev1.Volume) *Builder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetGVR ¶
func GetGVR() schema.GroupVersionResource
GetGVR returns deployment's GroupVersionResource which could be used for Clean function.
Types ¶
type AdditionalOptions ¶
AdditionalOptions additional options for deployment object.
type Builder ¶
type Builder struct { // Deployment definition. Used to create the deployment object. Definition *appsv1.Deployment // Created deployment object Object *appsv1.Deployment // contains filtered or unexported fields }
Builder provides struct for deployment object containing connection to the cluster and the deployment definitions.
func List ¶
func List(apiClient *clients.Settings, nsname string, options ...metav1.ListOptions) ([]*Builder, error)
List returns deployment inventory in the given namespace.
func ListInAllNamespaces ¶
func ListInAllNamespaces(apiClient *clients.Settings, options ...metav1.ListOptions) ([]*Builder, error)
ListInAllNamespaces returns deployment inventory in the all the namespaces.
func NewBuilder ¶
func NewBuilder( apiClient *clients.Settings, name, nsname string, labels map[string]string, containerSpec corev1.Container) *Builder
NewBuilder creates a new instance of Builder.
func (*Builder) Create ¶
Create generates a deployment in cluster and stores the created object in struct.
func (*Builder) CreateAndWaitUntilReady ¶
CreateAndWaitUntilReady creates a deployment in the cluster and waits until the deployment is available.
func (*Builder) DeleteAndWait ¶
DeleteAndWait deletes a deployment and waits until it is removed from the cluster.
func (*Builder) Update ¶
Update renovates the existing deployment object with the deployment definition in builder.
func (*Builder) WaitUntilCondition ¶
func (builder *Builder) WaitUntilCondition(condition appsv1.DeploymentConditionType, timeout time.Duration) error
WaitUntilCondition waits for the duration of the defined timeout or until the deployment gets to a specific condition.
func (*Builder) WaitUntilDeleted ¶
WaitUntilDeleted waits for the duration of the defined timeout or until the deployment is deleted.
func (*Builder) WithAdditionalContainerSpecs ¶
WithAdditionalContainerSpecs appends a list of container specs to the deployment definition.
func (*Builder) WithAffinity ¶
WithAffinity applies Affinity to the deployment definition.
func (*Builder) WithHostNetwork ¶
WithHostNetwork applies a hostnetwork state to the deployment definition.
func (*Builder) WithHugePages ¶
WithHugePages sets hugePages on all containers inside the deployment.
func (*Builder) WithNodeSelector ¶
WithNodeSelector applies a nodeSelector to the deployment definition.
func (*Builder) WithOptions ¶
func (builder *Builder) WithOptions(options ...AdditionalOptions) *Builder
WithOptions creates deployment with generic mutation options.
func (*Builder) WithReplicas ¶
WithReplicas sets the desired number of replicas in the deployment definition.
func (*Builder) WithSchedulerName ¶
WithSchedulerName configures a scheduler to process pod's scheduling.
func (*Builder) WithSecondaryNetwork ¶
func (builder *Builder) WithSecondaryNetwork(networks []*multus.NetworkSelectionElement) *Builder
WithSecondaryNetwork applies Multus secondary network configuration on deployment definition.
func (*Builder) WithSecurityContext ¶
func (builder *Builder) WithSecurityContext(securityContext *corev1.PodSecurityContext) *Builder
WithSecurityContext sets SecurityContext on deployment definition.
func (*Builder) WithServiceAccountName ¶
WithServiceAccountName sets the ServiceAccountName on deployment definition.
func (*Builder) WithToleration ¶
func (builder *Builder) WithToleration(toleration corev1.Toleration) *Builder
WithToleration applies a toleration to the deployment's definition.