Documentation
¶
Overview ¶
Package uk8s include resources of ucloud uk8s product
See also
- API: https://docs.ucloud.cn/api/uk8s-api/index
- Product: https://www.ucloud.cn/site/product/uk8s.html
for detail.
Index ¶
- type AddUK8SExistingUHostRequest
- type AddUK8SExistingUHostResponse
- type AddUK8SNodeGroupRequest
- type AddUK8SNodeGroupResponse
- type AddUK8SPHostNodeRequest
- type AddUK8SPHostNodeResponse
- type AddUK8SUHostNodeRequest
- type AddUK8SUHostNodeResponse
- type ClusterSet
- type CreateUK8SClusterV2ParamKubeProxy
- type CreateUK8SClusterV2ParamMaster
- type CreateUK8SClusterV2ParamNodes
- type CreateUK8SClusterV2Request
- type CreateUK8SClusterV2Response
- type DelUK8SClusterNodeV2Request
- type DelUK8SClusterNodeV2Response
- type DelUK8SClusterRequest
- type DelUK8SClusterResponse
- type DescribeUK8SClusterRequest
- type DescribeUK8SClusterResponse
- type DescribeUK8SImageRequest
- type DescribeUK8SImageResponse
- type DescribeUK8SNodeRequest
- type DescribeUK8SNodeResponse
- type DiskSet
- type IPSet
- type ImageInfo
- type K8SNodeCondition
- type KubeProxy
- type ListUK8SClusterNodeV2Request
- type ListUK8SClusterNodeV2Response
- type ListUK8SClusterV2Request
- type ListUK8SClusterV2Response
- type ListUK8SNodeGroupRequest
- type ListUK8SNodeGroupResponse
- type NodeGroupSet
- type NodeInfoV2
- type RemoveUK8SNodeGroupRequest
- type RemoveUK8SNodeGroupResponse
- type UHostIPSet
- type UK8SClient
- func (c *UK8SClient) AddUK8SExistingUHost(req *AddUK8SExistingUHostRequest) (*AddUK8SExistingUHostResponse, error)
- func (c *UK8SClient) AddUK8SNodeGroup(req *AddUK8SNodeGroupRequest) (*AddUK8SNodeGroupResponse, error)
- func (c *UK8SClient) AddUK8SPHostNode(req *AddUK8SPHostNodeRequest) (*AddUK8SPHostNodeResponse, error)
- func (c *UK8SClient) AddUK8SUHostNode(req *AddUK8SUHostNodeRequest) (*AddUK8SUHostNodeResponse, error)
- func (c *UK8SClient) CreateUK8SClusterV2(req *CreateUK8SClusterV2Request) (*CreateUK8SClusterV2Response, error)
- func (c *UK8SClient) DelUK8SCluster(req *DelUK8SClusterRequest) (*DelUK8SClusterResponse, error)
- func (c *UK8SClient) DelUK8SClusterNodeV2(req *DelUK8SClusterNodeV2Request) (*DelUK8SClusterNodeV2Response, error)
- func (c *UK8SClient) DescribeUK8SCluster(req *DescribeUK8SClusterRequest) (*DescribeUK8SClusterResponse, error)
- func (c *UK8SClient) DescribeUK8SImage(req *DescribeUK8SImageRequest) (*DescribeUK8SImageResponse, error)
- func (c *UK8SClient) DescribeUK8SNode(req *DescribeUK8SNodeRequest) (*DescribeUK8SNodeResponse, error)
- func (c *UK8SClient) ListUK8SClusterNodeV2(req *ListUK8SClusterNodeV2Request) (*ListUK8SClusterNodeV2Response, error)
- func (c *UK8SClient) ListUK8SClusterV2(req *ListUK8SClusterV2Request) (*ListUK8SClusterV2Response, error)
- func (c *UK8SClient) ListUK8SNodeGroup(req *ListUK8SNodeGroupRequest) (*ListUK8SNodeGroupResponse, error)
- func (c *UK8SClient) NewAddUK8SExistingUHostRequest() *AddUK8SExistingUHostRequest
- func (c *UK8SClient) NewAddUK8SNodeGroupRequest() *AddUK8SNodeGroupRequest
- func (c *UK8SClient) NewAddUK8SPHostNodeRequest() *AddUK8SPHostNodeRequest
- func (c *UK8SClient) NewAddUK8SUHostNodeRequest() *AddUK8SUHostNodeRequest
- func (c *UK8SClient) NewCreateUK8SClusterV2Request() *CreateUK8SClusterV2Request
- func (c *UK8SClient) NewDelUK8SClusterNodeV2Request() *DelUK8SClusterNodeV2Request
- func (c *UK8SClient) NewDelUK8SClusterRequest() *DelUK8SClusterRequest
- func (c *UK8SClient) NewDescribeUK8SClusterRequest() *DescribeUK8SClusterRequest
- func (c *UK8SClient) NewDescribeUK8SImageRequest() *DescribeUK8SImageRequest
- func (c *UK8SClient) NewDescribeUK8SNodeRequest() *DescribeUK8SNodeRequest
- func (c *UK8SClient) NewListUK8SClusterNodeV2Request() *ListUK8SClusterNodeV2Request
- func (c *UK8SClient) NewListUK8SClusterV2Request() *ListUK8SClusterV2Request
- func (c *UK8SClient) NewListUK8SNodeGroupRequest() *ListUK8SNodeGroupRequest
- func (c *UK8SClient) NewRemoveUK8SNodeGroupRequest() *RemoveUK8SNodeGroupRequest
- func (c *UK8SClient) RemoveUK8SNodeGroup(req *RemoveUK8SNodeGroupRequest) (*RemoveUK8SNodeGroupResponse, error)
- type UhostInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddUK8SExistingUHostRequest ¶
type AddUK8SExistingUHostRequest struct {
request.CommonBase
// UK8S集群ID。 可从UK8S控制台获取。
ClusterId *string `required:"true"`
// 用于标示添加完节点后是否将节点临时禁用. 传入 "true" 表示禁用,传入其它或不传表示不禁用
DisableSchedule *bool `required:"false"`
// 镜像 Id,不填时后台程序会自动选用一个可用的镜像 Id,支持用户自定义镜像,自定义镜像必须基于基础镜像制作。
ImageId *string `required:"false"`
// 用户自定义Shell脚本。与UserData的区别在于InitScript在节点初始化完毕后才执行,UserData则是云主机初始化时执行。
InitScript *string `required:"false"`
// Node节点标签。key=value形式,多组用”,“隔开,最多5组。 如env=pro,type=game
Labels *string `required:"false"`
// 默认110,生产环境建议小于等于110。
MaxPods *int `required:"false"`
// Node节点密码。请遵照[[api:uhost-api:specification|字段规范]]设定密码。密码需使用base64进行编码,如下:# echo -n Password1 | base64
Password *string `required:"true"`
// 该云主机所属子网Id。
SubnetId *string `required:"false"`
// 云主机Id,为了保证节点正常运行,该主机配置不得低于2C4G。
UHostId *string `required:"true"`
// 用户自定义数据。当镜像支持Cloud-init Feature时可填写此字段。注意:1、总数据量大小不超过 16K;2、使用base64编码。
UserData *string `required:"false"`
}
AddUK8SExistingUHostRequest is request schema for AddUK8SExistingUHost action
type AddUK8SExistingUHostResponse ¶
type AddUK8SExistingUHostResponse struct {
response.CommonBase
// 返回错误消息,当 RetCode 非 0 时提供详细的描述信息。
Message string
}
AddUK8SExistingUHostResponse is response schema for AddUK8SExistingUHost action
type AddUK8SNodeGroupRequest ¶ added in v0.21.31
type AddUK8SNodeGroupRequest struct {
request.CommonBase
// 磁盘类型
BootDiskType *string `required:"false"`
// GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
CPU *int `required:"false"`
// 计费模式
ChargeType *string `required:"false"`
// 集群ID
ClusterId *string `required:"true"`
// 数据磁盘大小
DataDiskSize *int `required:"false"`
// 磁盘类型
DataDiskType *string `required:"false"`
// GPU卡核心数
GPU *int `required:"false"`
// GPU类型
GpuType *string `required:"false"`
// 镜像ID
ImageId *string `required:"false"`
// 云主机机型。枚举值["N", "C", "G", "O", "OS"]。参考[[api:uhost-api:uhost_type|云主机机型说明]]。
MachineType *string `required:"false"`
// 内存大小。单位:MB
Mem *int `required:"false"`
// 最低cpu平台,枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake";"Intel/CascadelakeR"; “Amd/Epyc2”,"Amd/Auto"],默认值是"Intel/Auto"
MinimalCpuPlatform *string `required:"false"`
// 节点池名字
NodeGroupName *string `required:"true"`
// 业务组
Tag *string `required:"false"`
}
AddUK8SNodeGroupRequest is request schema for AddUK8SNodeGroup action
type AddUK8SNodeGroupResponse ¶ added in v0.21.31
type AddUK8SNodeGroupResponse struct {
response.CommonBase
// 返回错误消息,当 RetCode 非 0 时提供详细的描述信息。
Message string
// 节点池ID
NodeGroupId string
}
AddUK8SNodeGroupResponse is response schema for AddUK8SNodeGroup action
type AddUK8SPHostNodeRequest ¶
type AddUK8SPHostNodeRequest struct {
request.CommonBase
// 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ 默认为月付
ChargeType *string `required:"true"`
// UK8S集群ID。 可从UK8S控制台获取。
ClusterId *string `required:"true"`
// 最大创建Node节点数量,取值范围是[1,10]。
Count *int `required:"true"`
// 用于标示添加完节点后是否将节点临时禁用. 传入 "true" 表示禁用,传入其它或不传表示不禁用
DisableSchedule *bool `required:"false"`
// 镜像 Id,不填时后台程序会自动选用一个可用的镜像 Id,支持用户自定义镜像,自定义镜像必须基于基础镜像制作。
ImageId *string `required:"false"`
// 用户自定义Shell脚本。与UserData的区别在于InitScript在节点初始化完毕后才执行。
InitScript *string `required:"false"`
// Node节点标签。key=value形式,多组用”,“隔开,最多5组。 如env=pro,type=game
Labels *string `required:"false"`
// 默认110,生产环境建议小于等于110。
MaxPods *int `required:"false"`
// 网络环境,可选千兆:1G ,万兆:10G, 默认1G。
NIC *string `required:"false"`
// Node节点密码。请遵照[[api:uhost-api:specification|字段规范]]设定密码。密码需使用base64进行编码,如下:# echo -n Password1 | base64
Password *string `required:"true"`
// 购买时长。默认: 1。月付时,此参数传0,代表了购买至月末。
Quantity *int `required:"false"`
// Raid配置,默认Raid10 支持:Raid0、Raid1、Raid5、Raid10,NoRaid
Raid *string `required:"false"`
// 子网 ID。默认为集群创建时填写的子网ID,也可以填写集群同VPC内的子网ID。
SubnetId *string `required:"false"`
// 物理机类型,默认为:db-2(基础型-SAS-V3)
Type *string `required:"false"`
}
AddUK8SPHostNodeRequest is request schema for AddUK8SPHostNode action
type AddUK8SPHostNodeResponse ¶
type AddUK8SPHostNodeResponse struct {
response.CommonBase
// 返回错误消息,当 RetCode 非 0 时提供详细的描述信息。
Message string
}
AddUK8SPHostNodeResponse is response schema for AddUK8SPHostNode action
type AddUK8SUHostNodeRequest ¶
type AddUK8SUHostNodeRequest struct {
request.CommonBase
// 系统盘大小,单位GB。默认40。范围:[40, 500]。注意SSD本地盘无法调整。
BootDiskSize *int `required:"false"`
// 磁盘类型。请参考[[api:uhost-api:disk_type|磁盘类型]]。默认为SSD云盘
BootDiskType *string `required:"false"`
// 虚拟CPU核数。可选参数:2-64(具体机型与CPU的对应关系参照控制台)。默认值: 4。
CPU *int `required:"true"`
// 计费模式。枚举值为: \\ > Year,按年付费; \\ > Month,按月付费;\\ > Dynamic,按小时预付费 \\ > Postpay,按小时后付费(支持关机不收费,目前仅部分可用区支持,请联系您的客户经理) \\ 默认为月付
ChargeType *string `required:"true"`
// UK8S集群ID。 可从UK8S控制台获取。
ClusterId *string `required:"true"`
// 创建Node节点数量,取值范围是[1,50]。
Count *int `required:"true"`
// 数据磁盘大小,单位GB。默认0。范围 :[20, 1000]
DataDiskSize *int `required:"false"`
// 磁盘类型。请参考[[api:uhost-api:disk_type|磁盘类型]]。默认为SSD云盘
DataDiskType *string `required:"false"`
// 用于标示添加完节点后是否将节点临时禁用. 传入 "true" 表示禁用,传入其它或不传表示不禁用
DisableSchedule *bool `required:"false"`
// GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
GPU *int `required:"false"`
// GPU类型,枚举值["K80", "P40", "V100",],MachineType为G时必填
GpuType *string `required:"false"`
// 镜像 Id,不填时后台程序会自动选用一个可用的镜像 Id,支持用户自定义镜像,自定义镜像必须基于基础镜像制作。
ImageId *string `required:"false"`
// 用户自定义Shell脚本。与UserData的区别在于InitScript在节点初始化完毕后才执行,UserData则是云主机初始化时执行。
InitScript *string `required:"false"`
// 硬件隔离组id。可通过DescribeIsolationGroup获取。
IsolationGroup *string `required:"false"`
// Node节点标签。key=value形式,多组用”,“隔开,最多5组。 如env=pro,type=game
Labels *string `required:"false"`
// 云主机机型。枚举值["N", "C", "G", "O", "OS"]。参考[[api:uhost-api:uhost_type|云主机机型说明]]。
MachineType *string `required:"false"`
// 默认110,生产环境建议小于等于110。
MaxPods *int `required:"false"`
// 内存大小。单位:MB。范围 :[4096, 262144],取值为1024的倍数(可选范围参考控制台)。默认值:8192
Mem *int `required:"true"`
// 最低cpu平台,枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake";"Intel/CascadelakeR"; “Amd/Epyc2”,"Amd/Auto"],默认值是"Intel/Auto"
MinimalCpuPlatform *string `required:"false"`
// 【该字段已废弃,请谨慎使用】
MinmalCpuPlatform *string `required:"false" deprecated:"true"`
// 节点池id
NodeGroupId *string `required:"false"`
// Node节点密码。请遵照[[api:uhost-api:specification|字段规范]]设定密码。密码需使用base64进行编码,如下:# echo -n Password1 | base64
Password *string `required:"true"`
// 购买时长。默认: 1。按小时购买(Dynamic)时无需此参数。 月付时,此参数传0,代表了购买至月末。
Quantity *int `required:"false"`
// 子网 ID。默认为集群创建时填写的子网ID,也可以填写集群同VPC内的子网ID。
SubnetId *string `required:"false"`
// 业务组
Tag *string `required:"false"`
// Node节点污点,形式为key=value:effect,多组taints用”,“隔开,最多支持五组。
Taints *string `required:"false"`
// 用户自定义数据。当镜像支持Cloud-init Feature时可填写此字段。注意:1、总数据量大小不超过 16K;2、使用base64编码。
UserData *string `required:"false"`
}
AddUK8SUHostNodeRequest is request schema for AddUK8SUHostNode action
type AddUK8SUHostNodeResponse ¶
type AddUK8SUHostNodeResponse struct {
response.CommonBase
// 返回错误消息,当 RetCode 非 0 时提供详细的描述信息。
Message string
// Node实例Id集合
NodeIds []string
}
AddUK8SUHostNodeResponse is response schema for AddUK8SUHostNode action
type ClusterSet ¶
type ClusterSet struct {
// 集群apiserver地址
ApiServer string
// 集群ID
ClusterId string
// 创建集群时判断如果为NORESOURCE则为没资源,否则为空
ClusterLogInfo string
// 资源名字
ClusterName string
// 创建时间
CreateTime int
// 集群外部apiserver地址
ExternalApiServer string
// 集群版本
K8sVersion string
// Master 节点数量
MasterCount int
// Node节点数量
NodeCount int
// Pod网段
PodCIDR string
// 服务网段
ServiceCIDR string
// 集群状态,枚举值:初始化:"INITIALIZING";启动中:"STARTING";创建失败:"CREATEFAILED";正常运行:"RUNNING";添加节点:"ADDNODE";删除节点:"DELNODE";删除中:"DELETING";删除失败:"DELETEFAILED";错误:"ERROR";升级插件:"UPDATE_PLUGIN";更新插件信息:"UPDATE_PLUGIN_INFO";异常:"ABNORMAL";升级集群中:"UPGRADING";容器运行时切换:"CONVERTING"
Status string
// 所属子网
SubnetId string
// 所属VPC
VPCId string
}
ClusterSet - 集群信息
type CreateUK8SClusterV2ParamKubeProxy ¶
type CreateUK8SClusterV2ParamKubeProxy struct {
// 集群kube-proxy模式。支持iptables和ipvs,默认为iptables。
Mode *string `required:"false"`
}
CreateUK8SClusterV2ParamKubeProxy is request schema for complex param
type CreateUK8SClusterV2ParamMaster ¶
type CreateUK8SClusterV2ParamMaster struct {
// Master节点所属可用区,需要设置 Master.0.Zone、 Master.1.Zone、Master.2.Zone 三个 Master 节点的可用区。 三个节点可部署在不同可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
Zone *string `required:"true"`
}
CreateUK8SClusterV2ParamMaster is request schema for complex param
type CreateUK8SClusterV2ParamNodes ¶
type CreateUK8SClusterV2ParamNodes struct {
// Node节点的系统盘大小,单位GB,默认为40。范围:[40, 500]。注意SSD本地盘无法调整。
BootDiskSIze *int `required:"false"`
// 一组Node节点的系统盘类型,请参考[[api:uhost-api:disk_type|磁盘类型]]。默认为SSD云盘
BootDiskType *string `required:"false"`
// 一组Node节点的虚拟CPU核数。单位:核,范围:[2, 64],可选范围参考控制台。
CPU *int `required:"true"`
// 一组Node节点的数量,范围:[1,10]。
Count *int `required:"true"`
// 数据磁盘大小,单位GB。默认0。范围 :[20, 1000]
DataDiskSize *int `required:"false"`
// 一组Node节点的数据盘类型,请参考[[api:uhost-api:disk_type|磁盘类型]]。默认为SSD云盘
DataDiskType *string `required:"false"`
// 一组Node节点的GPU卡核心数,仅GPU机型支持此字段。
GPU *int `required:"false"`
// 一组Node节点的GPU类型,枚举值["K80", "P40", "V100"],最新值参考Console。
GpuType *string `required:"false"`
// 一组Node节点的隔离组Id,归属于同一隔离组的虚拟机节点将落在不同的物理机上,单个隔离组最多只能容纳8个节点。参见DescribeIsolationGroup。
IsolationGroup *string `required:"false"`
// Node节点标签,形式为key=value,多组Labels用”,“隔开,最多支持五组。
Labels *string `required:"false"`
// 一组Nodes节点云主机机型,如["N", "C", "O", "OS"],具体请参照云主机机型。
MachineType *string `required:"true"`
// Node节点上可运行最大节点数,默认为110。
MaxPods *int `required:"false"`
// 一组Node节点的内存大小。单位:MB,范围 :[4096, 262144],取值为1024的倍数,可选范围参考控制台。
Mem *int `required:"true"`
// Node节点的最低cpu平台,不选则随机。枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake"。
MinimalCpuPlatform *string `required:"false"`
// 【该字段已废弃,请谨慎使用】
MinmalCpuPlatform *string `required:"false" deprecated:"true"`
// Node节点污点,形式为key=value:effect,多组taints用”,“隔开,最多支持五组。
Taints *string `required:"false"`
// 一组Nodes节点所属可用区,可创建多组Nodes节点,如一组是CPU Nodes节点,另一组是GPU Nodes节点。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
Zone *string `required:"true"`
}
CreateUK8SClusterV2ParamNodes is request schema for complex param
type CreateUK8SClusterV2Request ¶
type CreateUK8SClusterV2Request struct {
request.CommonBase
// 集群所有节点的付费模式。枚举值为: Year,按年付费; Month,按月付费; Dynamic,按小时付费(需开启权限),默认按月。
ChargeType *string `required:"false"`
// 创建集群的时候定义clusterdomain
ClusterDomain *string `required:"false"`
// 集群名称
ClusterName *string `required:"true"`
// 是否允许外网访问apiserver,开启:Yes 不开启:No。默认为No。
ExternalApiServer *string `required:"false"`
// Master节点和Node节点的镜像 ID,不填则随机选择可用的基础镜像。支持用户自定义镜像。
ImageId *string `required:"false"`
// 用户自定义脚本,与UserData不同,自定义脚本将在集群安装完毕后执行。注意:1、总数据量大小不超多16K;2、使用base64编码。
InitScript *string `required:"false"`
// k8s集群的版本,版本信息请参考UK8S集群创建页,不指定的话默认为当前支持的最高版本。
K8sVersion *string `required:"false"`
//
KubeProxy *CreateUK8SClusterV2ParamKubeProxy `required:"false"`
//
Master []CreateUK8SClusterV2ParamMaster `required:"false"`
// Master节点系统盘大小,单位GB,默认为40。范围:[40, 500]。注意SSD本地盘无法调整。
MasterBootDiskSize *int `required:"false"`
// Master节点系统盘类型。请参考[[api:uhost-api:disk_type|磁盘类型]]。默认为SSD云盘
MasterBootDiskType *string `required:"false"`
// Master节点的虚拟CPU核数。可选参数:2-64(具体机型与CPU的对应关系参照控制台)。
MasterCPU *int `required:"true"`
// Master节点的数据盘大小,单位GB,默认为0。范围 :[20, 1000]
MasterDataDiskSize *int `required:"false"`
// Master节点数据盘类型。请参考[[api:uhost-api:disk_type|磁盘类型]]。默认为SSD云盘
MasterDataDiskType *string `required:"false"`
// 【无效,已删除】当前将自动为Master节点创建隔离组,确保Master节点归属于不同物理机。
MasterIsolationGroup *string `required:"false"`
// Master节点的云主机机型(V2.0),如["N", "C", "O", "OS"],具体请参照云主机机型。
MasterMachineType *string `required:"true"`
// Master节点的内存大小。单位:MB。范围 :[4096, 262144],取值为1024的倍数(可选范围参考控制台)。
MasterMem *int `required:"true"`
// Master节点的最低cpu平台,不选则随机。枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake"。
MasterMinimalCpuPlatform *string `required:"false"`
// 【该字段已废弃,请谨慎使用】
MasterMinmalCpuPlatform *string `required:"false" deprecated:"true"`
//
Nodes []CreateUK8SClusterV2ParamNodes `required:"false"`
// 集群节点密码,包括Master和Node。密码需包含最少一个大写字母,请使用base64进行编码,举例如下:# echo -n Password1 | base64
Password *string `required:"true"`
// 购买时长。默认为1。按小时购买(Dynamic)时无需此参数。 月付时,此参数传0,代表了购买至月末。
Quantity *int `required:"false"`
// Service 网段,用于分配ClusterIP,如172.17.0.0/16。该网段不能与集群所属VPC网段重叠。
ServiceCIDR *string `required:"true"`
// 集群Node及Pod所属子网
SubnetId *string `required:"true"`
// 业务组
Tag *string `required:"false"`
// 用户自定义数据。注意:1、总数据量大小不超多16K;2、使用base64编码。
UserData *string `required:"false"`
// 集群Node及Pod所属VPC
VPCId *string `required:"true"`
}
CreateUK8SClusterV2Request is request schema for CreateUK8SClusterV2 action
type CreateUK8SClusterV2Response ¶
type CreateUK8SClusterV2Response struct {
response.CommonBase
// 集群ID
ClusterId string
}
CreateUK8SClusterV2Response is response schema for CreateUK8SClusterV2 action
type DelUK8SClusterNodeV2Request ¶
type DelUK8SClusterNodeV2Request struct {
request.CommonBase
// UK8S集群ID。 可从UK8S控制台获取。
ClusterId *string `required:"true"`
// Node在UK8S处的唯一标示,如uk8s-reewqe5-sdasadsda。**非云主机或物理云主机资源Id**
NodeId *string `required:"true"`
// 删除节点时是否释放数据盘。 枚举值[true:释放,false: 不释放],默认为true。
ReleaseDataUDisk *bool `required:"false"`
}
DelUK8SClusterNodeV2Request is request schema for DelUK8SClusterNodeV2 action
type DelUK8SClusterNodeV2Response ¶
type DelUK8SClusterNodeV2Response struct {
response.CommonBase
// 返回错误消息,当 RetCode 非 0 时提供详细的描述信息。
Message string
}
DelUK8SClusterNodeV2Response is response schema for DelUK8SClusterNodeV2 action
type DelUK8SClusterRequest ¶
type DelUK8SClusterRequest struct {
request.CommonBase
// 集群id
ClusterId *string `required:"true"`
// 是否删除节点挂载的数据盘。枚举值[true:删除,false: 不删除],默认不删除
ReleaseUDisk *bool `required:"false"`
}
DelUK8SClusterRequest is request schema for DelUK8SCluster action
type DelUK8SClusterResponse ¶
type DelUK8SClusterResponse struct {
response.CommonBase
}
DelUK8SClusterResponse is response schema for DelUK8SCluster action
type DescribeUK8SClusterRequest ¶ added in v0.21.27
type DescribeUK8SClusterRequest struct {
request.CommonBase
// k8s集群ID
ClusterId *string `required:"true"`
}
DescribeUK8SClusterRequest is request schema for DescribeUK8SCluster action
type DescribeUK8SClusterResponse ¶ added in v0.21.27
type DescribeUK8SClusterResponse struct {
response.CommonBase
// 集群apiserver地址
ApiServer string
// 集群CA根证书
CACert string
// 自定义或者默认的clusterdomain
ClusterDomain string
// 集群ID
ClusterId string
// 资源名字
ClusterName string
// 创建时间
CreateTime int
// 集群etcd服务证书
EtcdCert string
// 集群etcd服务密钥
EtcdKey string
// 集群外部apiserver地址
ExternalApiServer string
// kube-proxy配置
KubeProxy KubeProxy
// Master 节点数量
MasterCount int
// Master节点配置信息,具体参考UhostInfo。托管版不返回该信息
MasterList []UhostInfo
// Master配置预警:Normal正常;Warning 需要升级;Error 需要紧急升级;
MasterResourceStatus string
// Node节点数量
NodeCount int
// Node节点配置信息,具体参考UhostInfo
NodeList []UhostInfo
// Pod网段
PodCIDR string
// 服务网段
ServiceCIDR string
// 状态
Status string
// 所属子网
SubnetId string
// 所属VPC
VPCId string
// K8S版本
Version string
}
DescribeUK8SClusterResponse is response schema for DescribeUK8SCluster action
type DescribeUK8SImageRequest ¶
type DescribeUK8SImageRequest struct {
request.CommonBase
}
DescribeUK8SImageRequest is request schema for DescribeUK8SImage action
type DescribeUK8SImageResponse ¶
type DescribeUK8SImageResponse struct {
response.CommonBase
// 虚拟机可用镜像集合, 详见ImageInfo 数组
ImageSet []ImageInfo
// 返回错误消息,当 RetCode 非 0 时提供详细的描述信息。
Message string
// 物理机可用镜像集合, 详见ImageInfo 数组
PHostImageSet []ImageInfo
}
DescribeUK8SImageResponse is response schema for DescribeUK8SImage action
type DescribeUK8SNodeRequest ¶ added in v0.21.9
type DescribeUK8SNodeRequest struct {
request.CommonBase
// UK8S 集群 Id
ClusterId *string `required:"true"`
// K8S 节点IP或者节点ID
Name *string `required:"true"`
}
DescribeUK8SNodeRequest is request schema for DescribeUK8SNode action
type DescribeUK8SNodeResponse ¶ added in v0.21.9
type DescribeUK8SNodeResponse struct {
response.CommonBase
// 操作名称
Action string
// 已分配到当前节点的 Pod 数量
AllocatedPodCount int
// 字符串数组,每一项是类似 "node.alpha.kubernetes.io/ttl=0" 的注解
Annotations []string
// 节点 CPU 总量
CPUCapacity string
// 节点上已分配 Pod 的 CPU 限制值
CPULimits string
// 节点上已分配 Pod 的 CPU 限制值占 CPU 总量的比例
CPULimitsFraction string
// 节点上已分配 Pod 的 CPU 请求量
CPURequests string
// 节点上已分配 Pod 的 CPU 请求量占 CPU 总量的比例
CPURequestsFraction string
// 节点状态数组
Conditions []K8SNodeCondition
// 节点上镜像名称数组
ContainerImages []string
// 容器运行时版本,如:"docker://18.9.9"
ContainerRuntimeVersion string
// 时间戳,单位是 秒
CreationTimestamp int
// 主机名
Hostname string
// 内部 IP 地址
InternalIP string
// 内核版本,如:"4.19.0-6.el7.ucloud.x86_64"
KernelVersion string
// kubeproxy 版本
KubeProxyVersion string
// kubelet 版本
KubeletVersion string
// 字符串数组,每一项是类似 "kubernetes.io/arch=amd64" 的标签
Labels []string
// 节点内存总量
MemoryCapacity string
// 节点上已分配 Pod 的内存限制量
MemoryLimits string
// 节点上已分配 Pod 的内存限制量占内存总量的比例,如返回值为 "18",则意味着限制量占总量的 18%
MemoryLimitsFraction string
// 节点上已分配 Pod 的内存请求量
MemoryRequests string
// 节点上已分配 Pod 的内存请求量占内存总量的比例,如返回值为 "4.5",则意味着请求量占总量的 4.5%
MemoryRequestsFraction string
// 操作出错时的提示信息
Message string
// 节点名称
Name string
// 操作系统类型,如:"CentOS Linux 7 (Core)"
OSImage string
// 节点允许的可分配 Pod 最大数量
PodCapacity int
// 字符串,如:"UCloud://cn-sh2-02//uk8s-vsc0vgob-n-mpzxc"
ProviderID string
// 返回码
RetCode int
// 字符串数组,每一项是类似 "node-role.kubernetes.io/master:NoSchedule" 的污点
Taints []string
// 是否禁止调度
Unschedulable bool
}
DescribeUK8SNodeResponse is response schema for DescribeUK8SNode action
type DiskSet ¶ added in v0.21.27
type DiskSet struct {
// 备份方案,枚举类型:BASIC_SNAPSHOT,普通快照;DATAARK,方舟。无快照则不返回该字段。
BackupType string
// 磁盘长ID
DiskId string
// LOCAL_NOMAL| CLOUD_NORMAL| LOCAL_SSD| CLOUD_SSD|EXCLUSIVE_LOCAL_DISK
DiskType string
// 磁盘盘符
Drive string
// Yes: 加密 No: 非加密
Encrypted string
// 当前主机的IOPS值
IOPS int
// True| False
IsBoot string
// UDisk名字(仅当磁盘是UDisk时返回)
Name string
// 磁盘大小,单位: GB
Size int
// 磁盘类型。系统盘: Boot,数据盘: Data,网络盘:Udisk
Type string
}
DiskSet - 节点磁盘信息
type IPSet ¶ added in v0.21.27
type IPSet struct {
// IP对应的带宽, 单位: Mb (内网IP不显示带宽信息)
Bandwidth int
// 是否默认的弹性网卡的信息。true: 是默认弹性网卡;其他值:不是。
Default string
// IP地址
IP string
// IP资源ID (内网IP无对应的资源ID)
IPId string
// 国际: Internation,BGP: Bgp,内网: Private
Type string
}
IPSet - 节点的IP信息
type ImageInfo ¶
type ImageInfo struct {
// 镜像 Id
ImageId string
// 镜像名称
ImageName string
// 该镜像是否支持GPU机型,枚举值[true:不支持,false:支持]。
NotSupportGPU bool
// 可用区 Id
ZoneId int
}
ImageInfo - UK8S 可用镜像信息
type K8SNodeCondition ¶ added in v0.21.9
type K8SNodeCondition struct {
// 最后一次上报状态的时间
LastProbeTime string
// 最后一次状态转变时间
LastTransitionTime string
// 状态变化的描述信息
Message string
// 状态变化的原因
Reason string
// 状态,False、True
Status string
// Condition 类型,如 MemoryPressure、DiskPressure、PIDPressure、Ready
Type string
}
K8SNodeCondition - Kubernetes Node Condition
type KubeProxy ¶
type KubeProxy struct {
// KubeProxy模式,枚举值为[ipvs,iptables]
Mode string
}
KubeProxy - KubeProxy信息
type ListUK8SClusterNodeV2Request ¶
type ListUK8SClusterNodeV2Request struct {
request.CommonBase
// UK8S集群ID
ClusterId *string `required:"true"`
}
ListUK8SClusterNodeV2Request is request schema for ListUK8SClusterNodeV2 action
type ListUK8SClusterNodeV2Response ¶
type ListUK8SClusterNodeV2Response struct {
response.CommonBase
// 节点详细信息,见NodeInfoV2。
NodeSet []NodeInfoV2
// 满足条件的节点数量,包括Master。
TotalCount int
}
ListUK8SClusterNodeV2Response is response schema for ListUK8SClusterNodeV2 action
type ListUK8SClusterV2Request ¶
type ListUK8SClusterV2Request struct {
request.CommonBase
// UK8S集群ID
ClusterId *string `required:"false"`
// 返回数据长度,默认为20。
Limit *int `required:"false"`
// 列表起始位置偏移量,默认为0。
Offset *int `required:"false"`
}
ListUK8SClusterV2Request is request schema for ListUK8SClusterV2 action
type ListUK8SClusterV2Response ¶
type ListUK8SClusterV2Response struct {
response.CommonBase
// 满足条件的集群数量
ClusterCount int
// 集群信息,具体参考ClusterSet
ClusterSet []ClusterSet
}
ListUK8SClusterV2Response is response schema for ListUK8SClusterV2 action
type ListUK8SNodeGroupRequest ¶ added in v0.21.31
type ListUK8SNodeGroupRequest struct {
request.CommonBase
// 集群ID
ClusterId *string `required:"true"`
}
ListUK8SNodeGroupRequest is request schema for ListUK8SNodeGroup action
type ListUK8SNodeGroupResponse ¶ added in v0.21.31
type ListUK8SNodeGroupResponse struct {
response.CommonBase
// 节点池列表
NodeGroupList []NodeGroupSet
}
ListUK8SNodeGroupResponse is response schema for ListUK8SNodeGroup action
type NodeGroupSet ¶ added in v0.21.31
type NodeGroupSet struct {
// 系统盘类型
BootDiskType string
// 虚拟CPU核数
CPU int
// 付费方式
ChargeType string
// 数据盘大小
DataDiskSize int
// 数据盘类型
DataDiskType string
// GPU卡核心数
GPU int
// GPU类型
GpuType string
// 镜像ID
ImageId string
// 机型
MachineType string
// 内存大小
Mem int
// cpu平台
MinimalCpuPlatform string
// 节点池ID
NodeGroupId string
// 节点池名字
NodeGroupName string
// 节点id列表
NodeList []string
// 业务组
Tag string
}
NodeGroupSet - 节点池配置
type NodeInfoV2 ¶
type NodeInfoV2 struct {
// 节点所属伸缩组ID,非伸缩组创建出来的节点,伸缩组ID为Default。
AsgId string
// Node节点CPU核数,单位: 个。
CPU int
// 节点创建时间
CreateTime int
// 节点计费到期时间
ExpireTime int
// 节点的GPU颗数。
GPU int
// 节点IP信息,详细信息见 UHostIPSet。
IPSet []UHostIPSet
// 资源ID,如uhost-xxxx,或uphost-xxxxx。
InstanceId string
// 资源名称,初始值等于NodeId,用户可在UHost或UPHost处修改。
InstanceName string
// Node节点的资源类型,枚举值为UHost或UPHost。
InstanceType string
// kubeproxy信息,详细信息见KubeProxy。
KubeProxy KubeProxy
// 机型类别,分别对应Uhost的MachineType或PHost的PHostType。
MachineType string
// 内存大小,单位: MB。
Memory int
// NodeId,Node在UK8S处的唯一标示,如uk8s-reewqe5-sdasadsda
NodeId string
// 加节点时判断是否没有资源,如果返回NORESOURCE则代表没有资源了
NodeLogInfo string
// node角色,枚举值为master、node
NodeRole string
// Node的状态:枚举值:初始化:"Initializing";启动中:"Starting";运行:"Running";停止中:"Stopping";停止:"Stopped";待删除:"ToBeDeleted";删除中:"Deleting";异常:"Error";安装失败:"Install Fail";
NodeStatus string
// Node节点的镜像名称。
OsName string
// Node节点的操作系统类别,如Linux或Windows。
OsType string
// 是否允许Pod调度到该节点,枚举值为true或false。
Unschedulable bool
// Node所在可用区
Zone string
}
NodeInfoV2 - UK8S 节点信息
type RemoveUK8SNodeGroupRequest ¶ added in v0.21.31
type RemoveUK8SNodeGroupRequest struct {
request.CommonBase
// 集群id
ClusterId *string `required:"true"`
// 节点池Id
NodeGroupId *string `required:"true"`
}
RemoveUK8SNodeGroupRequest is request schema for RemoveUK8SNodeGroup action
type RemoveUK8SNodeGroupResponse ¶ added in v0.21.31
type RemoveUK8SNodeGroupResponse struct {
response.CommonBase
}
RemoveUK8SNodeGroupResponse is response schema for RemoveUK8SNodeGroup action
type UHostIPSet ¶
type UHostIPSet struct {
// IP对应的带宽, 单位: Mb (内网IP不显示带宽信息)
Bandwidth int
// IP地址
IP string
// IP资源ID (内网IP无对应的资源ID)
IPId string
// Mac地址
Mac string
// IP地址对应的子网 ID
SubnetId string
// 国际: Internation,BGP: Bgp,内网: Private
Type string
// IP地址对应的VPC ID
VPCId string
}
UHostIPSet - 云主机IP信息
type UK8SClient ¶
UK8SClient is the client of UK8S
func NewClient ¶
func NewClient(config *ucloud.Config, credential *auth.Credential) *UK8SClient
NewClient will return a instance of UK8SClient
func (*UK8SClient) AddUK8SExistingUHost ¶
func (c *UK8SClient) AddUK8SExistingUHost(req *AddUK8SExistingUHostRequest) (*AddUK8SExistingUHostResponse, error)
API: AddUK8SExistingUHost
将预先创建好的云主机加入到UK8S集群,需要注意的是,该云主机依然会执行重装系统的操作。
func (*UK8SClient) AddUK8SNodeGroup ¶ added in v0.21.31
func (c *UK8SClient) AddUK8SNodeGroup(req *AddUK8SNodeGroupRequest) (*AddUK8SNodeGroupResponse, error)
API: AddUK8SNodeGroup
添加UK8S节点池
func (*UK8SClient) AddUK8SPHostNode ¶
func (c *UK8SClient) AddUK8SPHostNode(req *AddUK8SPHostNodeRequest) (*AddUK8SPHostNodeResponse, error)
API: AddUK8SPHostNode
为UK8S集群添加一台或多台物理云主机类型的节点。
func (*UK8SClient) AddUK8SUHostNode ¶
func (c *UK8SClient) AddUK8SUHostNode(req *AddUK8SUHostNodeRequest) (*AddUK8SUHostNodeResponse, error)
API: AddUK8SUHostNode
为UK8S集群添加一台Node节点,机型类型为云主机
func (*UK8SClient) CreateUK8SClusterV2 ¶
func (c *UK8SClient) CreateUK8SClusterV2(req *CreateUK8SClusterV2Request) (*CreateUK8SClusterV2Response, error)
API: CreateUK8SClusterV2
创建UK8S集群
func (*UK8SClient) DelUK8SCluster ¶
func (c *UK8SClient) DelUK8SCluster(req *DelUK8SClusterRequest) (*DelUK8SClusterResponse, error)
API: DelUK8SCluster
删除UK8S集群
func (*UK8SClient) DelUK8SClusterNodeV2 ¶
func (c *UK8SClient) DelUK8SClusterNodeV2(req *DelUK8SClusterNodeV2Request) (*DelUK8SClusterNodeV2Response, error)
API: DelUK8SClusterNodeV2
删除集群中的Node节点,删除前务必先将其中的Pod驱逐。
func (*UK8SClient) DescribeUK8SCluster ¶ added in v0.21.27
func (c *UK8SClient) DescribeUK8SCluster(req *DescribeUK8SClusterRequest) (*DescribeUK8SClusterResponse, error)
API: DescribeUK8SCluster
获取集群信息
func (*UK8SClient) DescribeUK8SImage ¶
func (c *UK8SClient) DescribeUK8SImage(req *DescribeUK8SImageRequest) (*DescribeUK8SImageResponse, error)
API: DescribeUK8SImage
获取UK8S支持的Node节点操作系统,可基于该操作系统制定自定义镜像
func (*UK8SClient) DescribeUK8SNode ¶ added in v0.21.9
func (c *UK8SClient) DescribeUK8SNode(req *DescribeUK8SNodeRequest) (*DescribeUK8SNodeResponse, error)
API: DescribeUK8SNode
用于获取 UK8S 节点详情
func (*UK8SClient) ListUK8SClusterNodeV2 ¶
func (c *UK8SClient) ListUK8SClusterNodeV2(req *ListUK8SClusterNodeV2Request) (*ListUK8SClusterNodeV2Response, error)
API: ListUK8SClusterNodeV2
获取UK8S集群节点信息
func (*UK8SClient) ListUK8SClusterV2 ¶
func (c *UK8SClient) ListUK8SClusterV2(req *ListUK8SClusterV2Request) (*ListUK8SClusterV2Response, error)
API: ListUK8SClusterV2
获取UK8S集群列表信息
func (*UK8SClient) ListUK8SNodeGroup ¶ added in v0.21.31
func (c *UK8SClient) ListUK8SNodeGroup(req *ListUK8SNodeGroupRequest) (*ListUK8SNodeGroupResponse, error)
API: ListUK8SNodeGroup
列出UK8S节点池
func (*UK8SClient) NewAddUK8SExistingUHostRequest ¶
func (c *UK8SClient) NewAddUK8SExistingUHostRequest() *AddUK8SExistingUHostRequest
NewAddUK8SExistingUHostRequest will create request of AddUK8SExistingUHost action.
func (*UK8SClient) NewAddUK8SNodeGroupRequest ¶ added in v0.21.31
func (c *UK8SClient) NewAddUK8SNodeGroupRequest() *AddUK8SNodeGroupRequest
NewAddUK8SNodeGroupRequest will create request of AddUK8SNodeGroup action.
func (*UK8SClient) NewAddUK8SPHostNodeRequest ¶
func (c *UK8SClient) NewAddUK8SPHostNodeRequest() *AddUK8SPHostNodeRequest
NewAddUK8SPHostNodeRequest will create request of AddUK8SPHostNode action.
func (*UK8SClient) NewAddUK8SUHostNodeRequest ¶
func (c *UK8SClient) NewAddUK8SUHostNodeRequest() *AddUK8SUHostNodeRequest
NewAddUK8SUHostNodeRequest will create request of AddUK8SUHostNode action.
func (*UK8SClient) NewCreateUK8SClusterV2Request ¶
func (c *UK8SClient) NewCreateUK8SClusterV2Request() *CreateUK8SClusterV2Request
NewCreateUK8SClusterV2Request will create request of CreateUK8SClusterV2 action.
func (*UK8SClient) NewDelUK8SClusterNodeV2Request ¶
func (c *UK8SClient) NewDelUK8SClusterNodeV2Request() *DelUK8SClusterNodeV2Request
NewDelUK8SClusterNodeV2Request will create request of DelUK8SClusterNodeV2 action.
func (*UK8SClient) NewDelUK8SClusterRequest ¶
func (c *UK8SClient) NewDelUK8SClusterRequest() *DelUK8SClusterRequest
NewDelUK8SClusterRequest will create request of DelUK8SCluster action.
func (*UK8SClient) NewDescribeUK8SClusterRequest ¶ added in v0.21.27
func (c *UK8SClient) NewDescribeUK8SClusterRequest() *DescribeUK8SClusterRequest
NewDescribeUK8SClusterRequest will create request of DescribeUK8SCluster action.
func (*UK8SClient) NewDescribeUK8SImageRequest ¶
func (c *UK8SClient) NewDescribeUK8SImageRequest() *DescribeUK8SImageRequest
NewDescribeUK8SImageRequest will create request of DescribeUK8SImage action.
func (*UK8SClient) NewDescribeUK8SNodeRequest ¶ added in v0.21.9
func (c *UK8SClient) NewDescribeUK8SNodeRequest() *DescribeUK8SNodeRequest
NewDescribeUK8SNodeRequest will create request of DescribeUK8SNode action.
func (*UK8SClient) NewListUK8SClusterNodeV2Request ¶
func (c *UK8SClient) NewListUK8SClusterNodeV2Request() *ListUK8SClusterNodeV2Request
NewListUK8SClusterNodeV2Request will create request of ListUK8SClusterNodeV2 action.
func (*UK8SClient) NewListUK8SClusterV2Request ¶
func (c *UK8SClient) NewListUK8SClusterV2Request() *ListUK8SClusterV2Request
NewListUK8SClusterV2Request will create request of ListUK8SClusterV2 action.
func (*UK8SClient) NewListUK8SNodeGroupRequest ¶ added in v0.21.31
func (c *UK8SClient) NewListUK8SNodeGroupRequest() *ListUK8SNodeGroupRequest
NewListUK8SNodeGroupRequest will create request of ListUK8SNodeGroup action.
func (*UK8SClient) NewRemoveUK8SNodeGroupRequest ¶ added in v0.21.31
func (c *UK8SClient) NewRemoveUK8SNodeGroupRequest() *RemoveUK8SNodeGroupRequest
NewRemoveUK8SNodeGroupRequest will create request of RemoveUK8SNodeGroup action.
func (*UK8SClient) RemoveUK8SNodeGroup ¶ added in v0.21.31
func (c *UK8SClient) RemoveUK8SNodeGroup(req *RemoveUK8SNodeGroupRequest) (*RemoveUK8SNodeGroupResponse, error)
API: RemoveUK8SNodeGroup
删除UK8S节点池
type UhostInfo ¶ added in v0.21.27
type UhostInfo struct {
// Cpu数量
CPU int
// 创建时间
CreateTime int
// 节点磁盘信息
DiskSet []DiskSet
// 到期时间
ExpireTime int
// 节点IP信息
IPSet []IPSet
// 内存
Memory int
// 主机名称
Name string
// 主机ID
NodeId string
// 节点类型:uhost表示云主机;uphost表示物理云主机
NodeType string
// 镜像信息
OsName string
// 主机状态
State string
// 所在机房
Zone string
}
UhostInfo - 机器信息