Notification slack
slack 설정













argocd에 설치하기
subscribe trigger
Application
Project

command line으로
Last updated














Last updated
mkdir -p core/argocd-notifications
cd core/argocd-notificationsapiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/v1.1.1/manifests/install.yaml
patches:
- path: https://raw.githubusercontent.com/argoproj-labs/argocd-notifications/v1.1.1/catalog/install.yaml
target:
kind: ConfigMap
name: argocd-notifications-cm
- path: slack-secret.yml
target:
kind: Secret
name: argocd-notifications-secret
patchesStrategicMerge:
- slack-configmap.ymlapiVersion: v1
data:
service.slack: |
token: $slack-token
kind: ConfigMap
metadata:
name: argocd-notifications-cmapiVersion: v1
kind: Secret
metadata:
name: argocd-notifications-secret
stringData:
slack-token: YOUR-TOKEN
type: OpaqueapiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: argocd-notifications
spec:
destination:
name: ''
namespace: argocd
server: 'https://kubernetes.default.svc'
source:
path: apps/core/argocd-notifications
repoURL: 'git@github.com:xxxxx/xxxx.git'
targetRevision: HEAD
project: default
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=truekubectl apply -f add-apps/argocd-notifications.ymlkubectl edit application AAA -n argocdapiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
# 여기만 추가
annotations:
notifications.argoproj.io/subscribe.on-sync-succeeded.slack: my_channelkubectl get AppProjects -n argocdkubectl edit appProject default -n argocdapiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
# 여기만 추가
annotations:
notifications.argoproj.io/subscribe.on-sync-succeeded.slack: my-channel1;my-channel2metadata:
annotations:
notifications.argoproj.io/subscribe.on-sync-succeeded.slack: argocdkubectl patch AppProjects default -n argocd --patch "$(cat trigger.yaml)" --type=merge