types

package
v0.9.177 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Copyright 2019 Baidu Inc. All rights reserved Use of this source code is governed by a CCE license that can be found in the LICENSE file.

modification history -------------------- 2021/06/24 16:00:00, by pansiyuan02@baidu.com, create

Index

Constants

View Source
const (
	// InstanceTypeDCC DCC 类型
	InstanceTypeDCC bccapi.InstanceType = "DCC"
	// InstanceTypeBBC BBC 类型
	InstanceTypeBBC bccapi.InstanceType = "BBC"
	// InstanceTypeBBCGPU BBC GPU 类型
	InstanceTypeBBCGPU bccapi.InstanceType = "BBC_GPU"
)
View Source
const (
	// LatestSupportedK8SVersion latest K8S Version that we supported
	LatestSupportedK8SVersion = "1.16.8"

	// DefaultRuntime default runtime
	DefaultRuntime = "docker"

	// LatestSupportedDockerVersion default docker version
	LatestSupportedDockerVersion = "18.09.2"

	CCEPrefix = "cce-"

	// ClusterIDLabelKey 关联 ClusterCRD 和 InstanceCRD 或 InstanceGroupCRD
	ClusterIDLabelKey = "cluster-id"

	ClusterRoleLabelKey = "cluster-role"

	DoNotHandle = "not-handler-by-cce"
)
View Source
const (
	DefaultShrinkPolicy               = PriorityShrinkPolicy
	PriorityShrinkPolicy ShrinkPolicy = "Priority"
	RandomShrinkPolicy   ShrinkPolicy = "Random"

	DefaultUpdatePolicy                  = ConcurrencyUpdatePolicy
	RollingUpdatePolicy     UpdatePolicy = "Rolling"
	ConcurrencyUpdatePolicy UpdatePolicy = "Concurrency"

	DefaultCleanPolicy             = RemainCleanPolicy
	RemainCleanPolicy  CleanPolicy = "Remain"
	DeleteCleanPolicy  CleanPolicy = "Delete"
)
View Source
const (
	ImageTypeService bccapi.ImageType = "service"
)

Variables

View Source
var SupportedClusterHA = map[ClusterHA]string{
	ClusterHALow:    "",
	ClusterHAMedium: "",
	ClusterHAHigh:   "",
}

SupportedClusterHA - CCE 支持的 ClusterHA 类型

View Source
var SupportedContainerNetworkMode = map[ContainerNetworkMode]string{
	ContainerNetworkModeKubenet:                  "",
	ContainerNetworkModeVPCCNI:                   "",
	ContainerNetworkModeVPCRouteAutoDetect:       "",
	ContainerNetworkModeVPCRouteVeth:             "",
	ContainerNetworkModeVPCRouteIPVlan:           "",
	ContainerNetworkModeVPCSecondaryIPAutoDetect: "",
	ContainerNetworkModeVPCSecondaryIPVeth:       "",
	ContainerNetworkModeVPCSecondaryIPIPVlan:     "",
}

SupportedContainerNetworkMode - CCE 支持的容器网络类型

View Source
var SupportedGPUType = map[GPUType]string{
	GPUTypeV100_32: "",
	GPUTypeV100_16: "",
	GPUTypeP40:     "",
	GPUTypeP4:      "",
	GPUTypeK40:     "",
	GPUTypeDLCard:  "",
}

SupportedGPUType - CCE 支持的 GPU 类型

SupportedImageType - CCE 支持镜像类型

View Source
var SupportedInstanceType = map[bccapi.InstanceType]string{
	bccapi.InstanceTypeN1: "",
	bccapi.InstanceTypeN2: "",
	bccapi.InstanceTypeN3: "",
	bccapi.InstanceTypeN4: "",
	bccapi.InstanceTypeN5: "",
	bccapi.InstanceTypeC1: "",
	bccapi.InstanceTypeC2: "",
	bccapi.InstanceTypeS1: "",
	bccapi.InstanceTypeG1: "",
	bccapi.InstanceTypeF1: "",

	InstanceTypeDCC:    "",
	InstanceTypeBBC:    "",
	InstanceTypeBBCGPU: "",
}

SupportedInstanceType - CCE 支持的 Instance 类型

View Source
var SupportedK8SVersions = map[K8SVersion]string{

	K8S_1_18_9:  "",
	K8S_1_20_8:  "",
	K8S_1_21_14: "",
	K8S_1_22_5:  "",
	K8S_1_24_4:  "",
	K8S_1_26_9:  "",
}

SupportedK8SVersions - CCE 支持的 K8s 版本

View Source
var SupportedKubeProxyMode = map[KubeProxyMode]string{
	KubeProxyModeIptables: "",
	KubeProxyModeIPVS:     "",
}
View Source
var SupportedMasterType = map[MasterType]string{
	MasterTypeManaged:    "",
	MasterTypeCustom:     "",
	MasterTypeServerless: "",
}

SupportedMasterType - CCE 支持 Master 类型

View Source
var SupportedRootDiskStorageType = map[bccapi.StorageType]string{
	bccapi.StorageTypeHP1:      "",
	bccapi.StorageTypeCloudHP1: "",
}

SupportedRootDiskStorageType - CCE 支持的 RootDiskStorage 类型

View Source
var SupportedRuntimeType = map[RuntimeType]string{
	RuntimeTypeDocker: "",
}

SupportedStorageType - CCE 支持的 Storage 类型

Functions

This section is empty.

Types

type AddOnInfo added in v0.9.171

type AddOnInfo struct {
	// 组件的元信息
	Meta Meta `json:"meta,omitempty"`

	// 组件的安装实例信息 某些组件可以多实例在集群中安装 如 Ingress NGINX Controller
	Instance *AddOnInstance `json:"instance,omitempty"`

	// 组件的安装实例信息 某些组件可以多实例在集群中安装 如 Ingress NGINX Controller
	// 多实例安装的组件会把实例信息都展示在这里
	// 如果组件仅有一个部署实例 这个字段不会返回
	MultiInstances []*AddOnInstance `json:"multiInstances,omitempty"`
}

AddOnInfo 表示集群中某个组件的完整信息 分为元信息和安装实例信息(如果有) 如果组件允许多实例部署,所以已安装实例信息同时会放在 MultiInstances 字段中

type AddOnInstance added in v0.9.171

type AddOnInstance struct {
	// 组件实例的名称
	AddOnInstanceName string `json:"name,omitempty"`

	// 当前组件实例的版本
	InstalledVersion string `json:"installedVersion,omitempty"`

	// 当前组件实例的参数
	Params string `json:"params,omitempty"`

	// Status 组件当前的状态
	Status AddonInstanceStatus `json:"status,omitempty"`

	// UninstallInfo 该组件实例卸载方面的信息(能否卸载,原因)
	UninstallInfo UninstallInfo `json:"uninstallInfo,omitempty"`

	// UpgradeInfo 该组件实例升级方面的信息(能否升级,原因)
	UpgradeInfo UpgradeInfo `json:"upgradeInfo,omitempty"`

	// UpdateInfo 该组件实例更新方面的信息(能否升级,原因)
	UpdateInfo UpdateInfo `json:"updateInfo,omitempty"`

	//RollbackInfo 该组件实例是否支持回滚 默认不支持
	RollbackInfo RollbackInfo `json:"rollback,omitempty"`

	// 组件实例的部署yaml
	Manifest string `json:"manifest,omitempty"`
}

AddOnInstance 表示集群中某个组件的实例部署信息 包括实例名称、安装版本、部署参数、当前状态以及卸载、更新参数、升级方面的信息

type AddOnInstancePhase added in v0.9.171

type AddOnInstancePhase string
const (
	AddOnInstancePhaseRunning      AddOnInstancePhase = "Running"
	AddOnInstancePhaseAbnormal     AddOnInstancePhase = "Abnormal"
	AddOnInstancePhaseInstalling   AddOnInstancePhase = "Installing"
	AddOnInstancePhaseUninstalling AddOnInstancePhase = "Uninstalling"
	AddOnInstancePhaseUpgrading    AddOnInstancePhase = "Upgrading"
	AddOnInstancePhaseFailed       AddOnInstancePhase = "Failed"
	AddOnInstancePhaseDeleting     AddOnInstancePhase = "Deleting"
)

type AddOnType added in v0.9.171

type AddOnType string
const (
	TypeCloudNativeAI AddOnType = "CloudNativeAI"

	TypeNetworking AddOnType = "Networking"

	TypeHybridSchedule AddOnType = "HybridSchedule"

	TypeImage AddOnType = "Image"

	TypeStorage AddOnType = "Storage"

	TypeObservability AddOnType = "Observability"

	TypeOthers = "Others"
)

type AddonInstanceStatus added in v0.9.171

type AddonInstanceStatus struct {
	Phase AddOnInstancePhase `json:"phase,omitempty"`

	// 如果组件实例有异常 这里尽可能返回详细的信息
	Code    string `json:"code,omitempty"`
	TraceID string `json:"traceID,omitempty"`
	Message string `json:"message,omitempty"`
}

type AuthenticateMode added in v0.9.107

type AuthenticateMode string

AuthenticateMode - 认证类型

const (
	// AuthenticateModeX509 - X509
	AuthenticateModeX509 AuthenticateMode = "x509"

	// AuthenticateModeOIDC - OIDC
	AuthenticateModeOIDC AuthenticateMode = "oidc"
)

type AvailableZone

type AvailableZone string

AvailableZone 可用区

const (
	// ZoneA 可用区 A
	AvailableZoneA AvailableZone = "zoneA"

	// ZoneB 可用区 B
	AvailableZoneB AvailableZone = "zoneB"

	// ZoneC 可用区 C
	AvailableZoneC AvailableZone = "zoneC"

	// ZoneD 可用区 D
	AvailableZoneD AvailableZone = "zoneD"

	// ZoneE 可用区 E
	AvailableZoneE AvailableZone = "zoneE"

	// ZoneF 可用区 F
	AvailableZoneF AvailableZone = "zoneF"
)

type BBCFlavorID added in v0.9.65

type BBCFlavorID string

type BBCOption

type BBCOption struct {
	Flavor   string `json:"flavor,omitempty"`
	DiskInfo string `json:"diskInfo,omitempty"`
	// 是否保留数据
	ReserveData bool `json:"reserveData,omitempty"`
	// 磁盘阵列类型 ID
	RaidID string `json:"raidID,omitempty"`
	// 系统盘分配大小
	SysDiskSize int `json:"sysDiskSize,omitempty"`
}

BBCOption BBC 相关配置

type BLBType

type BLBType string

BLBType for load balancer type

const (
	// BLBTypeNormal 普通 BLB 类型
	BLBTypeNormal BLBType = "normal"

	// BLBTypeApplication 应用型 BLB 类型
	BLBTypeApplication BLBType = "application"
)

type BidMode added in v0.9.74

type BidMode string
const (
	// BidModeMarketPrice 跟随市场价出价
	BidModeMarketPrice BidMode = "MARKET_PRICE_BID"

	// BidModeCustomPrice 用户自定义出价
	BidModeCustomPrice BidMode = "CUSTOM_BID"
)

type BidOption added in v0.9.74

type BidOption struct {
	// BidMode 竞价模式
	BidMode BidMode `json:"bidMode,omitempty"`

	// BidPrice 用户的出价, 仅在 BidMode=BidModeCustomPrice 模式下生效
	BidPrice string `json:"bidPrice,omitempty"`

	// BidTime 竞价超时时间, 单位: minute, 超时会取消该竞价实例订单
	BidTimeout int `json:"bidTimeout,omitempty"`

	// BidReleaseEIP 竞价实例被动释放时, 是否联动释放实例 EIP
	BidReleaseEIP bool `json:"bidReleaseEIP,omitempty"`

	// BidReleaseEIP 竞价实例被动释放时, 是否联动释放实例 CDS
	BidReleaseCDS bool `json:"bidReleaseCDS,omitempty"`
}

type BillingMethod

type BillingMethod string

BillingMethod 计费方式

const (
	// BillingMethodByTraffic 按照流量计费
	BillingMethodByTraffic BillingMethod = "ByTraffic"
	// BillingMethodByBandwidth 按带宽计费
	BillingMethodByBandwidth BillingMethod = "ByBandwidth"
)

type CDSConfig

type CDSConfig struct {
	Path        string             `json:"diskPath,omitempty"`
	StorageType bccapi.StorageType `json:"storageType,omitempty"`
	CDSSize     int                `json:"cdsSize,omitempty"`
	SnapshotID  string             `json:"snapshotID,omitempty"`
}

CDSConfig clone from BCC

type CDSConfigList

type CDSConfigList []CDSConfig

type CleanPolicy added in v0.9.20

type CleanPolicy string

type ClusterAutoscalerSpec added in v0.9.20

type ClusterAutoscalerSpec struct {
	Enabled              bool `json:"enabled" `
	MinReplicas          int  `json:"minReplicas" `
	MaxReplicas          int  `json:"maxReplicas" `
	ScalingGroupPriority int  `json:"scalingGroupPriority" `
}

type ClusterHA

type ClusterHA int

ClusterHA Cluster Master 对应副本数

const (
	// ClusterHALow 单 Master
	ClusterHALow ClusterHA = 1
	// ClusterHAMedium 三 Master
	ClusterHAMedium ClusterHA = 3
	// ClusterHAHigh 五 Master
	ClusterHAHigh ClusterHA = 5
	// ClusterHAServerless Cluster Master 副本数
	ClusterHAServerless ClusterHA = 2
)

type ClusterPhase

type ClusterPhase string

ClusterPhase for CCE K8S Cluster Phase

const (
	// ClusterPhasePending 创建 Cluster 时默认状态
	ClusterPhasePending ClusterPhase = "pending"

	// ClusterPhaseProvisioning IaaS 相关资源正在创建中
	ClusterPhaseProvisioning ClusterPhase = "provisioning"

	// ClusterPhaseProvisioned IaaS 相关资源已经 Ready
	ClusterPhaseProvisioned ClusterPhase = "provisioned"

	// ClusterPhaseRunning 集群运行正常
	ClusterPhaseRunning ClusterPhase = "running"

	// ClusterPhaseCreateFailed 集群创建失败
	ClusterPhaseCreateFailed ClusterPhase = "create_failed"

	// ClusterPhaseDeleting 集群正在删除
	ClusterPhaseDeleting ClusterPhase = "deleting"

	// ClusterPhaseDeleted 集群删除完成
	ClusterPhaseDeleted ClusterPhase = "deleted"

	// ClusterPhaseDeleteFailed 集群删除失败
	ClusterPhaseDeleteFailed ClusterPhase = "delete_failed"
)

type ClusterRole

type ClusterRole string

ClusterRole master & slave

const (
	// ClusterRoleMaster K8S master
	ClusterRoleMaster ClusterRole = "master"

	// ClusterRoleNode K8S node
	ClusterRoleNode ClusterRole = "node"
)

type ClusterSpec

type ClusterSpec struct {
	// 创建集群时无需传入ClusterID
	ClusterID string `json:"clusterID,omitempty" validate:"readonly"`

	// ClusterName 由用户指定
	ClusterName string `json:"clusterName" valid:"Required" validate:"modifiable"`

	ClusterType ClusterType `json:"clusterType,omitempty" valid:"Required" validate:"readonly"`

	Description string `json:"description,omitempty" validate:"modifiable"`

	K8SVersion K8SVersion `json:"k8sVersion,omitempty"`

	RuntimeType    RuntimeType `json:"runtimeType,omitempty"`
	RuntimeVersion string      `json:"runtimeVersion,omitempty"`

	// VPCUUID && VPCCIDR 无需用户设置
	VPCID string `json:"vpcID,omitempty" valid:"Required" validate:"readonly"`

	VPCUUID     string `json:"vpcUUID,omitempty" validate:"readonly"`
	VPCCIDR     string `json:"vpcCIDR,omitempty" validate:"readonly"`
	VPCCIDRIPv6 string `json:"vpcCIDRIPv6,omitempty" validate:"readonly"`

	// PluginListType CCE 插件类型
	Plugins []string `json:"plugins,omitempty"`

	// PluginsConfig 插件 Helm 安装配置
	PluginsConfig map[string]PluginHelmConfig `json:"pluginsConfig,omitempty"`

	MasterConfig           MasterConfig           `json:"masterConfig,omitempty" valid:"Required" validate:"inline"`
	ContainerNetworkConfig ContainerNetworkConfig `json:"containerNetworkConfig,omitempty" valid:"Required" validate:"inline"`

	// 集群删除保护标识,true 表示开启删除保护不允许删除集群;false 表示关闭删除保护允许删除集群
	ForbidDelete bool `json:"forbidDelete"`

	// IaaS资源付费选项
	ResourceChargingOption ResourceChargingOption `json:"resourceChargingOption,omitempty" validate:"inline"`

	// K8S 自定义配置
	K8SCustomConfig K8SCustomConfig `json:"k8sCustomConfig,omitempty"`

	// APIServer 认证模式
	AuthenticateMode AuthenticateMode `json:"authenticateMode,omitempty" validate:"readonly"`

	Tags []Tag `json:"tags,omitempty" validate:"readonly"`
}

创建集群时使用的ClusterSpec

type ClusterType

type ClusterType string

ClusterType usually used to init Provider and it represents the difference between IaaS

const (
	// ClusterTypeNormal = 普通类型集群
	ClusterTypeNormal ClusterType = "normal"
)

type ContainerNetworkConfig

type ContainerNetworkConfig struct {
	// CCE 支持网络类型: kubenet 及 vpc-cni
	Mode ContainerNetworkMode `json:"mode,omitempty"` // If not set, set mode = kubenet

	// ENI 网络模式子网
	ENIVPCSubnetIDs    map[AvailableZone][]string `json:"eniVPCSubnetIDs,omitempty"`
	ENISecurityGroupID string                     `json:"eniSecurityGroupID,omitempty"`

	// CCE 支持集群 IP version: dual stack, ipv4 only, ipv6 only
	IPVersion ContainerNetworkIPType `json:"ipVersion,omitempty"` // if not set, set ipv4

	// LB Service 关联 BLB 所在子网, 目前只能为普通子网
	LBServiceVPCSubnetID string `json:"lbServiceVPCSubnetID,omitempty" valid:"Required"`

	// 指定 NodePort Service 的端口范围
	NodePortRangeMin int `json:"nodePortRangeMin,omitempty"`
	NodePortRangeMax int `json:"nodePortRangeMax,omitempty"`

	// 集群 PodIP CIDR, 在 kubenet 网络模式下有效
	ClusterPodCIDR     string `json:"clusterPodCIDR,omitempty"`
	ClusterPodCIDRIPv6 string `json:"clusterPodCIDRIPv6,omitempty"`

	// Service ClusterIP 的 CIDR
	ClusterIPServiceCIDR     string `json:"clusterIPServiceCIDR,omitempty"`
	ClusterIPServiceCIDRIPv6 string `json:"clusterIPServiceCIDRIPv6,omitempty"`

	// 每个 Node 上最大的 Pod 数, 限制 NodeCIDR 的分配
	MaxPodsPerNode int `json:"maxPodsPerNode,omitempty"` // If not set, MaxPodsPerNode = 128

	// KubeProxy 的模式: iptables 和 ipvs
	KubeProxyMode KubeProxyMode `json:"kubeProxyMode,omitempty"` // If not set, kubeProxyMode=ipvs
}

ContainerNetworkConfig defines the network config Some attrs have default value

type ContainerNetworkIPType

type ContainerNetworkIPType string

ContainerNetworkIPType - 容器 IP 类型

const (
	// ContainerNetworkIPTypeIPv4 - 容器网段 IPv4
	ContainerNetworkIPTypeIPv4 ContainerNetworkIPType = "ipv4"
	// ContainerNetworkIPTypeIPv6 - 容器网段 IPv6
	ContainerNetworkIPTypeIPv6 ContainerNetworkIPType = "ipv6"
	// ContainerNetworkIPTypeDualStack - 容器网段双栈
	ContainerNetworkIPTypeDualStack ContainerNetworkIPType = "dualStack"
)

type ContainerNetworkMode

type ContainerNetworkMode string

ContainerNetworkMode defines container config

const (
	// ContainerNetworkModeKubenet using kubenet
	ContainerNetworkModeKubenet ContainerNetworkMode = "kubenet"

	// ContainerNetworkModeVPCCNI using vpc-cni
	ContainerNetworkModeVPCCNI ContainerNetworkMode = "vpc-cni"

	// ContainerNetworkModeVPCRouteVeth using vpc route plus veth
	ContainerNetworkModeVPCRouteVeth ContainerNetworkMode = "vpc-route-veth"

	// ContainerNetworkModeVPCRouteIPVlan using vpc route plus ipvlan
	ContainerNetworkModeVPCRouteIPVlan ContainerNetworkMode = "vpc-route-ipvlan"

	// ContainerNetworkModeVPCRouteAutoDetect using vpc route and auto detects veth or ipvlan due to kernel version
	ContainerNetworkModeVPCRouteAutoDetect ContainerNetworkMode = "vpc-route-auto-detect"

	// ContainerNetworkModeVPCSecondaryIPVeth using vpc secondary ip plus veth
	ContainerNetworkModeVPCSecondaryIPVeth ContainerNetworkMode = "vpc-secondary-ip-veth"

	// ContainerNetworkModeVPCSecondaryIPIPVlan using vpc secondary ip plus ipvlan
	ContainerNetworkModeVPCSecondaryIPIPVlan ContainerNetworkMode = "vpc-secondary-ip-ipvlan"

	// ContainerNetworkModeVPCSecondaryIPAutoDetect using vpc secondary ip and auto detects veth or ipvlan due to kernel version
	ContainerNetworkModeVPCSecondaryIPAutoDetect ContainerNetworkMode = "vpc-secondary-ip-auto-detect"
)

type ContainerdConfig added in v0.9.103

type ContainerdConfig struct {
	DataRoot           string   `json:"dataRoot,omitempty"`           // 自定义 containerd 数据目录
	RegistryMirrors    []string `json:"registryMirrors,omitempty"`    // 自定义 RegistryMirrors
	InsecureRegistries []string `json:"insecureRegistries,omitempty"` // 自定义 InsecureRegistries
}

ContainerdConfig containerd相关配置

type DeleteOption

type DeleteOption struct {
	MoveOut           bool `json:"moveOut,omitempty"`
	DeleteResource    bool `json:"deleteResource,omitempty"`
	DeleteCDSSnapshot bool `json:"deleteCDSSnapshot,omitempty"`
}

DeleteOption 删除节点选项

type DeployCustomConfig

type DeployCustomConfig struct {
	// Docker相关配置
	DockerConfig DockerConfig `json:"dockerConfig,omitempty"`
	// containerd相关配置
	ContainerdConfig ContainerdConfig `json:"containerdConfig,omitempty"`

	// kubelet数据目录
	KubeletRootDir string `json:"kubeletRootDir,omitempty"`
	// 是否开启资源预留
	EnableResourceReserved bool `json:"EnableResourceReserved,omitempty"`
	// k8s进程资源预留配额
	// key:value: cpu: 50m, memory: 100Mi
	KubeReserved map[string]string `json:"kubeReserved,omitempty"`
	// 系统进程资源预留配额
	// key:value: cpu: 50m, memory: 100Mi
	SystemReserved map[string]string `json:"systemReserved,omitempty"`

	// RegistryPullQPS, default: 5
	RegistryPullQPS int `json:"registryPullQPS,omitempty"`
	// RegistryBurst, default: 10
	RegistryBurst int `json:"registryBurst,omitempty"`
	// PodPidsLimit, default: -1
	PodPidsLimit int `json:"podPidsLimit,omitempty"`

	EventRecordQPS *int32 `json:"eventRecordQPS,omitempty"`
	EventBurst     *int32 `json:"eventBurst,omitempty"`
	KubeAPIQPS     *int32 `json:"kubeAPIQPS,omitempty"`   // 自定义 KubeAPIQPS
	KubeAPIBurst   *int32 `json:"kubeAPIBurst,omitempty"` // 自定义 KubeAPIBurst
	MaxPods        *int32 `json:"maxPods,omitempty"`      // 自定义 MaxPods

	// https://kubernetes.io/zh/docs/tasks/administer-cluster/topology-manager/
	CPUManagerPolicy      K8SCPUManagerPolicy      `json:"cpuManagerPolicy,omitempty"`
	TopologyManagerScope  K8STopologyManagerScope  `json:"topologyManagerScope,omitempty"`
	TopologyManagerPolicy K8STopologyManagerPolicy `json:"topologyManagerPolicy,omitempty"`
	CPUCFSQuota           *bool                    `json:"cpuCFSQuota,omitempty"`

	// 是否封锁节点
	EnableCordon bool `json:"enableCordon,omitempty"`

	// 部署前执行脚本, 前端 base64编码后传参
	PreUserScript string `json:"preUserScript,omitempty"`
	// 部署后执行脚本, 前端 base64编码后传参
	PostUserScript string `json:"postUserScript,omitempty"`

	// KubeletBindAddressType, kubelet bind address
	KubeletBindAddressType KubeletBindAddressType `json:"kubeletBindAddressType,omitempty"`

	PostUserScriptFailedAutoCordon bool `json:"postUserScriptFailedAutoCordon,omitempty"`
}

DeployCustomConfig - 部署自定义配置

type Direction

type Direction string
const (
	DirectionIngress Direction = "ingress"
	DirectionEgress  Direction = "egress"
)

type DockerConfig

type DockerConfig struct {
	DockerDataRoot     string   `json:"dockerDataRoot,omitempty"`     // 自定义 docker 数据目录
	RegistryMirrors    []string `json:"registryMirrors,omitempty"`    // 自定义 RegistryMirrors
	InsecureRegistries []string `json:"insecureRegistries,omitempty"` // 自定义 InsecureRegistries
	DockerLogMaxSize   string   `json:"dockerLogMaxSize,omitempty"`   // docker日志大小,default: 20m
	DockerLogMaxFile   string   `json:"dockerLogMaxFile,omitempty"`   // docker日志保留数,default: 10
	BIP                string   `json:"dockerBIP,omitempty"`          // docker0网桥网段, default: 169.254.30.1/28
}

DockerConfig docker相关配置

type EIPOption

type EIPOption struct {
	EIPName         string        `json:"eipName,omitempty"`
	EIPChargingType BillingMethod `json:"eipChargeType,omitempty"`
	EIPPurchaseType PurchaseType  `json:"eipPurchaseType,omitempty" gorm:"column:eip_purchase_type"`
	EIPBandwidth    int           `json:"eipBandwidth,omitempty"`
}

EIPOption 定义 Instance EIP 相关配置

type EphemeralDisk added in v0.9.172

type EphemeralDisk struct {
	StorageType StorageType `json:"storageType,omitempty"`
	SizeInGB    int         `json:"sizeInGB,omitempty"`
}

type EtherType

type EtherType string
const (
	EtherTypeIPv4 EtherType = "IPv4"
	EtherTypeIPv6 EtherType = "IPv6"
)

type ExistedOption

type ExistedOption struct {
	ExistedInstanceID string `json:"existedInstanceID,omitempty"`

	// nil 为默认: 重装系统
	Rebuild *bool `json:"rebuild,omitempty"`
}

ExistedOption 已有实例相关配置

type GPUType

type GPUType string

GPUType GPU 类型

const (
	// GPUTypeV100_32 NVIDIA Tesla V100-32G
	GPUTypeV100_32 GPUType = "V100-32"
	// GPUTypeV100_16 NVIDIA Tesla V100-16G
	GPUTypeV100_16 GPUType = "V100-16"
	// GPUTypeP40 P40 NVIDIA Tesla P40
	GPUTypeP40 GPUType = "P40"
	// GPUTypeP4 P4 NVIDIA Tesla P4
	GPUTypeP4 GPUType = "P4"
	// GPUTypeK40 K40 NVIDIA Tesla K40
	GPUTypeK40 GPUType = "K40"
	// GPUTypeDLCard NVIDIA 深度学习开发卡
	GPUTypeDLCard GPUType = "DLCard"
)

type InstallInfo added in v0.9.171

type InstallInfo struct {
	AllowInstall bool   `json:"allowInstall"`      // 是否允许安装
	Message      string `json:"message,omitempty"` // 原因解释 或是其他想返回给用户的信息
}

type InstanceAnnotations added in v0.9.74

type InstanceAnnotations map[string]string

type InstanceGroupSpec added in v0.9.20

type InstanceGroupSpec struct {
	CCEInstanceGroupID string `json:"cceInstanceGroupID,omitempty" `
	InstanceGroupName  string `json:"instanceGroupName" `

	ClusterID   string      `json:"clusterID,omitempty" `
	ClusterRole ClusterRole `json:"clusterRole,omitempty" `

	Selector *InstanceSelector `json:"selector" `

	ShrinkPolicy ShrinkPolicy `json:"shrinkPolicy,omitempty" `

	UpdatePolicy UpdatePolicy `json:"updatePolicy,omitempty" `

	CleanPolicy CleanPolicy `json:"cleanPolicy,omitempty" `

	InstanceTemplate InstanceTemplate `json:"instanceTemplate" `
	Replicas         int              `json:"replicas" `

	ClusterAutoscalerSpec *ClusterAutoscalerSpec `json:"clusterAutoscalerSpec,omitempty" `
}

type InstanceGroupStatus added in v0.9.20

type InstanceGroupStatus struct {
	ReadyReplicas       int                 `json:"readyReplicas" `
	UndeliveredMachines UndeliveredMachines `json:"undeliveredMachines,omitempty" `
	Pause               *PauseDetail        `json:"pause,omitempty" `
}

type InstanceLabels

type InstanceLabels map[string]string

type InstanceOS

type InstanceOS struct {
	ImageType bccapi.ImageType `json:"imageType,omitempty"` // 镜像类型
	ImageName string           `json:"imageName,omitempty"` // 镜像名字: ubuntu-14.04.1-server-amd64-201506171832
	OSType    OSType           `json:"osType,omitempty"`    // e.g. linux
	OSName    OSName           `json:"osName,omitempty"`    // e.g. Ubuntu
	OSVersion string           `json:"osVersion,omitempty"` // e.g. 14.04.1 LTS
	OSArch    string           `json:"osArch,omitempty"`    // e.g. x86_64 (64bit)
	OSBuild   string           `json:"osBuild,omitempty"`   // e.g. 2015061700
}

InstanceOS defines the OS of BCC

type InstancePhase

type InstancePhase string

InstancePhase CCE InstancePhase

const (
	// InstancePhasePending 创建节点时默认状态
	InstancePhasePending InstancePhase = "pending"

	// InstancePhaseProvisioning IaaS 相关资源正在创建中
	InstancePhaseProvisioning InstancePhase = "provisioning"

	// InstancePhaseProvisioned IaaS 相关资源已经 Ready
	InstancePhaseProvisioned InstancePhase = "provisioned"

	// InstancePhaseRunning 节点运行正常
	InstancePhaseRunning InstancePhase = "running"

	// InstancePhaseCreateFailed 节点异常
	InstancePhaseCreateFailed InstancePhase = "create_failed"

	// InstancePhaseDeleting 节点正在删除
	InstancePhaseDeleting InstancePhase = "deleting"

	// InstancePhaseDeleted 节点删除完成
	InstancePhaseDeleted InstancePhase = "deleted"

	// InstancePhaseDeleteFailed 节点删除失败
	InstancePhaseDeleteFailed InstancePhase = "delete_failed"
)

type InstancePreChargingOption

type InstancePreChargingOption struct {
	PurchaseTime      int    `json:"purchaseTime,omitempty"` //  预付费才生效:单位月,12 = 12 月
	PurchaseTimeUnit  string `json:"purchaseTimeUnit,omitempty"`
	AutoRenew         bool   `json:"autoRenew,omitempty"`         // 是否自动续费
	AutoRenewTimeUnit string `json:"autoRenewTimeUnit,omitempty"` // 续费单位:月
	AutoRenewTime     int    `json:"autoRenewTime,omitempty"`     // 12 = 12 个月
}

InstancePreChargingOption 定义付费相关配置

type InstanceResource

type InstanceResource struct {
	MachineSpec string `json:"machineSpec,omitempty"` // 机器规格,例:bcc.g5.c2m8

	CPU int `json:"cpu,omitempty"` // unit: Core
	MEM int `json:"mem,omitempty"` // unit: GB

	NodeCPUQuota int `json:"nodeCPUQuota,omitempty"` // unit: Core
	NodeMEMQuota int `json:"nodeMEMQuota,omitempty"` // unit: GB

	// RootDisk
	RootDiskType bccapi.StorageType `json:"rootDiskType,omitempty"`
	RootDiskSize int                `json:"rootDiskSize,omitempty"` // unit: GB

	EphemeralDiskList []EphemeralDisk `json:"ephemeralDiskList,omitempty"`

	// GPU 机器必须指定, 其他机器不用
	LocalDiskSize int `json:"localDiskSize,omitempty"` // unit: GB

	// CDS 列表, 默认第一块盘作为 docker 和 kubelet 数据盘
	CDSList CDSConfigList `json:"cdsList,omitempty"`

	// Only necessary when InstanceType = GPU
	GPUType  GPUType `json:"gpuType,omitempty"`
	GPUCount int     `json:"gpuCount,omitempty"`
}

InstanceResource 定义 Instance CPU/MEM/Disk 配置

type InstanceSelector added in v0.9.20

type InstanceSelector struct {
	LabelSelector `json:",inline"`
}

type InstanceSpec

type InstanceSpec struct {

	// 用于 CCE 唯一标识 Instance
	CCEInstanceID string `json:"cceInstanceID,omitempty"`
	InstanceName  string `json:"instanceName"`

	RuntimeType    RuntimeType `json:"runtimeType,omitempty"`
	RuntimeVersion string      `json:"runtimeVersion,omitempty"`

	ClusterID   string      `json:"clusterID,omitempty"`
	ClusterRole ClusterRole `json:"clusterRole,omitempty"`

	InstanceGroupID   string `json:"instanceGroupID,omitempty"`
	InstanceGroupName string `json:"instanceGroupName,omitempty"`

	// 初始化 DelProvider 使用
	MasterType MasterType `json:"masterType,omitempty"`

	// 是否为已有实例
	Existed       bool          `json:"existed,omitempty"`
	ExistedOption ExistedOption `json:"existedOption,omitempty"`

	// BCC, BBC, 裸金属
	MachineType MachineType `json:"machineType,omitempty"`
	// 机器规格: 普通一, 普通二 ...
	InstanceType bccapi.InstanceType `json:"instanceType"`
	// BBC 选项
	BBCOption *BBCOption `json:"bbcOption,omitempty"`

	// 是否为竞价实例
	Bid       bool      `json:"bid,omitempty"`
	BidOption BidOption `json:"bidOption,omitempty"`

	// VPC 相关配置
	VPCConfig VPCConfig `json:"vpcConfig,omitempty"`

	// 集群规格相关配置
	InstanceResource InstanceResource `json:"instanceResource,omitempty"`

	// 优先使用 ImageID, 如果用户传入 InstanceOS 信息, 由 service 计算 ImageID
	ImageID    string     `json:"imageID,omitempty"`
	InstanceOS InstanceOS `json:"instanceOS,omitempty"`

	// 实例自定义数据, 支持安装驱动
	UserData string `json:"userData,omitempty"`

	// EIP
	NeedEIP   bool       `json:"needEIP,omitempty"`
	EIPOption *EIPOption `json:"eipOption,omitempty"`

	// AdminPassword
	AdminPassword string `json:"adminPassword,omitempty"`
	SSHKeyID      string `json:"sshKeyID,omitempty"`

	// Charging Type, 通常只支持后付费
	InstanceChargingType      bccapi.PaymentTimingType  `json:"instanceChargingType,omitempty"` // 后付费或预付费
	InstancePreChargingOption InstancePreChargingOption `json:"instancePreChargingOption,omitempty"`

	// 创建虚机的时候,是否需要绑定虚机的tag到虚机的附加的资源上
	RelationTag bool `json:"relationTag,omitempty"`

	// 删除节点选项
	DeleteOption *DeleteOption `json:"deleteOption,omitempty"`

	DeployCustomConfig DeployCustomConfig `json:"deployCustomConfig,omitempty"` // 部署相关高级配置

	Tags TagList `json:"tags,omitempty"`

	Labels      InstanceLabels      `json:"labels,omitempty"`
	Taints      InstanceTaints      `json:"taints,omitempty"`
	Annotations InstanceAnnotations `json:"annotations,omitempty"`

	CCEInstancePriority int `json:"cceInstancePriority,omitempty"`

	AutoSnapshotID string `json:"autoSnapshotID,omitempty"` // 自动快照策略   ID

	IsOpenHostnameDomain bool `json:"isOpenHostnameDomain,omitempty"`
}

InstanceSpec 已有节点需要用户提供:ClusterRole 、短ID,密码,镜像ID,镜像类型, docker storage(可选); BBC要额外加preservedData、raidId、sysRootSize

type InstanceTaints

type InstanceTaints []Taint

type InstanceTemplate added in v0.9.20

type InstanceTemplate struct {
	InstanceSpec `json:",inline"`
}

type K8SCPUManagerPolicy added in v0.9.172

type K8SCPUManagerPolicy string

K8SCPUManagerPolicy - K8S CPUManagerPolicy

const (
	// K8SCPUManagerPolicyNone - none
	K8SCPUManagerPolicyNone K8SCPUManagerPolicy = "none"

	// K8SCPUManagerPolicyStatic - static
	K8SCPUManagerPolicyStatic K8SCPUManagerPolicy = "static"
)

type K8SCustomConfig added in v0.9.20

type K8SCustomConfig struct {
	MasterFeatureGates  map[string]bool `json:"masterFeatureGates,omitempty"`  // 自定义 FeatureGates
	NodeFeatureGates    map[string]bool `json:"nodeFeatureGates,omitempty"`    // 自定义 FeatureGates
	AdmissionPlugins    []string        `json:"admissionPlugins,omitempty"`    // 自定义 AdmissionPlugins
	PauseImage          string          `json:"pauseImage,omitempty"`          // 自定义 PauseImage
	KubeAPIQPS          int             `json:"kubeAPIQPS,omitempty"`          // 自定义 KubeAPIQPS
	KubeAPIBurst        int             `json:"kubeAPIBurst,omitempty"`        // 自定义 KubeAPIBurst
	SchedulerPredicates []string        `json:"schedulerPredicates,omitempty"` // 自定义 SchedulerPredicates
	SchedulerPriorities map[string]int  `json:"schedulerPriorities,omitempty"` // 自定义 SchedulerPriorities
	ETCDDataPath        string          `json:"etcdDataPath,omitempty"`        // 自定义 etcd数据目录
}

K8SCustomConfig - K8S 自定义配置

type K8STopologyManagerPolicy added in v0.9.172

type K8STopologyManagerPolicy string

K8STopologyManagerPolicy - K8S topologyManagerPolicy

const (
	// K8STopologyManagerPolicyNone - none
	K8STopologyManagerPolicyNone K8STopologyManagerPolicy = "none"

	// K8STopologyManagerPolicyBestEffort - best-effort
	K8STopologyManagerPolicyBestEffort K8STopologyManagerPolicy = "best-effort"

	// K8STopologyManagerPolicyRestricted - restricted
	K8STopologyManagerPolicyRestricted K8STopologyManagerPolicy = "restricted"

	// K8STopologyManagerPolicySingleNumaNode - single-numa-node
	K8STopologyManagerPolicySingleNumaNode K8STopologyManagerPolicy = "single-numa-node"
)

type K8STopologyManagerScope added in v0.9.172

type K8STopologyManagerScope string

K8STopologyManagerScope - K8S topologyManagerScope

const (
	// K8STopologyManagerScopePod - pod
	K8STopologyManagerScopePod K8STopologyManagerScope = "pod"

	// K8STopologyManagerScopeContainer - container
	K8STopologyManagerScopeContainer K8STopologyManagerScope = "container"
)

type K8SVersion

type K8SVersion string

K8SVersion defines the k8stypes version of cluster

const (
	// 1.6和1.8不再支持,扩缩容需要联系CCE人员手动操作
	// K8S_1_6_2   K8SVersion = "1.6.2"
	// K8S_1_8_6   K8SVersion = "1.8.6"
	// K8S_1_8_12  K8SVersion = "1.8.12"
	// 1.11.1 1.11.5 1.13.4仅支持已有集群扩容节点,不支持新创建集群
	// K8S_1_11_1  K8SVersion = "1.11.1"
	// K8S_1_11_5  K8SVersion = "1.11.5"
	// K8S_1_13_4  K8SVersion = "1.13.4"
	// 支持在console创建集群
	// K8S_1_13_10 K8SVersion = "1.13.10"
	// K8S_1_16_3  K8SVersion = "1.16.3"
	// K8S_1_16_8  K8SVersion = "1.16.8"
	// K8S_1_17_17 K8SVersion = "1.17.17"
	K8S_1_18_9  K8SVersion = "1.18.9"
	K8S_1_20_8  K8SVersion = "1.20.8"
	K8S_1_21_14 K8SVersion = "1.21.14"
	K8S_1_22_5  K8SVersion = "1.22.5"
	K8S_1_24_4  K8SVersion = "1.24.4"
	K8S_1_26_9  K8SVersion = "1.26.9"
)

type KubeProxyMode

type KubeProxyMode string

KubeProxyMode defines kube-proxy --proxy-mode If not set, using KubeProxyModeIPVS as default

const (
	// KubeProxyModeIPVS --proxy-mode=ipvs
	KubeProxyModeIPVS KubeProxyMode = "ipvs"

	// KubeProxyModeIptables --proxy-mode=iptables
	KubeProxyModeIptables KubeProxyMode = "iptables"
)

type KubeletBindAddressType added in v0.9.103

type KubeletBindAddressType string

KubeletBindAddressType - kubelet bind address 类型

const (
	// KubeletBindAddressTypeAll - 0.0.0.0
	KubeletBindAddressTypeAll KubeletBindAddressType = "all"

	// KubeletBindAddressTypeLocal - 127.0.0.1
	KubeletBindAddressTypeLocal KubeletBindAddressType = "local"

	// KubeletBindAddressTypeHostIP - 主网卡 IP
	KubeletBindAddressTypeHostIP KubeletBindAddressType = "hostip"
)

type LabelSelector added in v0.9.20

type LabelSelector struct {
	MatchLabels      map[string]string          `json:"matchLabels,omitempty" protobuf:"bytes,1,rep,name=matchLabels"`
	MatchExpressions []LabelSelectorRequirement `json:"matchExpressions,omitempty" protobuf:"bytes,2,rep,name=matchExpressions"`
}

type LabelSelectorOperator added in v0.9.20

type LabelSelectorOperator string
const (
	LabelSelectorOpIn           LabelSelectorOperator = "In"
	LabelSelectorOpNotIn        LabelSelectorOperator = "NotIn"
	LabelSelectorOpExists       LabelSelectorOperator = "Exists"
	LabelSelectorOpDoesNotExist LabelSelectorOperator = "DoesNotExist"
)

type LabelSelectorRequirement added in v0.9.20

type LabelSelectorRequirement struct {
	Key      string                `json:"key" patchStrategy:"merge" patchMergeKey:"key" protobuf:"bytes,1,opt,name=key"`
	Operator LabelSelectorOperator `json:"operator" protobuf:"bytes,2,opt,name=operator,casttype=LabelSelectorOperator"`
	Values   []string              `json:"values,omitempty" protobuf:"bytes,3,rep,name=values"`
}

type MachineType

type MachineType string

MachineType 机器类型: BCC, BBC

const (
	// MachineTypeBCC 机器类型 BCC
	MachineTypeBCC MachineType = "BCC"

	// MachineTypeBBC 机器类型 BBC
	MachineTypeBBC MachineType = "BBC"

	// MachineTypeEBC 机器类型 EBC
	MachineTypeEBC MachineType = "EBC"
)

type ManagedClusterMasterOption

type ManagedClusterMasterOption struct {
	MasterVPCSubnetZone AvailableZone `json:"masterVPCSubnetZone,omitempty"`
}

ManagedClusterMasterOption 托管集群 Master 配置

type MasterConfig

type MasterConfig struct {
	// MasterTypes: 托管, 自定义, 已有 BCC, 已有 BBC
	MasterType MasterType `json:"masterType,omitempty"`

	// ClusterHA 对 3 种集群都有效: 对于 Custom 和 Existed 作为校验和展示作用
	ClusterHA ClusterHA `json:"clusterHA,omitempty"`

	ExposedPublic bool `json:"exposedPublic,omitempty"`

	ClusterBLBVPCSubnetID string `json:"clusterBLBVPCSubnetID,omitempty"`

	ManagedClusterMasterOption `json:"managedClusterMasterOption,omitempty"`
}

MasterConfig Master 配置

type MasterType

type MasterType string

MasterType 定义 Master 机器来源

const (
	// MasterTypeManaged 托管 Master
	MasterTypeManaged MasterType = "managed"

	// MasterTypeCustom 自定义集群, 包含:
	// 1. 新建 BCC;
	// 2. 已有 BCC;
	// 3. 已有 BBC.
	MasterTypeCustom MasterType = "custom"

	// MasterTypeServerless Serverless集群Master
	MasterTypeServerless MasterType = "serverless"
)

type Meta added in v0.9.171

type Meta struct {
	// 组件名称
	Name string `json:"name,omitempty"`

	// 组件所述的类型: AI/网络 等
	Type AddOnType `json:"type,omitempty"`

	//是否是托管组件
	Managed bool `json:"managed,omitempty"`

	//是否是系统组件
	Required bool `json:"required,omitempty"`

	// 组件的最新版本
	LatestVersion string `json:"latestVersion,omitempty"`

	LatestImageTag string `json:"latestImageTag,omitempty"`

	// 组件简要介绍 一句话介绍
	ShortIntroduction string `json:"shortIntroduction,omitempty"`

	// 组件的详细介绍
	DetailIntroduction string `json:"detailIntroduction,omitempty"`

	// 默认参数 用户可在此基础上编辑
	DefaultParams string `json:"defaultParams,omitempty"`

	// 集群是否满足组件安装条件
	InstallInfo InstallInfo `json:"installInfo,omitempty"`
}

Meta 表示集群中某个组件的元信息 包括组件名称、类型、最新版本、简介与详细介绍、默认参数

type MountConfig

type MountConfig struct {
	Path        string             `json:"diskPath,omitempty"` // "/data"
	CDSID       string             `json:"cdsID,omitempty"`
	Device      string             `json:"device,omitempty"` // "/dev/vdb"
	CDSSize     int                `json:"cdsSize,omitempty"`
	StorageType bccapi.StorageType `json:"storageType,omitempty"`
}

MountConfig - 磁盘挂载信息

type OSName

type OSName string

OSName 操作系统名字

const (
	// OSNameCentOS centos
	OSNameCentOS OSName = "CentOS"
	// OSNameUbuntu ubuntu
	OSNameUbuntu OSName = "Ubuntu"
	// OSNameWindows windows
	OSNameWindows OSName = "Windows Server"
	// OSNameDebian debian
	OSNameDebian OSName = "Debian"
	// OSNameOpensuse opensuse
	OSNameOpensuse OSName = "opensuse"
)

type OSType

type OSType string

OSType 操作系统类型

const (
	// OSTypeLinux linux
	OSTypeLinux OSType = "linux"
	// OSTypeWindows windows
	OSTypeWindows OSType = "windows"
)

type PauseDetail added in v0.9.20

type PauseDetail struct {
	Paused bool   `json:"paused"`
	Reason string `json:"reason"`
}

type PaymentTiming

type PaymentTiming string

PaymentTiming 付费时间选择

const (
	// PaymentTimingPrepaid 预付费
	PaymentTimingPrepaid PaymentTiming = "Prepaid"
	// PaymentTimingPostpaid 后付费
	PaymentTimingPostpaid PaymentTiming = "Postpaid"
)

type PluginHelmConfig added in v0.9.168

type PluginHelmConfig struct {
	// 插件类型(插件名称) 非必要 用户要部署的是哪个插件,传空时和PluginName保持一致
	PluginType string `json:"pluginType,omitempty"`

	// 插件别名 非必要 有时用户是可以自定义部署的插件名称的 (如多个 NGINX Ingress Controller 场景) 所以不能用PluginName来判断用户部署的是什么插件
	PluginName string `json:"pluginName,omitempty"`

	// 插件在云端的ChartName是什么 用户无需传递这个值
	ChartName string `json:"chartName,omitempty"`

	// 使用的Chart版本 除非用户要指定版本否则无需传递此值
	ChartVersion string `json:"chartVersion,omitempty"`

	// 插件部署到哪个命名空间  非必要
	Namespaces string `json:"namespaces,omitempty"`

	// 非必要
	Description string `json:"description,omitempty"`

	// 取决于插件 系统插件传空值即可
	Values string `json:"values,omitempty"`
}

PluginHelmConfig 使用 Helm 部署插件的插件的参数

type Protocol

type Protocol string
const (
	ProtocolAll  Protocol = "all"
	ProtocolTCP  Protocol = "tcp"
	ProtocolUDP  Protocol = "udp"
	ProtocolICMP Protocol = "icmp"
)

type PurchaseType added in v0.9.172

type PurchaseType string
const (
	// EIPPurchaseTypeBGP 标准型BGP
	EIPPurchaseTypeBGP PurchaseType = "BGP"
	// EIPPurchaseTypeBGP_S 增强型BGP
	EIPPurchaseTypeBGP_S PurchaseType = "BGP_S"
	// EIPPurchaseTypeChinaTelcom  电信单线
	EIPPurchaseTypeChinaTelcom PurchaseType = "ChinaTelcom"
	// EIPPurchaseTypeChinaUnicom  联通单线
	EIPPurchaseTypeChinaUnicom PurchaseType = "ChinaUnicom"
	// EIPPurchaseTypeChinaMobile  移动单线
	EIPPurchaseTypeChinaMobile PurchaseType = "ChinaMobile"
)

type Quota

type Quota struct {
	Quota int `json:"quota"`
	Used  int `json:"used"`
}

Quota - CCE Cluster/Node Quota

type ResourceChargingOption added in v0.9.168

type ResourceChargingOption struct {
	ChargingType      PaymentTiming `json:"chargingType,omitempty"`      // 后付费或预付费
	PurchaseTime      int           `json:"purchaseTime,omitempty"`      // 预付费才生效:单位月,12 = 12 月
	PurchaseTimeUnit  string        `json:"purchaseTimeUnit,omitempty"`  // 预付费时间单位
	AutoRenew         bool          `json:"autoRenew,omitempty"`         // 是否自动续费
	AutoRenewTime     int           `json:"autoRenewTime,omitempty"`     // 12 = 12 个月
	AutoRenewTimeUnit string        `json:"autoRenewTimeUnit,omitempty"` // 续费单位:月
}

ResourceChargingOption 定义IaaS资源付费配置

type RollbackInfo added in v0.9.171

type RollbackInfo struct {
	AllowRollback bool   `json:"allowRollback"`     // 是否允许回滚
	Message       string `json:"message,omitempty"` // 原因解释 或是其他想返回给用户的信息
}

type RuntimeType

type RuntimeType string

RuntimeType defines the runtime on each node

const (
	RuntimeTypeDocker     RuntimeType = "docker"
	RuntimeTypeContainerd RuntimeType = "containerd"
)

type SecurityGroup added in v0.9.134

type SecurityGroup struct {
	// 是否附加 CCE 必须安全组
	EnableCCERequiredSecurityGroup bool `json:"enableCCERequiredSecurityGroup"`
	// 是否附加 CCE 可选安全组
	EnableCCEOptionalSecurityGroup bool `json:"enableCCEOptionalSecurityGroup"`
	// 用户自定义安全组 ID 列表
	CustomSecurityGroupIDs []string `json:"customSecurityGroups,omitempty"`
}

SecurityGroup 定义 Instance 安全组配置

type SecurityGroupRule

type SecurityGroupRule struct {
	SecurityGroupID string    `json:"securityGroupId"`
	EtherType       EtherType `json:"ethertype"`
	Direction       Direction `json:"direction"`
	Protocol        Protocol  `json:"protocol"`
	SourceGroupID   string    `json:"sourceGroupId"`
	SourceIP        string    `json:"sourceIp"`
	DestGroupID     string    `json:"destGroupId"`
	DestIP          string    `json:"destIp"`
	PortRange       string    `json:"portRange"`
	Remark          string    `json:"remark"`
}

SecurityGroupRule 安全组规则

type ServerStatus

type ServerStatus string

ServerStatus BCC 虚机状态

const (
	// ServerStatusActive 虚机运行中
	ServerStatusActive ServerStatus = "ACTIVE"

	// ServerStatusBuild 虚机创建中
	ServerStatusBuild ServerStatus = "BUILD"

	// ServerStatusRebuild 虚机重装系统中
	ServerStatusRebuild ServerStatus = "REBUILD"

	// ServerStatusDeleted 虚机已删除
	ServerStatusDeleted ServerStatus = "DELETED"

	// ServerStatusSnapshot 创建快照
	ServerStatusSnapshot ServerStatus = "SNAPSHOT"

	// ServerStatusDeleteSnapshot 删除快照
	ServerStatusDeleteSnapshot ServerStatus = "DELETE_SNAPSHOT"

	// ServerStatusVolumeResize VOLUME_RESIZE
	ServerStatusVolumeResize ServerStatus = "VOLUME_RESIZE"

	// ServerStatusError 虚机异常
	ServerStatusError ServerStatus = "ERROR"

	// ServerStatusExpired 虚机欠费释放
	ServerStatusExpired ServerStatus = "EXPIRED"

	// ServerStatusReboot 虚机重启
	ServerStatusReboot ServerStatus = "REBOOT"

	// ServerStatusRecharge 虚机续费
	ServerStatusRecharge ServerStatus = "RECHARGE"

	// ServerStatusShutoff 虚机关机
	ServerStatusShutoff ServerStatus = "SHUTOFF"

	// ServerStatusStopped 虚机关机
	ServerStatusStopped ServerStatus = "STOPPED"

	// ServerStatusUnknown 虚机状态未知
	ServerStatusUnknown ServerStatus = "UNKNOWN"
)

type ShrinkPolicy added in v0.9.20

type ShrinkPolicy string

type StorageType added in v0.9.172

type StorageType string

StorageType 存储类型

const (
	// StorageTypeSTD1 上一代云磁盘
	StorageTypeSTD1 StorageType = "sata"

	// StorageTypeHP1 高性能型
	StorageTypeHP1 StorageType = "ssd"

	// StorageTypeCloudHP1 SSD 型
	StorageTypeCloudHP1 StorageType = "premium_ssd"

	StorageTypeNNME StorageType = "nvme"

	// StorageTypeHDD 普通型
	StorageTypeHDD StorageType = "hdd"

	// StorageTypeLocal 本地盘
	StorageTypeLocal StorageType = "local"

	// StorageTypeDCCSATA Sata 盘, 创建 DCC 实例专用
	StorageTypeDCCSATA StorageType = "SATA"

	// StorageTypeDCCSSD SSD 盘, 创建 DCC 实例专用
	StorageTypeDCCSSD StorageType = "SSD"

	// StorageTypeEnhancedSSD 增强型SSD
	StorageTypeEnhancedSSD = "enhanced_ssd_pl1"
)

type Tag

type Tag struct {
	TagKey   string `json:"tagKey"`
	TagValue string `json:"tagValue"`
}

Tag represents TagModel in BCE

type TagList

type TagList []Tag

type Taint

type Taint struct {
	// Required. The taint key to be applied to a node.
	Key string `json:"key" protobuf:"bytes,1,opt,name=key"`
	// Required. The taint value corresponding to the taint key.
	// +optional
	Value string `json:"value,omitempty" protobuf:"bytes,2,opt,name=value"`
	// Required. The effect of the taint on pods
	// that do not tolerate the taint.
	// Valid effects are NoSchedule, PreferNoSchedule and NoExecute.
	Effect TaintEffect `json:"effect" protobuf:"bytes,3,opt,name=effect,casttype=TaintEffect"`
	// TimeAdded represents the time at which the taint was added.
	// It is only written for NoExecute taints.
	// +optional
	TimeAdded *Time `json:"timeAdded,omitempty" protobuf:"bytes,4,opt,name=timeAdded"`
}

The node this Taint is attached to has the "effect" on any pod that does not tolerate the Taint.

type TaintEffect

type TaintEffect string
const (
	// Do not allow new pods to schedule onto the node unless they tolerate the taint,
	// but allow all pods submitted to Kubelet without going through the scheduler
	// to start, and allow all already-running pods to continue running.
	// Enforced by the scheduler.
	TaintEffectNoSchedule TaintEffect = "NoSchedule"

	// Like TaintEffectNoSchedule, but the scheduler tries not to schedule
	// new pods onto the node, rather than prohibiting new pods from scheduling
	// onto the node entirely. Enforced by the scheduler.
	TaintEffectPreferNoSchedule TaintEffect = "PreferNoSchedule"

	// Evict any already-running pods that do not tolerate the taint.
	// Currently enforced by NodeController.
	TaintEffectNoExecute TaintEffect = "NoExecute"
)

type Task added in v0.9.76

type Task struct {
	ID          string     `json:"id"`
	Type        TaskType   `json:"type"`
	Description string     `json:"description"`
	StartTime   time.Time  `json:"startTime"`
	FinishTime  *time.Time `json:"finishTime,omitempty"`
	Phase       TaskPhase  `json:"phase"`

	TaskProcesses []TaskProcess `json:"processes,omitempty"`
	ErrMessage    string        `json:"errMessage,omitempty"`
}

type TaskPhase added in v0.9.76

type TaskPhase string
const (
	TaskPhasePending    TaskPhase = "Pending"
	TaskPhaseProcessing TaskPhase = "Processing"
	TaskPhaseDone       TaskPhase = "Done"
	TaskPhaseAborted    TaskPhase = "Aborted"
)

type TaskProcess added in v0.9.76

type TaskProcess struct {
	Name       string           `json:"name"`
	Phase      TaskProcessPhase `json:"phase,omitempty"`
	StartTime  *time.Time       `json:"startTime,omitempty"`
	FinishTime *time.Time       `json:"finishTime,omitempty"`

	Metrics      map[string]string `json:"metrics,omitempty"`
	SubProcesses []TaskProcess     `json:"subProcesses,omitempty"`
	ErrMessage   string            `json:"errMessage,omitempty"`
}

type TaskProcessPhase added in v0.9.76

type TaskProcessPhase string
const (
	TaskProcessPhasePending    TaskProcessPhase = "Pending"
	TaskProcessPhaseProcessing TaskProcessPhase = "Processing"
	TaskProcessPhaseDone       TaskProcessPhase = "Done"
	TaskProcessPhaseAborted    TaskProcessPhase = "Aborted"
)

type TaskType added in v0.9.76

type TaskType string
const (
	TaskTypeInstanceGroupReplicas TaskType = "InstanceGroupReplicas"
)

type Time

type Time struct {
	time.Time `protobuf:"-"`
}

Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.

+protobuf.options.marshal=false +protobuf.as=Timestamp +protobuf.options.(gogoproto.goproto_stringer)=false

func Date

func Date(year int, month time.Month, day, hour, min, sec, nsec int, loc *time.Location) Time

Date returns the Time corresponding to the supplied parameters by wrapping time.Date.

func NewTime

func NewTime(time time.Time) Time

NewTime returns a wrapped instance of the provided time

func Now

func Now() Time

Now returns the current local time.

func Unix

func Unix(sec int64, nsec int64) Time

Unix returns the local time corresponding to the given Unix time by wrapping time.Unix.

func (*Time) Before

func (t *Time) Before(u *Time) bool

Before reports whether the time instant t is before u.

func (*Time) DeepCopyInto

func (t *Time) DeepCopyInto(out *Time)

DeepCopyInto creates a deep-copy of the Time value. The underlying time.Time type is effectively immutable in the time API, so it is safe to copy-by-assign, despite the presence of (unexported) Pointer fields.

func (*Time) Equal

func (t *Time) Equal(u *Time) bool

Equal reports whether the time instant t is equal to u.

func (*Time) IsZero

func (t *Time) IsZero() bool

IsZero returns true if the value is nil or time is zero.

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Time) MarshalQueryParameter

func (t Time) MarshalQueryParameter() (string, error)

MarshalQueryParameter converts to a URL query parameter value

func (Time) OpenAPISchemaFormat

func (_ Time) OpenAPISchemaFormat() string

OpenAPISchemaFormat is used by the kube-openapi generator when constructing the OpenAPI spec of this type.

func (Time) OpenAPISchemaType

func (_ Time) OpenAPISchemaType() []string

OpenAPISchemaType is used by the kube-openapi generator when constructing the OpenAPI spec of this type.

See: https://github.com/kubernetes/kube-openapi/tree/master/pkg/generators

func (Time) Rfc3339Copy

func (t Time) Rfc3339Copy() Time

Rfc3339Copy returns a copy of the Time at second-level precision.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the json.Unmarshaller interface.

func (*Time) UnmarshalQueryParameter

func (t *Time) UnmarshalQueryParameter(str string) error

UnmarshalQueryParameter converts from a URL query parameter value to an object

type UndeliveredMachines added in v0.9.20

type UndeliveredMachines struct {
	FailedMachines  []string `json:"failedMachines,omitempty"`
	PendingMachines []string `json:"pendingMachines,omitempty"`
}

type UninstallInfo added in v0.9.171

type UninstallInfo struct {
	AllowUninstall bool   `json:"allowUninstall"`    // 是否允许卸载
	Message        string `json:"message,omitempty"` // 原因解释 或是其他想返回给用户的信息
}

type UpdateInfo added in v0.9.171

type UpdateInfo struct {
	AllowUpdate bool   `json:"allowUpdate"`       // 是否允许更新参数
	Message     string `json:"message,omitempty"` // 原因解释 或是其他想返回给用户的信息
}

type UpdatePolicy added in v0.9.20

type UpdatePolicy string

type UpgradeInfo added in v0.9.171

type UpgradeInfo struct {
	AllowUpgrade bool   `json:"allowUpgrade"`      // 是否允许升级
	NextVersion  string `json:"nextVersion"`       // 若允许升级 升级到哪个版本
	Message      string `json:"message,omitempty"` // 原因解释 或是其他想返回给用户的信息
}

type VPCConfig

type VPCConfig struct {
	VPCID           string `json:"vpcID,omitempty"`
	VPCSubnetID     string `json:"vpcSubnetID,omitempty"`
	SecurityGroupID string `json:"securityGroupID,omitempty"`

	VPCSubnetType     vpc.SubnetType `json:"vpcSubnetType,omitempty"`
	VPCSubnetCIDR     string         `json:"vpcSubnetCIDR,omitempty"`
	VPCSubnetCIDRIPv6 string         `json:"vpcSubnetCIDRIPv6,omitempty"`

	AvailableZone AvailableZone `json:"availableZone,omitempty"`

	SecurityGroup SecurityGroup `json:"securityGroup,omitempty"`

	SecurityGroupType string `json:"securityGroupType"`
}

VPCConfig 定义 Instance VPC

Jump to

Keyboard shortcuts

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