ves-io-schema-k8s_cluster_role_binding-API-Replace

Examples of replacing k8sclusterrole_binding

Usecase:

Replace role-binding-1 to modify subject list to add user2

Request using vesctl:

vesctl configuration replace k8s_cluster_role_binding -i k8s_cluster_role_binding.yaml

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

metadata:
  name: role-binding-1
  namespace: system
spec:
  k8sClusterRole:
    name: k8s-cluster-role-1
    namespace: system
  subjects:
  - user: user1@example.com
  - user: user2@example.com

vesctl yaml response: None

Request using curl:

curl -X 'PUT' -d '{"metadata":{"name":"role-binding-1","namespace":"system"},"spec":{"k8sClusterRole":{"namespace":"system","name":"k8s-cluster-role-1"},"subjects":[{"user":"user1@example.com"},{"user":"user2@example.com"}]}}' -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_cluster_role_bindings/role-binding-1'

curl response:

HTTP/1.1 200 OK
Content-Length: 4
Content-Type: application/json
Date: Mon, 22 Feb 2021 15:44:05 GMT
Vary: Accept-Encoding

{

}