workloadcontroller

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateNodeSelectorByNodepoolName

func CreateNodeSelectorByNodepoolName(nodepool string) map[string]string

func TaintsToTolerations

func TaintsToTolerations(taints []corev1.Taint) []corev1.Toleration

Types

type DeploymentController added in v1.5.0

type DeploymentController struct {
	client.Client
	Scheme *runtime.Scheme
}

func (*DeploymentController) ApplyTemplate added in v1.5.0

func (d *DeploymentController) ApplyTemplate(scheme *runtime.Scheme, yad *v1alpha1.YurtAppDaemon, nodepool v1alpha1.NodePool, revision string, set *appsv1.Deployment) error

ApplyTemplate updates the object to the latest revision, depending on the YurtAppDaemon.

func (*DeploymentController) CreateWorkload added in v1.5.0

func (d *DeploymentController) CreateWorkload(yad *v1alpha1.YurtAppDaemon, nodepool v1alpha1.NodePool, revision string) error

func (*DeploymentController) DeleteWorkload added in v1.5.0

func (d *DeploymentController) DeleteWorkload(yda *v1alpha1.YurtAppDaemon, load *Workload) error

func (*DeploymentController) GetAllWorkloads added in v1.5.0

func (d *DeploymentController) GetAllWorkloads(yad *v1alpha1.YurtAppDaemon) ([]*Workload, error)

func (*DeploymentController) GetTemplateType added in v1.5.0

func (d *DeploymentController) GetTemplateType() v1alpha1.TemplateType

func (*DeploymentController) ObjectKey added in v1.5.0

func (d *DeploymentController) ObjectKey(load *Workload) client.ObjectKey

func (*DeploymentController) UpdateWorkload added in v1.5.0

func (d *DeploymentController) UpdateWorkload(load *Workload, yad *v1alpha1.YurtAppDaemon, nodepool v1alpha1.NodePool, revision string) error

type StatefulSetController added in v1.5.0

type StatefulSetController struct {
	client.Client
}

type Workload

type Workload struct {
	Name      string
	Namespace string
	Kind      string
	Spec      WorkloadSpec
	Status    WorkloadStatus
}

func (*Workload) GetKind

func (w *Workload) GetKind() string

func (*Workload) GetNodePoolName

func (w *Workload) GetNodePoolName() string

func (*Workload) GetNodeSelector

func (w *Workload) GetNodeSelector() map[string]string

func (*Workload) GetRevision

func (w *Workload) GetRevision() string

func (*Workload) GetToleration

func (w *Workload) GetToleration() []corev1.Toleration

type WorkloadController

type WorkloadController interface {
	ObjectKey(load *Workload) client.ObjectKey
	GetAllWorkloads(daemon *v1alpha1.YurtAppDaemon) ([]*Workload, error)
	CreateWorkload(daemon *v1alpha1.YurtAppDaemon, nodepool v1alpha1.NodePool, revision string) error
	UpdateWorkload(load *Workload, daemon *v1alpha1.YurtAppDaemon, nodepool v1alpha1.NodePool, revision string) error
	DeleteWorkload(daemon *v1alpha1.YurtAppDaemon, load *Workload) error
	GetTemplateType() v1alpha1.TemplateType
}

type WorkloadSpec

type WorkloadSpec struct {
	Ref          metav1.Object
	Tolerations  []corev1.Toleration
	NodeSelector map[string]string
}

WorkloadSpec stores the spec details of the workload

type WorkloadStatus

type WorkloadStatus struct {
	Replicas           int32
	ReadyReplicas      int32
	AvailableCondition corev1.ConditionStatus
}

WorkloadStatus stores the observed state of the Workload.

Jump to

Keyboard shortcuts

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