When multiple teams share one ACK One GitOps instance, unscoped accounts can access any project's repositories, clusters, and applications. Define ArgoCD local users and Project-scoped Role-Based Access Control (RBAC) rules to confine each team to its own resources, and then verify the permission model.
Table of contents
Permission model

Use cases
User | Role | Resource scope | Permissions |
admin | super administrator | All resources |
|
team01-admin | project administrator | Project team01 | Query, create, modify, or delete Project-level resources such as repositories. |
team02-admin | project administrator | Project team02 | Query, create, modify, or delete Project-level resources such as repositories. |
team01-user01 | application administrator | team01/production-app | Query, create, modify, or delete the team01/production-app application. |
team01-user02 | application administrator | team01/staging-app | Query, create, modify, or delete the team01/staging-app application. |
Configure multi-tenant permissions for ACK One GitOps
Edit the ArgoCD
argocd-cmConfigMap:kubectl edit cm argocd-cm -n argocdIn the
argocd-cmConfigMap, add the local users:data: accounts.team01-admin: login accounts.team01-admin.enabled: "true" accounts.team01-user01: login accounts.team01-user01.enabled: "true" accounts.team01-user02: login accounts.team01-user02.enabled: "true" accounts.team02-admin: login accounts.team02-admin.enabled: "true"Edit the ArgoCD
argocd-rbac-cmConfigMap:kubectl edit cm argocd-rbac-cm -n argocdIn the
argocd-rbac-cmConfigMap, add the following content to configure RBAC rules for the local users:Log in to ArgoCD with the admin account, view the local users, and set a password for each local user.
View the local users:
export ARGOCD_OPTS='--port-forward-namespace argocd --port-forward' argocd account listExpected output:
NAME ENABLED CAPABILITIES admin true apiKey, login team01-admin true login team01-user01 true login team01-user02 true login team02-admin true loginSet a password for a local user:
argocd account update-password --account <username> --current-password <current password> --new-password <new password>
Log in to ArgoCD with the admin account and add global repositories:
argocd repo add https://code.aliyun.com/bigteam/echo-server01.git argocd repo add https://code.aliyun.com/bigteam/echo-server02.git argocd repo list TYPE NAME REPO INSECURE OCI LFS CREDS STATUS MESSAGE PROJECT git https://code.aliyun.com/bigteam/echo-server01.git false false false false Successful git https://code.aliyun.com/bigteam/echo-server02.git false false false false SuccessfulLog in to ArgoCD with the admin account and run the following commands to create and configure Project team01 and Project team02.
Category
Git repository
Cluster
Resources that Project team01 can use
https://code.aliyun.com/bigteam/echo-server01.githttps://47.111.XX.XX:6443Resources that Project team02 can use
https://code.aliyun.com/bigteam/echo-server02.githttps://47.97.XX.XX:6443argocd proj create team01 argocd proj add-source team01 https://code.aliyun.com/bigteam/echo-server01.git argocd proj add-destination team01 https://47.111.XX.XX:6443 "*" argocd proj create team02 argocd proj add-source team02 https://code.aliyun.com/bigteam/echo-server02.git argocd proj add-destination team02 https://47.97.XX.XX:6443 "*"Use the team01-admin and team02-admin accounts to create repositories in the projects.
team01-admin
Log in as the team01-admin user:
argocd login Username: team01-admin Password: 'team01-admin:login' logged in successfully Context 'port-forward' updatedCreate a repository in Project team01:
argocd repo add https://code.aliyun.com/team01/echo-server.git --project team01Expected output:
Repository 'https://code.aliyun.com/team01/echo-server.git' added
team02-admin
Log in as the team02-admin user:
argocd login Username: team02-admin Password: 'team02-admin:login' logged in successfully Context 'port-forward' updatedCreate a repository in Project team02:
argocd repo add https://code.aliyun.com/team02/echo-server.git --project team02Expected output:
Repository 'https://code.aliyun.com/team02/echo-server.git' added
Verify the permission model for ACK One GitOps
Verify the permissions on projects
Verify the permissions of team01-admin on projects:
argocd account can-i create projects "*"
no
argocd account can-i update projects "team01"
no
argocd account can-i delete projects "team01"
no
argocd account can-i get projects "team01"
yes
argocd account can-i get projects "team02"
noThe preceding output indicates that the project administrator can only view Project team01 and has no other permissions.
Verify the permissions on repositories
Verify the permissions of team01-admin on repositories:
argocd account can-i create repositories "*"
no
argocd account can-i update repositories "*"
no
argocd account can-i delete repositories "*"
no
argocd account can-i get repositories "*"
yes
argocd account can-i create repositories "team01/*"
yes
argocd account can-i update repositories "team01/*"
yes
argocd account can-i delete repositories "team01/*"
yes
argocd account can-i get repositories "team01/*"
yesThe preceding output indicates that the project administrator can only view global repositories, and can query, create, modify, and delete repositories in Project team01.
Verify the permissions on clusters
Verify the permissions of team01-admin on clusters:
argocd account can-i create clusters "*"
no
argocd account can-i update clusters "*"
no
argocd account can-i delete clusters "*"
no
argocd account can-i get clusters "*"
yes
argocd account can-i create clusters "team01/*"
no
argocd account can-i update clusters "team01/*"
no
argocd account can-i delete clusters "team01/*"
noThe preceding output indicates that the project administrator can only view global clusters and has no other permissions.
Verify the permissions on applications
Verify the permissions of team01-admin on applications:
argocd account can-i create applications "*"
no
argocd account can-i update applications "*"
no
argocd account can-i delete applications "*"
no
argocd account can-i get applications "*"
no
argocd account can-i create applications "team01/*"
yes
argocd account can-i update applications "team01/*"
yes
argocd account can-i delete applications "team01/*"
yes
argocd account can-i get applications "team01/*"
yesThe preceding output indicates that the project administrator can only query, create, modify, and delete applications in Project team01, and has no other permissions.
Verify the permissions to create applications
View the permissions of the team01-admin user on Project team01:
Accessible repositories:
Global
Repositories:https://code.aliyun.com/bigteam/echo-server01.git.Project-scoped
Scoped Repositories:https://code.aliyun.com/team01/echo-server.git.
Accessible cluster:
https://47.111.XX.XX:6443.
argocd proj get team01 Name: team01 Description: Destinations: https://47.111.XX.XX:6443,* Repositories: https://code.aliyun.com/bigteam/echo-server01.git Scoped Repositories: https://code.aliyun.com/team01/echo-server.git Allowed Cluster Resources: <none> Scoped Clusters: <none> Denied Namespaced Resources: <none> Signature keys: <none> Orphaned Resources: disabledCreate an application outside Project team01:
argocd app create team01-admin-echo-server --repo https://code.aliyun.com/bigteam/echo-server01.git --dest-namespace team01-admin-echo-server --dest-server https://47.111.XX.XX:6443Expected output:
FATA[0001] rpc error: code = PermissionDenied desc = permission denied: applications, create, default/team01-admin-echo-server, sub: team01-admin, iat: 2022-10-20T03:20:47ZThe preceding output indicates that the system failed to create an application outside Project team01.
Create an application by using an unauthorized repository and cluster:
argocd app create team01-admin-echo-server --project team01 --repo https://code.aliyun.com/bigteam/echo-server02.git --path manifests/directory/production --dest-namespace team01-admin-echo-server --dest-server https://47.97.XX.XX:6443Expected output:
FATA[0002] rpc error: code = InvalidArgument desc = application spec for team01-admin-echo-server is invalid: InvalidSpecError: application repo https://code.aliyun.com/bigteam/echo-server02.git is not permitted in project 'team01';InvalidSpecError: application destination {https://xx.xx.xx.xx:6443 team01-admin-echo-server} is not permitted in project 'team01The preceding output indicates that the system failed to create an application by using an unauthorized repository and cluster.
Create an application within Project team01 by using a permitted repository and cluster:
argocd app create team01-admin-echo-server --project team01 --repo https://code.aliyun.com/bigteam/echo-server01.git --path manifests/directory/production --dest-namespace team01-admin-echo-server --dest-server https://47.111.XX.XX:6443Expected output:
application 'team01-admin-echo-server' createdThe preceding output indicates that the system has created an application in Project team01.