ves-io-schema-k8s_cluster-API-Create
On This Page:
Examples of creating k8s_cluster
Usecase:
Create k8s cluster for a site
Request using vesctl:
vesctl configuration create k8s_cluster -i k8s_cluster.yaml
where file k8scluster.yaml has following contents (k8scluster.CreateRequest):
metadata:
name: k8s-cluster-1
namespace: system
spec:
localAccessConfig:
defaultPort: {}
localDomain: example.com
noGlobalAccess: {}
noInsecureRegistries: {}
useDefaultClusterRoleBindings: {}
useDefaultClusterRoles: {}
useDefaultPsp: {}
vesctl yaml response:
metadata:
annotations: {}
labels: {}
name: k8s-cluster-1
namespace: system
spec:
localAccessConfig:
defaultPort: {}
localDomain: example.com
noGlobalAccess: {}
noInsecureRegistries: {}
useDefaultClusterRoleBindings: {}
useDefaultClusterRoles: {}
useDefaultPsp: {}
systemMetadata:
creationTimestamp: "2021-02-22T15:44:02.945260400Z"
creatorClass: examplesvc
creatorId: examplesvc
finalizers: []
tenant: acmecorp
uid: 99c0f81e-f703-40f4-858f-39385b65db38
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"k8s-cluster-1","namespace":"system"},"spec":{"localAccessConfig":{"localDomain":"example.com","defaultPort":{}},"noGlobalAccess":{},"useDefaultPsp":{},"useDefaultClusterRoles":{},"useDefaultClusterRoleBindings":{},"noInsecureRegistries":{}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build817539475_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/k8s_clusters'
curl response:
HTTP/1.1 200 OK
Content-Length: 896
Content-Type: application/json
Date: Mon, 22 Feb 2021 15:44:02 GMT
Vary: Accept-Encoding
{
"metadata": {
"name": "k8s-cluster-1",
"namespace": "system",
"labels": {
},
"annotations": {
},
"description": "",
"disable": false
},
"system_metadata": {
"uid": "99c0f81e-f703-40f4-858f-39385b65db38",
"creation_timestamp": "2021-02-22T15:44:02.945260400Z",
"deletion_timestamp": null,
"modification_timestamp": null,
"initializers": null,
"finalizers": [
],
"tenant": "acmecorp",
"creator_class": "examplesvc",
"creator_id": "examplesvc",
"object_index": 0,
"owner_view": null
},
"spec": {
"local_access_config": {
"local_domain": "example.com",
"default_port": {
}
},
"no_global_access": {
},
"use_default_psp": {
},
"use_default_cluster_roles": {
},
"use_default_cluster_role_bindings": {
},
"no_insecure_registries": {
}
}
}