Azure AKS - Create Role Binding in Kubernetes
Role Binding is the process of assigning the role created in the previous step to the service account for the deployment of the NCache Operator.
Azure AKS: Create Manifest File for Role Binding
The declaration of the YAML file, role_binding.yaml, is shown below:
Note
The parameters required to create this YAML file, ready to be deployed, are explained in the Properties section.
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: ncache-operator
subjects:
- kind: ServiceAccount
name: ncache-operator
roleRef:
kind: Role
name: ncache-operator
apiGroup: rbac.authorization.k8s.io
In this declaration, the subjects
and roleRef
bind the two entities together.
Deploy Role Binding
Deploy the created role_binding.yaml in the Azure AKS cluster to successfully assign roles to the service account.
kubectl create -f [dir]/role_binding.yaml
Properties
The properties required to create role binding in Azure AKS are explained below:
Parameter | Description |
---|---|
-kind |
This can be many different types like a Deployment, a Service, a DaemonSet, or a StatefulSet. In this case, it will be RoleBinding. |
-apiVersion |
Specifies the version of the kind and it depends on the underlying version of Kubernetes. |
-name |
Specifies the name of the Operator you will deploy that needs access to the service account. |
The next step is to create the NCache Operator itself, the steps of which have been explained in the next chapter.
See Also
Create NCache Operator in Azure AKS
Create Custom Resource in Kubernetes
Create Role Definition in Kubernetes