오늘은 ArgoCD Slack Notification Setting 을 해보았다.
참고사이트
https://argocd-notifications.readthedocs.io/en/stable/services/slack/
https://argocd-notifications.readthedocs.io/en/stable/catalog/#triggers
slack configuration
1. noti 를 보낼 slack app 생성
https://api.slack.com/apps
2. 1 에서 생성한 slack app 에 write 권한 추가
OAuth & Permissions 탭에서 Scopes 추가
chat:write:bot 항목 추가
3. Install App to Workspace
noti 를 받을 workspace 에 앱 추가
해당 과정에서 OAuth Access Token 은 아래 kubernetes configuration 에서 사용함
kubenetes configuration
1. argocd 에서 제공하는 notification 패키지 다운로드
https://argocd-notifications.readthedocs.io/en/stable/
$ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/release-1.0/manifests/install.yaml
$ kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/release-1.0/catalog/install.yaml
2. slack secret 을 등록하기 위한 configmap 생성
# argocd-notifications-secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: argocd-notifications-secret
stringData:
slack-token: {"slack application secret token"}
3. argocd configmap 에 등록
$ kubectl apply -f argocd-notifications-secret.yaml
4. argocd configmap 수정
$ kubectl edit cm argocd-notifications-cm -n argocd
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: v1
data:
service.slack: |
token: {"slack application secret token"}
5. argoCD 에서 noti 설정
Name 에는 slack noti trigger, value 에는 채널명을 기입
trigger 참고사이트
- https://argocd-notifications.readthedocs.io/en/stable/catalog/#app-health-degraded
key value 참고사이트
- https://argocd-notifications.readthedocs.io/en/stable/upgrading/0.x-1.0/#recipientsubscription-annotation
예시
Name: notifications.argoproj.io/subscribe.on-health-degraded.slack
Value: argo_noti_channel
최근댓글