ves-io-schema-k8s_cluster-API-Replace

Examples of replacing k8s_cluster

Usecase:

Replace k8s cluster for a site to enable global access

Request using vesctl:

vesctl configuration replace k8s_cluster -i k8s_cluster.yaml

where file k8scluster.yaml has following contents (k8scluster.ReplaceRequest):

metadata:
  name: k8s-cluster-1
  namespace: system
spec:
  globalAccessEnable: {}
  localAccessConfig:
    defaultPort: {}
    localDomain: example.com
  noClusterWideApps: {}
  noInsecureRegistries: {}
  useDefaultClusterRoleBindings: {}
  useDefaultClusterRoles: {}
  useDefaultPsp: {}

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"k8s-cluster-1","namespace":"system"},"spec":{"localAccessConfig":{"localDomain":"example.com","defaultPort":{}},"globalAccessEnable":{},"useDefaultPsp":{},"useDefaultClusterRoles":{},"useDefaultClusterRoleBindings":{},"noClusterWideApps":{},"noInsecureRegistries":{}}}' -H 'X-Volterra-Useragent: v1/pgm=_tmp_go-build381173587_b001_apidocs.test/host=docker-desktop' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/k8s_clusters/k8s-cluster-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Wed, 14 Jul 2021 08:07:16 GMT
Vary: Accept-Encoding

{

}