Documentation ¶
Index ¶
- Constants
- type Builder
- type CMD
- type Cluster
- func (c *Cluster) AddLabelsToDeployment(dm *extv1beta1.Deployment, labels, patchType string) error
- func (c *Cluster) AddLabelsToPod(pod *apiv1.Pod, labels string) error
- func (c *Cluster) AddLabelsToReplicaSet(rs *extv1beta1.ReplicaSet, labels string, effectSubResources bool, ...) error
- func (c *Cluster) CloneDeployment(info *DeployInfo) (*extv1beta1.Deployment, error)
- func (c *Cluster) CreateDeployment(dm *extv1beta1.Deployment) error
- func (c *Cluster) CreateReplicaSet(rs *extv1beta1.ReplicaSet) (*extv1beta1.ReplicaSet, error)
- func (c *Cluster) DeleteDeployment(dm *extv1beta1.Deployment) error
- func (c *Cluster) Deploy(info *DeployInfo) (*extv1beta1.Deployment, error)
- func (c *Cluster) DisableDeploymentAllTraffic(dm *extv1beta1.Deployment) error
- func (c *Cluster) DisablePodTraffic(pod *apiv1.Pod, serviceName string) error
- func (c *Cluster) EnableDeploymentAllTraffic(dm *extv1beta1.Deployment) error
- func (c *Cluster) EnablePodTraffic(pod *apiv1.Pod, serviceName string) error
- func (c *Cluster) GetDeployment(name string) (*extv1beta1.Deployment, error)
- func (c *Cluster) GetDeploymentByDeployGroup(dgName, target string) (dm *extv1beta1.Deployment, err error)
- func (c *Cluster) GetDeploymentVersion(dm *extv1beta1.Deployment) (int64, error)
- func (c *Cluster) GetPod(podName string) (*apiv1.Pod, error)
- func (c *Cluster) GetReplicaSet(name string) (*extv1beta1.ReplicaSet, error)
- func (c *Cluster) GetService(name string) (*apiv1.Service, error)
- func (c *Cluster) InitService(svc *apiv1.Service) (*apiv1.Service, error)
- func (c *Cluster) ListAllDeploymentsByDeployGroup(deployGroup string) (dmList DeploymentList, err error)
- func (c *Cluster) ListDeployments(selector string) (*extv1beta1.DeploymentList, error)
- func (c *Cluster) ListPods(selector string) (*apiv1.PodList, error)
- func (c *Cluster) ListReplicaSets(labelSelector string) (*extv1beta1.ReplicaSetList, error)
- func (c *Cluster) PauseDeployment(dm *extv1beta1.Deployment) error
- func (c *Cluster) ResumeDeployment(dm *extv1beta1.Deployment) error
- func (c *Cluster) RollbackDeployment(fromDm, toDm *extv1beta1.Deployment) error
- func (c *Cluster) ScaleDeployment(dm *extv1beta1.Deployment, scaleTo int32, autoDeletion bool) error
- func (c *Cluster) TryInitDeployment(dm *extv1beta1.Deployment, deployGroup string, services []string) error
- type DeployInfo
- type DeploymentList
Constants ¶
View Source
const ( DeployVersion = "tencentcloud-deploy-version" DeployGroup = "tencentcloud-deploy-group" ServiceGate = "tencentcloud-service-gate" PatchTypeMetaAndTemplate = "meta_template" PatchTypeMataAndSelector = "meta_selector" PatchTypeTemplate = "template" PatchTypeAll = "all" StrategyRecreate = "recreate" StrategyBlueGreen = "blue-green" StrategyCanary = "canary" StrategyOffline = "offline" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct { Action string // 用户提供参数, 通过环境变量传入 Username string Password string Certificate string Server string Namespace string Services []string Replicas int32 Strategy string Image string DeployTarget string DeploymentName string // rollback FromDeployTarget string FromDeploymentName string ToDeployTarget string ToDeploymentName string DeployGroup string // ScaleStep int64 ScaleTo *int32 ScaleUp *int32 ScaleDown *int32 ShrinkTo int64 AutoDeletion bool // contains filtered or unexported fields }
Builder is
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
func NewCluster ¶
func (*Cluster) AddLabelsToDeployment ¶
func (c *Cluster) AddLabelsToDeployment(dm *extv1beta1.Deployment, labels, patchType string) error
func (*Cluster) AddLabelsToPod ¶
func (*Cluster) AddLabelsToReplicaSet ¶
func (c *Cluster) AddLabelsToReplicaSet(rs *extv1beta1.ReplicaSet, labels string, effectSubResources bool, patchType string) error
func (*Cluster) CloneDeployment ¶
func (c *Cluster) CloneDeployment(info *DeployInfo) (*extv1beta1.Deployment, error)
func (*Cluster) CreateDeployment ¶
func (c *Cluster) CreateDeployment(dm *extv1beta1.Deployment) error
func (*Cluster) CreateReplicaSet ¶
func (c *Cluster) CreateReplicaSet(rs *extv1beta1.ReplicaSet) (*extv1beta1.ReplicaSet, error)
func (*Cluster) DeleteDeployment ¶
func (c *Cluster) DeleteDeployment(dm *extv1beta1.Deployment) error
func (*Cluster) Deploy ¶
func (c *Cluster) Deploy(info *DeployInfo) (*extv1beta1.Deployment, error)
TODO 处理默认策略
func (*Cluster) DisableDeploymentAllTraffic ¶
func (c *Cluster) DisableDeploymentAllTraffic(dm *extv1beta1.Deployment) error
func (*Cluster) DisablePodTraffic ¶
func (*Cluster) EnableDeploymentAllTraffic ¶
func (c *Cluster) EnableDeploymentAllTraffic(dm *extv1beta1.Deployment) error
func (*Cluster) EnablePodTraffic ¶
func (*Cluster) GetDeployment ¶
func (c *Cluster) GetDeployment(name string) (*extv1beta1.Deployment, error)
func (*Cluster) GetDeploymentByDeployGroup ¶
func (c *Cluster) GetDeploymentByDeployGroup(dgName, target string) (dm *extv1beta1.Deployment, err error)
func (*Cluster) GetDeploymentVersion ¶
func (c *Cluster) GetDeploymentVersion(dm *extv1beta1.Deployment) (int64, error)
func (*Cluster) GetReplicaSet ¶
func (c *Cluster) GetReplicaSet(name string) (*extv1beta1.ReplicaSet, error)
replicaSet
func (*Cluster) GetService ¶
service
func (*Cluster) InitService ¶
func (*Cluster) ListAllDeploymentsByDeployGroup ¶
func (c *Cluster) ListAllDeploymentsByDeployGroup(deployGroup string) (dmList DeploymentList, err error)
func (*Cluster) ListDeployments ¶
func (c *Cluster) ListDeployments(selector string) (*extv1beta1.DeploymentList, error)
func (*Cluster) ListReplicaSets ¶
func (c *Cluster) ListReplicaSets(labelSelector string) (*extv1beta1.ReplicaSetList, error)
func (*Cluster) PauseDeployment ¶
func (c *Cluster) PauseDeployment(dm *extv1beta1.Deployment) error
func (*Cluster) ResumeDeployment ¶
func (c *Cluster) ResumeDeployment(dm *extv1beta1.Deployment) error
func (*Cluster) RollbackDeployment ¶
func (c *Cluster) RollbackDeployment(fromDm, toDm *extv1beta1.Deployment) error
func (*Cluster) ScaleDeployment ¶
func (c *Cluster) ScaleDeployment(dm *extv1beta1.Deployment, scaleTo int32, autoDeletion bool) error
func (*Cluster) TryInitDeployment ¶
func (c *Cluster) TryInitDeployment(dm *extv1beta1.Deployment, deployGroup string, services []string) error
初始化遗留部署
type DeployInfo ¶
type DeployInfo struct { Strategy string Template *extv1beta1.Deployment DeployGroup string Services []string Image string Replicas int32 Version *int64 Name string }
func (*DeployInfo) String ¶
func (info *DeployInfo) String() string
type DeploymentList ¶
type DeploymentList []*extv1beta1.Deployment
func (DeploymentList) Len ¶
func (dl DeploymentList) Len() int
func (DeploymentList) Less ¶
func (dl DeploymentList) Less(i, j int) bool
func (DeploymentList) Swap ¶
func (dl DeploymentList) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.