View the cluster list
Requests
HTTP request
GET /apis/platform.tkestack.io/v1/clusters
list or watch objects of kind Cluster
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
| allowWatchBookmarks | boolean | False | allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. If the feature gate WatchBookmarks is not enabled in apiserver, this field is ignored. |
| continue | string | False | The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications. |
| fieldSelector | string | False | A selector to restrict the list of returned objects by their fields. Defaults to everything. |
| labelSelector | string | False | A selector to restrict the list of returned objects by their labels. Defaults to everything. |
| limit | integer | False | limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results. Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true. The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests. This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned. |
| resourceVersion | string | False | When specified with a watch call, shows changes that occur after that particular version of a resource. Defaults to changes from the beginning of history. When specified for list: - if unset, then the result is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. |
| timeoutSeconds | integer | False | Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. |
| watch | boolean | False | Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion. |
| pretty | string | False | If 'true', then the output is pretty printed. |
Responses
Content-Type
application/json,
application/yaml,
application/vnd.kubernetes.protobuf,
application/json;stream=watch,
application/vnd.kubernetes.protobuf;stream=watch
Status code: 200
OK
Sample response
ClusterList is the whole list of all clusters which owned by a tenant.
{
"apiVersion": "platform.tkestack.io/v1",
"items": [
{
"apiVersion": "platform.tkestack.io/v1",
"kind": "Cluster",
"metadata": {
"annotations": {
"cpaas.io/network-type": "kube-ovn",
"platform.tkestack.io/galaxy-ipam-ip": "10.96.0.8",
"platform.tkestack.io/gpu-quota-admission-ip": "10.96.0.9"
},
"creationTimestamp": "2021-06-21T04:10:33Z",
"labels": {
"cluster-type": "Baremetal",
"cpaas.io/arch": "amd64"
},
"name": "global",
"resourceVersion": "11982192",
"selfLink": "/apis/platform.tkestack.io/v1/clusters/global",
"uid": "6cc56a49-8ac3-45ea-916c-10fb67b9472b"
},
"spec": {
"clusterCIDR": "10.199.0.0/16",
"clusterCredentialRef": {
"name": "cc-global"
},
"displayName": "Global",
"dnsDomain": "cluster.local",
"etcd": {
"local": {
"dataDir": "/var/lib/etcd",
"serverCertSANs": [
"etcd",
"etcd.kube-system",
"192.168.0.100"
]
}
},
"features": {
"enableMasterSchedule": true,
"files": [
{
"dst": "/etc/kubernetes/audit/policy.yaml",
"src": "/app/provider/baremetal/audit/policy.yaml"
}
],
"ha": {
"thirdParty": {
"vip": "192.168.0.100",
"vport": 6443
}
},
"ipvs": true,
"skipConditions": [
"EnsureGalaxy",
"EnsureNvidiaDriver",
"EnsureKubernetesImages",
"EnsureMetricsServer"
],
"upgrade": {
"mode": "Auto",
"strategy": {
"drainNodeBeforeUpgrade": false,
"maxUnready": 0
}
}
},
"finalizers": [
"cluster"
],
"kubeletExtraArgs": {
"max-pods": "110"
},
"machines": [
{
"displayName": "",
"ip": "192.168.0.101",
"ipv6": "",
"labels": {
"node-role.kubernetes.io/master": "",
"nvidia-device-enable": "false"
},
"networkDevice": "",
"port": 22,
"proxy": {},
"publicIP": "",
"role": "",
"username": "root"
},
{
"displayName": "",
"ip": "192.168.0.102",
"ipv6": "",
"labels": {
"node-role.kubernetes.io/master": "",
"nvidia-device-enable": "false"
},
"networkDevice": "",
"port": 22,
"proxy": {},
"publicIP": "",
"role": "",
"username": "root"
},
{
"displayName": "",
"ip": "192.168.0.103",
"ipv6": "",
"labels": {
"node-role.kubernetes.io/master": "",
"nvidia-device-enable": "false"
},
"networkDevice": "",
"port": 22,
"proxy": {},
"publicIP": "",
"role": "",
"username": "root"
}
],
"networkDevice": "eth0",
"properties": {
"maxNodePodNum": 256
},
"publicAlternativeNames": [
"192.168.0.101",
"192.168.0.102",
"192.168.0.103",
"192.168.0.100"
],
"serviceCIDR": "10.96.0.0/12",
"tenantID": "default",
"type": "Baremetal",
"version": "1.19.9"
},
"status": {
"addresses": [
{
"host": "192.168.0.101",
"path": "",
"port": 6443,
"type": "Real"
},
{
"host": "192.168.0.102",
"path": "",
"port": 6443,
"type": "Real"
},
{
"host": "192.168.0.103",
"path": "",
"port": 6443,
"type": "Real"
},
{
"host": "192.168.0.100",
"path": "",
"port": 6443,
"type": "Advertise"
}
],
"clusterCIDR": "10.199.0.0/16",
"conditions": [
{
"lastProbeTime": "2021-07-01T07:58:26Z",
"lastTransitionTime": "2021-06-29T02:15:58Z",
"status": "True",
"type": "HealthCheck"
}
],
"dnsIP": "10.96.0.10",
"nodeCIDRMaskSize": 24,
"phase": "Running",
"resource": {},
"serviceCIDR": "10.96.0.0/12",
"version": "1.19.9"
}
},
{
"apiVersion": "platform.tkestack.io/v1",
"kind": "Cluster",
"metadata": {
"creationTimestamp": "2021-06-24T04:31:13Z",
"labels": {
"cluster-type": "",
"cpaas.io/arch": "amd64"
},
"name": "import-cluter",
"resourceVersion": "2032899",
"selfLink": "/apis/platform.tkestack.io/v1/clusters/import-cluter",
"uid": "5a5c2132-1811-4be0-bcaf-74ffc87701b2"
},
"spec": {
"clusterCredentialRef": {
"name": "clustercredential-zjvswlqf"
},
"displayName": "Imported-Cluster",
"dnsDomain": "cluster.local",
"features": {
"upgrade": {
"mode": "Auto",
"strategy": {
"drainNodeBeforeUpgrade": false,
"maxUnready": 0
}
}
},
"finalizers": [
"cluster"
],
"properties": {},
"tenantID": "",
"type": "Imported",
"version": ""
},
"status": {
"addresses": [
{
"host": "10.0.132.151",
"path": "",
"port": 6443,
"type": "Advertise"
}
],
"conditions": [
{
"lastProbeTime": "2021-06-24T04:31:13Z",
"lastTransitionTime": "2021-06-24T04:31:13Z",
"status": "True",
"type": "EnsureCreateClusterMark"
},
{
"lastProbeTime": "2021-07-01T08:39:06Z",
"lastTransitionTime": "2021-06-24T04:31:13Z",
"status": "True",
"type": "HealthCheck"
}
],
"phase": "Running",
"resource": {},
"version": "1.16.15"
}
}
],
"kind": "ClusterList",
"metadata": {
"resourceVersion": "12016398",
"selfLink": "/apis/platform.tkestack.io/v1/clusters"
}
}Parameters
| Name | Type | Description |
|---|---|---|
| apiVersion | string | See common parameters |
| items | array |
List of clusters
Path: items |
| items[] | object |
Cluster is a Kubernetes cluster in
Path: items[] |
| items[].apiVersion | string | See common parameters |
| items[].kind | string | See common parameters |
| items[].metadata | object | See common parameters |
| items[].spec | object |
ClusterSpec is a description of a cluster.
Path: items[].spec |
| spec.clusterCIDR | string |
ClusterCIDR is used to set a separated CIDR for k8s pod
Path: items[].spec.clusterCIDR |
| spec.clusterCredentialRef | object |
LocalObjectReference contains enough information to let you locate the referenced object inside the same namespace.
Path: items[].spec.clusterCredentialRef |
| clusterCredentialRef.name | string |
Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Path: items[].spec.clusterCredentialRef.name |
| spec.displayName | string |
DisplayName is the display name of the cluster.
Path: items[].spec.displayName |
| spec.dnsDomain | string |
DNSDomain is the dns domain used by k8s services. Defaults to "cluster.local".
Path: items[].spec.dnsDomain |
| spec.etcd | object |
Etcd contains elements describing Etcd configuration.
Path: items[].spec.etcd |
| etcd.local | object |
LocalEtcd describes that kubeadm should run an etcd cluster locally
Path: items[].spec.etcd.local |
| local.dataDir | string |
DataDir is the directory etcd will place its data. Defaults to "/var/lib/etcd".
Path: items[].spec.etcd.local.dataDir |
| local.serverCertSANs | array |
ServerCertSANs sets extra Subject Alternative Names for the etcd server signing cert.
Path: items[].spec.etcd.local.serverCertSANs |
| local.serverCertSANs[] | string |
Path: items[].spec.etcd.local.serverCertSANs[] |
| spec.features | object |
ClusterFeature records the features that are enabled by the cluster.
Path: items[].spec.features |
| features.enableMasterSchedule | boolean |
enable master node schedule or not
Path: items[].spec.features.enableMasterSchedule |
| features.files | array |
files
Path: items[].spec.features.files |
| features.files[] | object |
Path: items[].spec.features.files[] |
| files[].dst | string |
destination file, only support regular file
Path: items[].spec.features.files[].dst |
| files[].src | string |
source file, only support regular file
Path: items[].spec.features.files[].src |
| features.ha | object |
Path: items[].spec.features.ha |
| ha.thirdParty | object |
Path: items[].spec.features.ha.thirdParty |
| thirdParty.vip | string |
virtual IP of the HA
Path: items[].spec.features.ha.thirdParty.vip |
| thirdParty.vport | integer (int32) |
virtual port of the HA
Path: items[].spec.features.ha.thirdParty.vport |
| features.ipvs | boolean |
ipvs on-off
Path: items[].spec.features.ipvs |
| features.skipConditions | array |
SkipConditions is a set of conditions that needs to be skipped
Path: items[].spec.features.skipConditions |
| features.skipConditions[] | string |
Path: items[].spec.features.skipConditions[] |
| features.upgrade | object |
Path: items[].spec.features.upgrade |
| upgrade.mode | string |
Upgrade mode, default value is Auto.
Path: items[].spec.features.upgrade.mode |
| upgrade.strategy | object |
UpgradeStrategy used to control the upgrade process.
Path: items[].spec.features.upgrade.strategy |
| strategy.drainNodeBeforeUpgrade | boolean |
Whether drain node before upgrade. Draining node before upgrade is recommended. But not all pod running as cows, a few running as pets. If your pod can not accept be expelled from current node, this value should be false.
Path: items[].spec.features.upgrade.strategy.drainNodeBeforeUpgrade |
| strategy.maxUnready | string (int-or-string) |
IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.
Path: items[].spec.features.upgrade.strategy.maxUnready |
| spec.finalizers | array |
Finalizers is an opaque list of values that must be empty to permanently remove object from storage.
Path: items[].spec.finalizers |
| spec.finalizers[] | string |
Path: items[].spec.finalizers[] |
| spec.kubeletExtraArgs | object |
kubelet extra arguments
Path: items[].spec.kubeletExtraArgs |
| spec.machines | array |
cluster machine, represent master nodes in the cluster
Path: items[].spec.machines |
| spec.machines[] | object |
ClusterMachine is the master machine definition of cluster.
Path: items[].spec.machines[] |
| machines[].displayName | string |
displayName
Path: items[].spec.machines[].displayName |
| machines[].ip | string |
Path: items[].spec.machines[].ip |
| machines[].ipv6 | string |
ipv6
Path: items[].spec.machines[].ipv6 |
| machines[].labels | object |
Path: items[].spec.machines[].labels |
| machines[].networkDevice | string |
networkDevice
Path: items[].spec.machines[].networkDevice |
| machines[].port | integer (int32) |
Path: items[].spec.machines[].port |
| machines[].proxy | object |
MachineProxy is the proxy to connect Machine's ssh.
Path: items[].spec.machines[].proxy |
| machines[].publicIP | string |
publicIP
Path: items[].spec.machines[].publicIP |
| machines[].role | string |
master/node
Path: items[].spec.machines[].role |
| machines[].username | string |
Path: items[].spec.machines[].username |
| spec.networkDevice | string |
network device
Path: items[].spec.networkDevice |
| spec.properties | object |
ClusterProperty records the attribute information of the cluster.
Path: items[].spec.properties |
| properties.maxNodePodNum | integer (int32) |
max number of node pod
Path: items[].spec.properties.maxNodePodNum |
| spec.publicAlternativeNames | array |
public alternative names
Path: items[].spec.publicAlternativeNames |
| spec.publicAlternativeNames[] | string |
Path: items[].spec.publicAlternativeNames[] |
| spec.serviceCIDR | string |
ServiceCIDR is used to set a separated CIDR for k8s service, it's exclusive with MaxClusterServiceNum.
Path: items[].spec.serviceCIDR |
| spec.tenantID | string |
tenant id
Path: items[].spec.tenantID |
| spec.type | string |
cluster type, baremetal or imported
Path: items[].spec.type |
| spec.version | string |
cluster version
Path: items[].spec.version |
| items[].status | object |
ClusterStatus represents information about the status of a cluster.
Path: items[].status |
| status.addresses | array |
List of addresses reachable to the cluster.
Path: items[].status.addresses |
| status.addresses[] | object |
ClusterAddress contains information for the cluster's address.
Path: items[].status.addresses[] |
| addresses[].host | string |
The cluster address.
Path: items[].status.addresses[].host |
| addresses[].path | string |
path
Path: items[].status.addresses[].path |
| addresses[].port | integer (int32) |
port
Path: items[].status.addresses[].port |
| addresses[].type | string |
Cluster address type, one of Public, ExternalIP or InternalIP.
Path: items[].status.addresses[].type |
| status.clusterCIDR | string |
ClusterCIDR is used to set a separated CIDR for k8s pod
Path: items[].status.clusterCIDR |
| status.conditions | array |
cluster conditions
Path: items[].status.conditions |
| status.conditions[] | object |
ClusterCondition contains details for the current condition of this cluster.
Path: items[].status.conditions[] |
| conditions[].lastProbeTime | string (date-time) |
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.
Path: items[].status.conditions[].lastProbeTime |
| conditions[].lastTransitionTime | string (date-time) |
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.
Path: items[].status.conditions[].lastTransitionTime |
| conditions[].status | string |
Status is the status of the condition. Can be True, False, Unknown.
Path: items[].status.conditions[].status |
| conditions[].type | string |
Type is the type of the condition.
Path: items[].status.conditions[].type |
| status.dnsIP | string |
dns ip
Path: items[].status.dnsIP |
| status.nodeCIDRMaskSize | integer (int32) |
node CIDR mask size
Path: items[].status.nodeCIDRMaskSize |
| status.phase | string |
cluster phase
Path: items[].status.phase |
| status.resource | object |
ClusterResource records the current available and maximum resource quota information for the cluster.
Path: items[].status.resource |
| status.serviceCIDR | string |
ServiceCIDR is used to set a separated CIDR for k8s service, it's exclusive with MaxClusterServiceNum.
Path: items[].status.serviceCIDR |
| status.version | string |
cluster version
Path: items[].status.version |
| kind | string | See common parameters |
| metadata | object | See common parameters |