Replacing a Specified ClusterRoleBinding
Function
This API is used to replace a specified ClusterRoleBinding.
URL
PUT /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
Table 1 describes the parameters of this API.
Request
Request parameters:
For the description about request parameters, see Table 2.
For the description about the Content-Type field, see Patch Request Method Operation Description.
Example request:
{
"kind": "ClusterRoleBinding",
"apiVersion": "rbac.authorization.k8s.io/v1",
"metadata": {
"name": "read-secrets-global"
},
"subjects": [{
"kind": "Group",
"apiGroup": "rbac.authorization.k8s.io",
"name": "group-leader"
}],
"roleRef": {
"apiGroup": "rbac.authorization.k8s.io",
"kind": "ClusterRole",
"name": "secret-reader"
}
}
Example response:
{
"kind": "ClusterRoleBinding",
"apiVersion": "rbac.authorization.k8s.io/v1",
"metadata": {
"name": "read-secrets-global",
"selfLink": "/apis/rbac.authorization.k8s.io/v1/clusterrolebindings/read-secrets-global",
"uid": "c384b02f-f2d7-11e8-b449-fa163ec24e06",
"resourceVersion": "226909",
"creationTimestamp": "2018-11-28T06:35:14Z"
},
"subjects": [{
"kind": "Group",
"apiGroup": "rbac.authorization.k8s.io",
"name": "group-leader"
}],
"roleRef": {
"apiGroup": "rbac.authorization.k8s.io",
"kind": "ClusterRole",
"name": "secret-reader"
}
}
Status Code
Table 2 describes the status codes of this API.
Last Article: Updating a Specified ClusterRoleBinding
Next Article: Deleting a Specified ClusterRoleBinding
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.