argocd와 github oauth 연동하기
github oauth를 위해 oauth app을 생성 해야 합니다
Settings > Developer Settings > OAuth App
아래의 값들을 설정합니다.
- Application Name: 사용하고 싶은 OAuth app 이름 ex) my-argocd
- Homepage URL: Argo CD 홈페이지 주소 ex) argocd.com
- Authorization callback URL: https://argocd.com/api/dex/callback
Client ID와 Client Secret을 잘 기록합니다. 특히 Secret은 생성할때만 보입니다.
argocd가 설치된 namespace에 접근하여 argocd-cm이라는 ConfigMap을 수정합니다.
data:
url: https://argocd.com
dex.config: |
connectors:
- type: github
id: github
name: GitHub
config:
clientID: # GitHub Oauth에서 만든 ID
clientSecret: # GitHub Oauth에서 만든 Secret
orgs:
- name: # GitHub Org
team: # 접속을 허용할 팀이 있는 경우 설정
- admin
그리고 argocd-rbac-cm 이라는 ConfigMap을 수정합니다.
data:
policy.csv: |
p, role:github-role, applications, *, */*, allow
p, role:github-role, clusters, get, *, allow
p, role:github-role, repositories, get, *, allow
g, GitHubORG:GitHubTeam, role:github-role
g, GitHubORG:admin, role:admin
policy.default: role:readonly