[VMware Tanzu] vCenter sso 유저에게 Tanzu 접근 권한 부여

Seunghyun Moon·2022년 10월 14일
0

vmware

목록 보기
8/9

VMware 인프라를 사용한다면 방대한 리소스 관리를 위해 vCenter를 사용할것이다. VMware에서 k8s 인프라를 지원하기 위해 내놓은 Tanzu 라인 역시 vCenter UI 및 CLI(kubectl-vshpere, tanzucli) 로 편하게 관리할 수 있다.

vCenter 의 사용권한, 글로벌 사용권한이 헷갈리는 부분이었는데, 어느정도 정리가 돼가던 중 글로벌 사용권한이 있는 sso user에도 Tanzu 오브젝트에는 권한이 없는 것을 발견했다.(Administrators 그룹원은 읽기 권한만 있다.)

확인해보니 Tanzu 오브젝트의 사용 권한 에 해당 sso 유저를 추가해줘야한다.

끝. 이 아니고. Tanzu 쪽에서 api 안주나? 자동화시킬 수 있는 방법이 없나? 찾아봤다.
SR 한 결과 아래와 같은 답을 받았다.

Below is my answer on your query:-
Yes, you can give permission to users using kubectl command also, in both supervisor cluster as well as in TKCs. To give permission, you need to create clusterrolebinding/rolebinding inside the cluster.

You can check the role on cluster and bind it with user to give permission:-
1) To check roles in cluster, run below command (where you will also find “admin”, “view”, “edit” role).
 
kubectl get clusterrole
 
kubectl get role -n <namespace>
2) And to assign that role to users, you need to create clusterrolebinding/rolebinding. Refer below doc
Refer https://docs.vmware.com/en/VMware-vSphere/7.0/vmware-vsphere-with-tanzu/GUID-6DE4016E-D51C-4E9B-9F8B-F6577A18F296.html

요약하면 할 수 있다. 링크를 참고해서 하라.
결론적으로 롤바인딩만 해주면 되는거였다.

kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: rolebinding-cluster-user-joe
  namespace: default
roleRef:
  kind: ClusterRole
  name: edit                             #Default ClusterRole
  apiGroup: rbac.authorization.k8s.io
subjects:
- kind: User
  name: sso:joe@vsphere.local            #sso:<username>@<domain>
  apiGroup: rbac.authorization.k8s.io

이게 클러스터롤바인딩이어서, 슈퍼바이저클러스터를 포함한 모든 리소스에 권한이 있어보였다.
각 네임스페이스의 리소스에 접근하려면? 하고 문의했더니, 우문이었다.
생각해보니 롤바인딩을 하면 되는거겠더라.

결론

기존 k8s 지식에서 크게 벗어나지 않는다. 역시 기본기가 중요하다.

profile
I live fullest

0개의 댓글