云容器实例 CCI-创建Endpoint:请求示例

时间:2023-12-01 17:06:46

请求示例

创建Endpoint,端口名称为"service0",端口号"80",端口的IP协议为默认的TCP协议。

{
  "apiVersion" : "v1",
  "kind" : "Endpoints",
  "metadata" : {
    "name" : "test-endpoint",
    "namespace" : "test-namespace"
  },
  "subsets" : [ {
    "addresses" : [ {
      "ip" : "192.168.226.222",
      "targetRef" : {
        "kind" : "Pod",
        "name" : "nginx-686bccd6f-ccsqb",
        "namespace" : "test-namespace",
        "resourceVersion" : "262055491",
        "uid" : "ae417968-4f69-40da-9228-2434671e9c66"
      }
    } ],
    "ports" : [ {
      "name" : "service0",
      "port" : 80,
      "protocol" : "TCP"
    } ]
  } ]
}
support.huaweicloud.com/api-cci/createCoreV1NamespacedEndpoints.html