CreateVirtualNode - 创建一个虚拟节点

调用CreateVirtualNode创建一个虚拟节点(VNode),用于对接自建Kubernetes集群,使其可以扩展资源到ECI。

接口说明

  • 调用本接口创建虚拟节点时,系统将自动为您创建一个服务关联角色 AliyunServiceRoleForECIVnode,用于访问 ECI、ECS、VPC 等相关云服务。更多信息,请参见虚拟节点服务关联角色

  • 虚拟节点按个数计费。每个虚拟节点会有一个常驻节点,相当于 2 vCPU,8 GiB 的 ECI 实例,收取相关 ECI 实例费用。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

调试

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。

  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。

  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:

    • 对于必选的资源类型,用前面加 * 表示。

    • 对于不支持资源级授权的操作,用全部资源表示。

  • 条件关键字:是指云产品自身定义的条件关键字。

  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。

操作

访问级别

资源类型

条件关键字

关联操作

eci:CreateVirtualNode

create

*VirtualNode

acs:eci:{#regionId}:{#accountId}:virtualnode/*

  • eci:tag

请求参数

名称

类型

必填

描述

示例值

RegionId

string

地域 ID。

cn-hangzhou

RegionId

string

地域 ID。

cn-hangzhou

ZoneId

string

可用区 ID。

cn-hangzhou-b

SecurityGroupId

string

安全组 ID。虚拟节点以及该虚拟节点下的 ECI 实例将加入到该安全组中。

sg-2ze81zoc3yl7a3we****

VSwitchId

string

交换机 ID。虚拟节点以及虚拟节点下的 ECI 实例所使用的交换机。
支持指定多个(1~10 个)属于同一 VPC 的交换机。

vsw-2ze23nqzig8inprou****

VirtualNodeName

string

虚拟节点的名称。长度为 2~128 个英文字符,可以包含小写英文字符、数字、半角句号(.)或者短划线(-)。

testNode

ResourceGroupId

string

资源组 ID。

rg-uf66jeqopgqa9hdn****

ClientToken

string

保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。只支持 ASCII 字符,且不能超过 64 个字符。更多详情,请参见如何保证幂等性

123e4567-e89b-12d3-a456-426655440000

EnablePublicNetwork

boolean

是否支持公网。默认为 false。
如果设置为 true,则虚拟节点将对外暴露一个公网 IP。

false

EipInstanceId

string

弹性公网 IP 的 ID。

eip-uf66jeqopgqa9hdn****

KubeConfig

string

虚拟节点要连接的 Kubernetes 集群的 KubeConfig。需进行 Base64 编码后传入。

JTVDbmFwaVZlcnNpb24lM0ElMjB2MSU1Q25jbHVzdGVycyUzQSU1Q24tJTIwY2x1c3RlciUzQSU1Q24uLi******

CustomResources

string

虚拟节点支持的自定义资源。如果 ECI Pod 的 request 中声明了相应的自定义资源,则该 Pod 会被调度到 VNode。 格式为资源名称=资源数量,多个资源之间使用半角逗号间隔。

example1.com=100,example2.com=200

ClusterDomain

string

集群的域名。配置后,除了主机的搜索域外,Kubelet 会配置所有容器来搜索该域名。

example.com

ClusterDNS

string

DNS 服务器的 IP 地址。如果 ECI Pod 中设置了dnsPolicy=ClusterFirst,则使用该配置值为容器提供 DNS 服务。 支持配置多个 IP 地址,多个 IP 地址之间使用半角逗号间隔。

100.1.XX.XX

Tag

array<object>

虚拟节点标签信息。最多可以配置 20 个。

object

虚拟节点标签信息。

Key

string

标签键。

name

Value

string

标签值。

test

Taint

array<object>

虚拟节点污点信息。最多可以配置 20 个。

object

虚拟节点污点信息。

Key

string

污点的 Key。

testKey

Value

string

污点的 Value。

testValue

Effect

string

污点的 Effect。取值范围:

  • NoSchedule:不将 Pod 调度到具有该污点的节点上。

  • NoExecute:不将 Pod 调度到具有该污点的节点上的同时,驱逐节点上已经存在的 Pod。

  • PreferNoSchedule:尽量不将 Pod 调度到具有该污点的节点上。

NoSchedule

TlsBootstrapEnabled

boolean

是否启用 TLS 启动引导。启用后,请使用 TLS 启动引导的 KubeConfig 证书。取值范围:

  • true:启用

  • false:不启用

默认为 false。

false

返回参数

名称

类型

描述

示例值

object

返回信息。

RequestId

string

请求 ID。

89164E78-FC82-4684-BE97-DCDD85D26546

VirtualNodeId

string

虚拟节点 ID。

vnd-2ze960zkdqrldeaw****

示例

正常返回示例

JSON格式

{
  "RequestId": "89164E78-FC82-4684-BE97-DCDD85D26546",
  "VirtualNodeId": "vnd-2ze960zkdqrldeaw****"
}

错误码

HTTP status code

错误码

错误信息

描述

400 Account.Arrearage Your account has an outstanding payment. 账号已经欠费。
400 DryRunOperation Request validation has been passed with DryRun flag set. 此次DryRun预检请求合格。
400 InvalidParameter.CPU.Memory The specified cpu and memory are not allowed
400 InvalidParameter.DuplicatedName The container group include containers with duplicate names. 容器组内有重复名字的容器。
400 InvalidParameter.DuplicatedVolumeName The container group includes volumes with duplicate names. 容器组内有重复名字的数据卷。
400 IncorrectStatus %s 指定的实例状态不正确。
400 ServiceNotEnabled %s 该次请求所依赖的服务没有开通,请开通后再试。
400 ImageSnapshot.IncorrectStatus %s 用于镜像缓存的快照状态不正确。
400 ImageSnapshot.NotSupport %s 基于数据盘快照的镜像缓存功能暂未全网开放,如有需要请联系我们。
400 DiskVolume.NotSupport The disk volume is not supported. 云盘卷暂不支持,如有需要请联系我们。
400 RamRole.NotSupport The RAM role is not supported. ram实例角色不支持。
400 DiskNumber.LimitExceed The maximum number of disks in an instance is exceeded. 实例下云盘数目超过限制。
400 InvalidPaymentMethod.InsufficientBalance No payment method is specified for your account. We recommend that you add a payment method or add funds to the prepayment balance. 您的账户暂无有效支付方式,请添加支付方式或保持预付款余额充足。
400 DiskVolume.NotInSameZone The instance to be created and the disk are not in the same zone. 即将创建的实例和云盘不在同一可用区。
400 NoPermission You are not authorized to use the "Product on ECI" feature.
400 HighCpuMemConfigRequired You need to apply to be added to the whitelist of the specified CPU and memory. 您需要申请CPU高配白名单。
400 RecommendEmpty.InstanceTypeFamilyNotMatched The recommended instance type is unavailable in the current zone. Try again later. 当前可用区没有推荐的规格可使用,请稍后重试或者到其他的可用区创建。
400 LocalDiskAmountNotMatch The number of local volumes does not match the instance type. 本地盘数量跟实例规格不匹配
400 Payfor.CreditPayInsufficientBalance Your payment credit line is insufficient. 您的付款信用额度不足。
400 InvalidOperation.KMS.InstanceTypeNotSupport The specified instance is invalid. Only I/O optimized instances support KMS key. 指定的实例无效,只有 I/O 优化类型的实例支持设置“KMS Key”。
400 InvalidParameter.Encrypted.KmsNotEnabled KMS must be enabled for encrypted disks. 加密磁盘需要启用密钥管理服务。
400 InvalidParameter.KMS.EncryptedIllegal After configuring the parameter KmsKeyId, you must enable encryption. 设置参数“KmsKeyId”后,您必须开启加密属性。
400 Ipv6AddressNotSupportVsw IPv6 is not supported in the specified vSwitch. 该交换机暂未开通ipv6地址。
400 EipAddressPoolIpNotEnough The ip address of specified PublicIpAddressPool is not enough. 指定的eip公网地址池地址资源不足。
400 VnodeDedicatedHostIdAlreadyExist DedicatedHostId:%s of Vnode:%s already exists. DedicatedHostId已经存在
400 DedicatedHostQuotaExceeded The quota of DedicatedHost is exceeded. 专有宿主机的quota超过限制
403 OperationDenied.VswZoneMisMatch The specified VSwitchId is not in the specified Zone.
403 QuotaExceeded %s quota exceeded.
403 Zone.NotOnSale The specified zone is not available for purchase. 创建实例的可用区已经关闭售卖,请更换其他可用区。或者无法在该可用区使用指定 VPC 的虚拟交换机。
403 Forbidden.RiskControl This operation has been identified as an abnormal operation and cannot be processed. 此操作已被确定为一个操作异常,无法处理。
403 Forbidden.SubUser The specified action is not available for you.
403 Forbidden.OnlyForInvitedTest Eci create action is only open to invited users during public beta.
403 OperationDenied.SecurityGroupMisMatch The specified VSwitchId and SecurityGroupId are not in the same VPC.
403 InvalidVSwitchId.IpNotEnough The specified VSwitch does not have enough IP addresses.
403 Forbidden.UserBussinessStatus This operation is not allowed, because you have overdue bills. Pay the overdue bill and try again. 用户处于欠费状态不允许创建,请充值后再尝试。
403 Forbidden.UserNotRealNameAuthentication This operation is not allowed, because you have not passed the real-name verification. 操作被禁止,因为用户还未进行实名认证。
403 InvalidUser.PassRoleForbidden The RAM user is not authorized to assume a RAM role. 子账号用户没有权限使用RAM实例角色。
403 NoPermission The RAM role does not belong to ECS.
403 OperationDenied.NoStock Sales of this resource are temporarily suspended in the specified zone. We recommend that you use the multi-zone creation function to avoid the risk of insufficient resource. For more information, see https://help.aliyun.com/document_detail/157290.html
403 InvalidParameter.KMS.KeyId.Forbidden You are not authorized to access the specified KMSKeyId. 无权访问指定的 KMSKeyId。
403 Forbidden.AccountClosed The operation is forbidden. Your account has been closed. 操作被禁止,因为用户账户已注销。
403 InvalidOperation.ResourceManagedByCloudProduct The operation is forbidden. The security group has been managed by another cloud product. 安全组由其他云产品管理,禁止操作。
403 Spot.NotMatched %s. We recommend that you use the create multi-zone function to avoid insufficient inventory. For more information, see https://help.aliyun.com/document_detail/157290.html
403 SecurityRisk.3DVerification We have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email. 我们检测到您的默认信用卡或借记卡存在安全风险。请通过电子邮件中的链接进行验证。
403 CreateServiceLinkedRole.Denied Please make sure the account has ram:CreateServiceLinkedRole permission. 请确保账号拥有ram:CreateServiceLinkedRole权限。
404 ImageSnapshot.NotFound The specified snapshot does not exist. 镜像缓存,快照不存在。
404 InvalidDiskId.NotFound The specified disk does not exist. 指定的云盘不存在。
404 InvalidParameter.KMS.KeyId.NotFound The specified KMSKeyId does not exist. 指定的参数“KMSKeyId”不存在。

访问错误中心查看更多错误码。

变更历史

更多信息,参考变更详情