deployment

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 5, 2022 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteCollectionDeployment

func DeleteCollectionDeployment(client *kubernetes.Clientset, deploymentList []k8s.RemoveDeploymentData) (err error)

func DeleteDeployment

func DeleteDeployment(client *kubernetes.Clientset, ns string, deploymentName string) (err error)

func RestartDeployment

func RestartDeployment(client *kubernetes.Clientset, deploymentName string, namespace string) (err error)

func RollbackDeployment

func RollbackDeployment(client *kubernetes.Clientset, deploymentName string, namespace string, reVersion int64) (err error)

func ScaleDeployment

func ScaleDeployment(client *kubernetes.Clientset, ns string, deploymentName string, scaleNumber int32) (err error)

Types

type Deployment

type Deployment struct {
	ObjectMeta k8s.ObjectMeta `json:"objectMeta"`
	TypeMeta   k8s.TypeMeta   `json:"typeMeta"`

	// Aggregate information about pods belonging to this Deployment.
	Pods k8scommon.PodInfo `json:"pods"`

	// Container images of the Deployment.
	ContainerImages []string `json:"containerImages"`

	// Init Container images of the Deployment.
	InitContainerImages []string `json:"initContainerImages"`

	// Deployment replicas ready
	DeploymentStatus DeploymentStatus `json:"deploymentStatus"`
}

Deployment is a presentation layer view of Kubernetes Deployment resource. This means it is Deployment plus additional augmented data we can get from other sources (like services that target the same pods).

type DeploymentCell

type DeploymentCell apps.Deployment

func (DeploymentCell) GetProperty

GetProperty is used to get property of the deployment

type DeploymentDetail

type DeploymentDetail struct {
	// Extends list item structure.
	Deployment `json:",inline"`

	// Label selector of the service.
	Selector map[string]string `json:"selector"`

	// Status information on the deployment
	StatusInfo `json:"statusInfo"`

	// Conditions describe the state of a deployment at a certain point.
	Conditions []k8scommon.Condition `json:"conditions"`

	// The deployment strategy to use to replace existing pods with new ones.
	// Valid options: Recreate, RollingUpdate
	Strategy apps.DeploymentStrategyType `json:"strategy"`

	// Min ready seconds
	MinReadySeconds int32 `json:"minReadySeconds"`

	// Rolling update strategy containing maxSurge and maxUnavailable
	RollingUpdateStrategy *RollingUpdateStrategy `json:"rollingUpdateStrategy,omitempty"`

	// Optional field that specifies the number of old Replica Sets to retain to allow rollback.
	RevisionHistoryLimit *int32 `json:"revisionHistoryLimit"`

	// Events Info
	Events []v1.Event `json:"events"`

	// Deployment history image version
	HistoryVersion []HistoryVersion `json:"historyVersion"`

	PodList *PodList `json:"podList"`

	SvcList *service.ServiceList `json:"svcList"`
}

DeploymentDetail is a presentation layer view of Kubernetes Deployment resource.

func GetDeploymentDetail

func GetDeploymentDetail(client *kubernetes.Clientset, namespace string, deploymentName string) (*DeploymentDetail, error)

GetDeploymentDetail returns model object of deployment and error, if any.

type DeploymentList

type DeploymentList struct {
	ListMeta k8s.ListMeta `json:"listMeta"`
	// Basic information about resources status on the list.
	Status k8scommon.ResourceStatus `json:"status"`
	// Unordered list of Deployments.
	Deployments []Deployment `json:"deployments"`
}

DeploymentList contains a list of Deployments in the cluster.

func GetDeploymentList

func GetDeploymentList(client *kubernetes.Clientset, nsQuery *k8scommon.NamespaceQuery, dsQuery *dataselect.DataSelectQuery) (*DeploymentList, error)

GetDeploymentList 返回集群中所有deployment的列表

func GetDeploymentListFromChannels

func GetDeploymentListFromChannels(channels *k8scommon.ResourceChannels, dsQuery *dataselect.DataSelectQuery) (*DeploymentList, error)

GetDeploymentListFromChannels returns a list of all Deployments in the cluster reading required resource list once from the channels.

type DeploymentStatus

type DeploymentStatus struct {
	// Total number of non-terminated pods targeted by this deployment (their labels match the selector).
	// +optional
	Replicas int32 `json:"replicas"`

	// Total number of non-terminated pods targeted by this deployment that have the desired template spec.
	// +optional
	UpdatedReplicas int32 `json:"updatedReplicas"`

	// Total number of ready pods targeted by this deployment.
	// +optional
	ReadyReplicas int32 `json:"readyReplicas"`

	// Total number of available pods (ready for at least minReadySeconds) targeted by this deployment.
	// +optional
	AvailableReplicas int32 `json:"availableReplicas"`

	// Total number of unavailable pods targeted by this deployment. This is the total number of
	// pods that are still required for the deployment to have 100% available capacity. They may
	// either be pods that are running but not yet available or pods that still have not been created.
	// +optional
	UnavailableReplicas int32 `json:"unavailableReplicas"`
}

type HistoryVersion

type HistoryVersion struct {
	CreateTime metaV1.Time `json:"create_time"`
	Image      string      `json:"image"`
	Version    int64       `json:"version"`
	Namespace  string      `json:"namespace"`
	Name       string      `json:"name"`
}

type PodList

type PodList struct {
	ListMeta k8s.ListMeta `json:"listMeta"`

	// Basic information about resources status on the list.
	Status k8scommon.ResourceStatus `json:"status"`

	// Unordered list of Pods.
	Pods []pods.Pod `json:"pods"`
}

type RollingUpdateStrategy

type RollingUpdateStrategy struct {
	MaxSurge       *intstr.IntOrString `json:"maxSurge"`
	MaxUnavailable *intstr.IntOrString `json:"maxUnavailable"`
}

RollingUpdateStrategy is behavior of a rolling update. See RollingUpdateDeployment K8s object.

type StatusInfo

type StatusInfo struct {
	// Total number of desired replicas on the deployment
	Replicas int32 `json:"replicas"`

	// Number of non-terminated pods that have the desired template spec
	Updated int32 `json:"updated"`

	// Number of available pods (ready for at least minReadySeconds)
	// targeted by this deployment
	Available int32 `json:"available"`

	// Total number of unavailable pods targeted by this deployment.
	Unavailable int32 `json:"unavailable"`
}

StatusInfo is the status information of the deployment

func GetStatusInfo

func GetStatusInfo(deploymentStatus *apps.DeploymentStatus) StatusInfo

GetStatusInfo is used to get the status information from the *apps.DeploymentStatus

Jump to

Keyboard shortcuts

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