ves-io-schema-k8s_cluster-API-Create

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 k8s_cluster.yaml has following contents (k8s_cluster.CreateRequest):

RequestJSON:

{"metadata":{"name":"k8s-cluster-1","namespace":"system"},"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_cluster_wide_apps":{},"no_insecure_registries":{},"cluster_scoped_access_deny":{}}} `

vesctl yaml response:

ResponseJSON:

  "metadata": {
    "name": "k8s-cluster-1",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "43c34c67-9f3a-4eb4-b08d-55c1cc0dbf05",
    "creation_timestamp": "2022-07-28T12:10:32.105246025Z",
    "deletion_timestamp": null,
    "modification_timestamp": null,
    "initializers": null,
    "finalizers": [
    ],
    "tenant": "acmecorp",
    "creator_class": "examplesvc",
    "creator_id": "examplesvc",
    "object_index": 0,
    "owner_view": null,
    "labels": {
    }
  },
  "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_cluster_wide_apps": {

    },
    "no_insecure_registries": {

    },
    "cluster_scoped_access_deny": {

    }
  }
}```
`

Request using curl:

    


curl -X 'POST' -d '{"metadata":{"name":"k8s-cluster-1","namespace":"system"},"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_cluster_wide_apps":{},"no_insecure_registries":{},"cluster_scoped_access_deny":{}}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build1372770011_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: 1001 Content-Type: application/json Date: Thu, 28 Jul 2022 12:10:32 GMT Vary: Accept-Encoding

{ "metadata": { "name": "k8s-cluster-1", "namespace": "system", "labels": { }, "annotations": { }, "description": "", "disable": false }, "system_metadata": { "uid": "43c34c67-9f3a-4eb4-b08d-55c1cc0dbf05", "creation_timestamp": "2022-07-28T12:10:32.105246025Z", "deletion_timestamp": null, "modification_timestamp": null, "initializers": null, "finalizers": [ ], "tenant": "acmecorp", "creator_class": "examplesvc", "creator_id": "examplesvc", "object_index": 0, "owner_view": null, "labels": { } }, "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_cluster_wide_apps": {

},
"no_insecure_registries": {

},
"cluster_scoped_access_deny": {

}

} }