Provision Azure Files ReadWriteMany Persistent Volumes on Azure OpenShift: Difference between revisions
No edit summary |
|||
Line 18: | Line 18: | ||
For more details about role assignment see: {{Internal|Azure_Security_Operations#Assign_a_Role|Azure Security Operations | Assign a Role}} | For more details about role assignment see: {{Internal|Azure_Security_Operations#Assign_a_Role|Azure Security Operations | Assign a Role}} | ||
3. The OpenShift persistent volume binder service account will need the ability to read secrets. This ability can be given by creating and assigning an OpenShift cluster role to achieve this. Login into the OpenShift API server as described here: [[OpenShift_on_Azure#oc_login|OpenShift on Azure | oc login]]. | 3. The OpenShift persistent volume binder service account will need the ability to read secrets. This ability can be given by creating and assigning an OpenShift cluster role to achieve this. Login into the OpenShift API server as described here: [[OpenShift_on_Azure#oc_login|OpenShift on Azure | oc login]]. | ||
Create the role with: | |||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
oc create clusterrole azure-secret-reader --verb=create,get --resource=secrets | oc create clusterrole azure-secret-reader --verb=create,get --resource=secrets | ||
</syntaxhighlight> | |||
Bind the role to system:serviceaccount:kube-system:persistent-volume-binder with: | |||
<syntaxhighlight lang='bash'> | |||
oc adm policy add-cluster-role-to-user azure-secret-reader system:serviceaccount:kube-system:persistent-volume-binder | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 21:02, 25 November 2020
External
Internal
Procedure
1. Create a storage account with its dedicated resource group. Why? Why can't we use the OpenShift cluster resource group?. Use this:
2. Give the OpenShift service principal "listKey" permission on the new storage account resource group. Assign the "Contributor" role to achieve this.
The OpenShift service principal can be obtained as described here:
Assign the role:
az role assignment create --role Contributor --assignee <openshift-cluster-service-principal> -g <openshift-cluster-resource-group>
For more details about role assignment see:
3. The OpenShift persistent volume binder service account will need the ability to read secrets. This ability can be given by creating and assigning an OpenShift cluster role to achieve this. Login into the OpenShift API server as described here: OpenShift on Azure | oc login.
Create the role with:
oc create clusterrole azure-secret-reader --verb=create,get --resource=secrets
Bind the role to system:serviceaccount:kube-system:persistent-volume-binder with:
oc adm policy add-cluster-role-to-user azure-secret-reader system:serviceaccount:kube-system:persistent-volume-binder