Opsgenie
argocd-notifications로 알림을 보내려면 Opsgenie 팀 안에 API Integration을 만들어야 합니다. 아래 안내를 따라 Opsgenie 통합을 구성한 뒤 알림 설정을 적용하세요.
출처: Argo Rollouts 문서
본문
argocd-notifications로 알림을 보내려면 Opsgenie 팀 안에 API Integration을 만들어야 합니다.
- Opsgenie에 로그인합니다: https://app.opsgenie.com 또는 (유럽연합 계정이라면) https://app.eu.opsgenie.com
- 팀이 이미 있는지 확인합니다. 없다면 다음 가이드를 따르세요: https://docs.opsgenie.com/docs/teams
- 왼쪽 메뉴에서 "Teams"를 클릭합니다.
- 알림을 보내려는 팀을 선택합니다.
- 팀의 구성 메뉴에서 "Integrations"를 선택합니다.
- 오른쪽 상단에서 "Add Integration"을 클릭합니다.
- "API" 통합을 선택합니다.
- 통합에 이름을 지정하고 "API key"를 복사해 나중에 사용할 수 있도록 저장합니다.
- 통합 설정에서 "Edit"을 클릭합니다.
- "Create and Update Access" 체크박스가 선택되어 있는지 확인하고, 불필요한 권한을 제거하기 위해 다른 체크박스는 비활성화합니다.
- 하단의 "Save"를 클릭합니다.
- 오른쪽 상단에서 "Turn on integration"을 클릭합니다.
- 브라우저에서 올바른 서버 apiURL을 확인합니다. "app.opsgenie.com"이면 US/국제 API URL api.opsgenie.com을 사용하고, 그렇지 않으면 api.eu.opsgenie.com(유럽 API)을 사용합니다.
- Opsgenie 구성이 끝났습니다. 이제 argocd-notifications를 구성해야 합니다. apiUrl, 팀 이름, apiKey를 사용해 argo-rollouts-notification-secret 시크릿에 Opsgenie 통합을 구성합니다.
- 예제 argo-rollouts-notification-configmap 구성은 아래에서 찾을 수 있습니다.
| Option | Required | Type | Description | Example |
|---|---|---|---|---|
description |
True | string |
일반적으로 알림에 대한 상세 정보를 제공하는 데 사용되는 알림의 description 필드. | Hello from Argo CD! |
priority |
False | string |
알림의 우선순위. 가능한 값은 P1, P2, P3, P4, P5이며 기본값은 P3. | P1 |
alias |
False | string |
클라이언트가 정의한 알림 식별자이며 Alert De-Duplication의 핵심 요소. | Life is too short for no alias |
note |
False | string |
알림 생성 시 추가되는 추가 메모. | Error from Argo CD! |
actions |
False | []string |
알림에서 사용할 수 있는 사용자 지정 작업. | ["Resolve", "Escalate"] |
tags |
False | []string |
알림의 태그. | ["critical", "deployment"] |
visibleTo |
False | []alert.Responder |
알림을 보내지 않고도 알림이 보이는 팀과 사용자. 각 항목에는 type 필드가 필수이며 값은 team과 user입니다. type 외에 팀은 id 또는 name 중 하나를, 사용자는 id 또는 username 중 하나를 제공해야 합니다. 알림은 기본적으로 responders 필드에 지정된 팀에 표시되므로 visibleTo 필드에 다시 지정할 필요가 없습니다. |
[{Type: "team", Id: "team_id"}, {Type: "user", Id: "user_id"}] |
details |
False | map[string]string |
알림의 사용자 지정 속성으로 사용할 키-값 쌍의 맵. | {"environment": "production", "service": "web"} |
entity |
False | string |
알림이 관련된 도메인을 지정하는 데 일반적으로 사용되는 알림의 entity 필드. | web-server |
user |
False | string |
요청 소유자의 표시 이름. | admin_user |
apiVersion: v1
kind: ConfigMap
metadata:
name: argo-rollouts-notification-configmap
data:
service.opsgenie: |
apiUrl: <api-url>
apiKeys:
<your-team>: <integration-api-key>
template.opsgenie: |
message: |
[Argo CD] Application {{.app.metadata.name}} has a problem.
opsgenie:
description: |
Application: {{.app.metadata.name}}
Health Status: {{.app.status.health.status}}
Operation State Phase: {{.app.status.operationState.phase}}
Sync Status: {{.app.status.sync.status}}
priority: P1
alias: {{.app.metadata.name}}
note: Error from Argo CD!
actions:
- Restart
- AnExampleAction
tags:
- OverwriteQuietHours
- Critical
visibleTo:
- Id: "{{.app.metadata.responderId}}"
Type: "team"
- Name: "rocket_team"
Type: "team"
- Id: "{{.app.metadata.responderUserId}}"
Type: "user"
- Username: "trinity@opsgenie.com"
Type: "user"
details:
environment: production
service: web
entity: Argo CD Application
user: John Doe
trigger.on-a-problem: |
- description: Application has a problem.
send:
- opsgenie
when: app.status.health.status == 'Degraded' or app.status.operationState.phase in ['Error', 'Failed'] or app.status.sync.status == 'Unknown'
- 특정 Argo CD 앱에 대해 알림을 활성화하려면 애플리케이션 YAML 파일에 어노테이션을 추가합니다.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
annotations:
notifications.argoproj.io/subscribe.on-a-problem.opsgenie: <your-team>
더 알아보기 (Learn more)
- Telegram 알림 서비스 — Telegram으로 알림 보내기
- AWS SQS 알림 서비스 — SQS 큐로 메시지 보내기
- notifications trigger — 트리거 조회·평가
- Controller Metrics — 롤아웃 상태 모니터링