Argo Rollouts Google Chat 알림
Argo Rollouts의 알림 서비스 중 하나인 Google Chat 통합 설정을 소개합니다. Google Chat 웹훅(webhook)으로 메시지 알림을 보내는 방식이며, 웹훅 설정부터 ConfigMap/Secret 구성, 구독 생성, 그리고 텍스트·카드 메시지 템플릿 작성까지 단계별로 설명합니다.
출처: Argo Rollouts 문서
본문
파라미터 (Parameters)
Google Chat 알림 서비스는 google chat 웹훅으로 메시지 알림을 보냅니다. 이 서비스는 다음 설정을 사용합니다:
webhooks-webhookName: webhookUrl형태의 맵
구성 (Configuration)
Google chat을 열고 메시지를 보내려는 스페이스(space)로 이동합니다- 페이지 상단의 메뉴에서 Configure Webhooks 를 선택합니다
- Incoming Webhooks 아래에서 Add Webhook 을 클릭합니다
- 웹훅에 이름을 지정하고, 선택적으로 이미지를 추가한 뒤 Save 를 클릭합니다
- 웹훅 옆에 있는 URL을 복사합니다
- URL을
argocd-notification-secret에 저장하고argo-rollouts-notification-configmap에 선언합니다
apiVersion: v1
kind: ConfigMap
metadata:
name: argo-rollouts-notification-configmap
data:
service.googlechat: |
webhooks:
spaceName: $space-webhook-url
apiVersion: v1
kind: Secret
metadata:
name: <secret-name>
stringData:
space-webhook-url: https://chat.googleapis.com/v1/spaces/<space_id>/messages?key=<key>&token=<token>
- 스페이스에 대한 구독(subscription)을 생성합니다
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
notifications.argoproj.io/subscribe.on-sync-succeeded.googlechat: spaceName
템플릿 (Templates)
Google Chat 스페이스에 단순 텍스트 또는 카드 메시지를 보낼 수 있습니다. 단순 텍스트 메시지 템플릿은 다음과 같이 정의할 수 있습니다:
template.app-sync-succeeded: |
message: The app {{ .app.metadata.name }} has successfully synced!
카드 메시지는 다음과 같이 정의할 수 있습니다:
template.app-sync-succeeded: |
googlechat:
cardsV2: |
- header:
title: ArgoCD Bot Notification
sections:
- widgets:
- decoratedText:
text: The app {{ .app.metadata.name }} has successfully synced!
- widgets:
- decoratedText:
topLabel: Repository
text: {{ call .repo.RepoURLToHTTPS .app.spec.source.repoURL }}
- decoratedText:
topLabel: Revision
text: {{ .app.spec.source.targetRevision }}
- decoratedText:
topLabel: Author
text: {{ (call .repo.GetCommitMetadata .app.status.sync.revision).Author }}
모든 Card 필드가 지원되며 알림에 사용할 수 있습니다. 이전(현재는 deprecated) cards 키를 사용해 레거시 카드 필드를 사용하는 것도 가능하지만, Google이 이 필드를 deprecated 처리하고 더 새로운 cardsV2를 권장하므로 추천하지 않습니다.
카드 메시지는 JSON으로도 작성할 수 있습니다.
채팅 스레드 (Chat Threads)
스레드에 고유한 키를 지정하면 채팅 스레드에서 단순 텍스트와 카드 메시지를 모두 보낼 수 있습니다. 스레드 키는 다음과 같이 정의할 수 있습니다:
template.app-sync-succeeded: |
message: The app {{ .app.metadata.name }} has successfully synced!
googlechat:
threadKey: {{ .app.metadata.name }}
더 알아보기 (Learn more)
- Argo Rollouts 알림 (Notifications) — 알림 시스템 전반 이해
- Argo Rollouts Pushover 알림 — 또 다른 알림 서비스 통합
- Google Chat 메시지 형식 — 텍스트·카드 메시지 작성
- Google Chat 웹훅 설정 — 웹훅 생성 방법