본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Mattermost 알림 서비스

원문 보기 위키 갱신

Argo Rollouts의 알림 기능을 Mattermost와 연동하는 방법이에요. Mattermost 봇 토큰을 Secret에 저장하고 ConfigMap에 서비스를 구성한 뒤, 애플리케이션 어노테이션에 구독(subscription)을 등록하면 배포 이벤트를 채널로 받아볼 수 있습니다.

출처: Argo Rollouts 문서

본문

파라미터 (Parameters)

  • apiURL - 서버 URL, 예: https://mattermost.example.com
  • token - 봇 토큰
  • insecureSkipVerify - 선택 사항, bool (true 또는 false)
  • maxIdleConns - 선택 사항, 모든 호스트에 걸친 최대 유휴(keep-alive) 연결 수
  • maxIdleConnsPerHost - 선택 사항, 호스트당 최대 유휴(keep-alive) 연결 수
  • maxConnsPerHost - 선택 사항, 호스트당 최대 총 연결 수
  • idleConnTimeout - 선택 사항, 유휴(keep-alive) 연결이 닫히기 전에 유지되는 최대 시간, 예: '90s'

구성 (Configuration)

  • 봇 계정을 만들고 생성 후 토큰을 복사합니다.
  • 팀을 초대합니다.
  • 토큰을 argo-rollouts-notification-secret Secret에 저장하고 argo-rollouts-notification-configmap ConfigMap에 Mattermost 통합을 구성합니다.
apiVersion: v1
kind: ConfigMap
metadata:
  name: argo-rollouts-notification-configmap
data:
  service.mattermost: |
    apiURL: <api-url>
    token: $mattermost-token
apiVersion: v1
kind: Secret
metadata:
  name: <secret-name>
stringData:
  mattermost-token: token
  • 채널 id를 복사합니다.
  • Mattermost 통합을 위한 구독(subscription)을 만듭니다.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  annotations:
    notifications.argoproj.io/subscribe.<trigger-name>.mattermost: <channel-id>

템플릿 (Templates)

![IMAGE]

slack의 템플릿을 재사용할 수 있습니다. Mattermost는 Slack의 attachments와 호환됩니다. Mattermost 통합 가이드를 참조하세요.

template.app-deployed: |
  message: |
    Application {{.app.metadata.name}} is now running new version of deployments manifests.
  mattermost:
    attachments: |
      [{
        "title": "{{.app.metadata.name}}",
        "title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
        "color": "#18be52",
        "fields": [{
          "title": "Sync Status",
          "value": "{{.app.status.sync.status}}",
          "short": true
        }, {
          "title": "Repository",
          "value": "{{.app.spec.source.repoURL}}",
          "short": true
        }]
      }]

더 알아보기 (Learn more)

  • Argo Rollouts 알림(Notifications) 시스템 개요
  • Slack 알림 서비스 구성
  • 알림 구독을 위한 어노테이션 설정
  • 알림 템플릿 커스터마이징