​
Select Service
ves-io-schema-k8s_cluster_role_binding-API-Create
Published April 5, 2023 | Last modified September 19, 2025
Examples of creating k8s_cluster_role_binding
Usecase:
Create role-binding-1
Request using vesctl:
vesctl configuration create k8s_cluster_role_binding -i k8s_cluster_role_binding.yaml
where file k8s_cluster_role_binding.yaml has following contents (k8s_cluster_role_binding.CreateRequest):
RequestJSON:
{
    "metadata": {
        "name": "role-binding-1",
        "namespace": "system"
    },
    "spec": {
        "k8s_cluster_role": {
            "namespace": "system",
            "name": "k8s-cluster-role-1"
        },
        "subjects": [
            {
                "user": "user1@example.com"
            }
        ]
    }
}
Copied!
vesctl yaml response:
ResponseJSON:
{
    "metadata": {
        "name": "role-binding-1",
        "namespace": "system",
        "labels": {},
        "annotations": {},
        "description": "",
        "disable": false
    },
    "system_metadata": {
        "uid": "1b3d3ce3-677d-4f10-bae0-5ad65cbd8056",
        "creation_timestamp": "2025-09-19T02:00:20.332641Z",
        "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": {
        "k8s_cluster_role": {
            "tenant": "acmecorp",
            "namespace": "system",
            "name": "k8s-cluster-role-1"
        },
        "subjects": [
            {
                "user": "user1@example.com"
            }
        ]
    }
}
Copied!
Request using curl:
curl -X 'POST' -d '{"metadata":{"name":"role-binding-1","namespace":"system"},"spec":{"k8s_cluster_role":{"namespace":"system","name":"k8s-cluster-role-1"},"subjects":[{"user":"user1@example.com"}]}}' -H 'Content-Type: application/json' -H 'X-Volterra-Useragent: v1/pgm=_var_folders_q2_3kp8z3zs0x5_m7pk1bgb0_ph0000gp_T_go-build2850427035_b001_apidocs.test/host=MTY6VVHQPH/svc=S:examplesvc/site=mytestce01' 'https://acmecorp.console.ves.volterra.io/api/config/namespaces/system/k8s_cluster_role_bindings'
Copied!
curl response:
HTTP/1.1 200 OK
Content-Length: 812
Content-Type: application/json
Date: Fri, 19 Sep 2025 02:00:20 GMT
Vary: Accept-Encoding
{
  "metadata": {
    "name": "role-binding-1",
    "namespace": "system",
    "labels": {
    },
    "annotations": {
    },
    "description": "",
    "disable": false
  },
  "system_metadata": {
    "uid": "1b3d3ce3-677d-4f10-bae0-5ad65cbd8056",
    "creation_timestamp": "2025-09-19T02:00:20.332641Z",
    "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": {
    "k8s_cluster_role": {
      "tenant": "acmecorp",
      "namespace": "system",
      "name": "k8s-cluster-role-1"
    },
    "subjects": [
      {
        "user": "user1@example.com"
      }
    ]
  }
}
Copied!