5 min to read
Setting up ArgoCD Notifications with Slack
A comprehensive guide to implementing ArgoCD Notifications with Slack

Understanding ArgoCD Notifications
ArgoCD Notifications is an official component that provides real-time notifications for various ArgoCD events. It helps teams stay informed about application deployments, sync status, and health conditions through multiple notification channels including Slack, Email, and Microsoft Teams.
What is ArgoCD Notifications?
ArgoCD Notifications enables:
- Event Monitoring: Tracks application sync status, health conditions, and deployment states
- Multi-channel Alerts: Supports Slack, Email, Microsoft Teams, and Webhooks
- Customizable Templates: Allows detailed and formatted notification messages
- Flexible Triggers: Configurable conditions for notification delivery
This component is essential for maintaining operational awareness and enabling quick response to deployment issues.
Setting up Slack Integration
Integrating ArgoCD Notifications with Slack requires creating a Slack app and configuring it with appropriate permissions. This section guides you through the setup process.
Prerequisites
Required Components
- ArgoCD installed in your Kubernetes cluster
- Slack workspace with admin permissions
- Kubernetes cluster access for configuration
- Helm for ArgoCD installation (optional)
Slack App Configuration
Slack App Setup Steps:
1. Create App
Description: Create a new Slack app Details:
- Visit api.slack.com/apps
- Click “Create New App”
- Choose “From scratch”
2. Add Permissions
Description: Configure OAuth scopes Details:
- chat:write
- chat:write.customize
3. Install App
Description: Install to workspace Details:
- Click “Install to Workspace”
- Authorize the app
- Copy Bot User OAuth Token
ArgoCD Configuration
Configure ArgoCD to use Slack notifications by updating the Helm values or applying the configuration directly to the cluster.
Helm Values Configuration
notifications:
enabled: true
secret:
create: true
items:
slack-token: "xoxb-your-token"
notifiers:
service.slack: |
token: $slack-token
username: ArgoCD
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
channel: "#argocd-alarm"
Notification Templates
template: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Application:* {{.app.metadata.name}}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*URL:* {{ .app.metadata.name}} - {{.context.argocdUrl}}/applications/{{.app.metadata.name}}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Sync Status:* {{.app.status.sync.status}}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Health Status:* {{.app.status.health.status}}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Namespace:* {{.app.spec.destination.namespace}}"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*Revision:* {{.app.status.sync.revision}}"
}
}
]
}
Triggers and Subscriptions
triggers:
trigger.on-deployed: |
- description: Application is synced and healthy
send:
- app-deployed
when: |
app.status.operationState.phase == 'Succeeded' and
app.status.health.status == 'Healthy'
subscriptions:
- recipients:
- slack:#argocd-alarm
triggers:
- on-deployed
Advanced Configuration
Enhance your notification setup with advanced configurations for different scenarios and conditions.
Additional Templates
Template | Trigger Condition | Use Case |
---|---|---|
Health Degraded | app.status.health.status == 'Degraded' | Application health issues |
Sync Failed | app.status.operationState.phase in ['Error', 'Failed'] | Deployment failures |
Out of Sync | app.status.sync.status == 'OutOfSync' | Configuration drift |
Best Practices
- Channel Organization: Use dedicated channels for different environments
- Message Formatting: Include relevant links and context
- Error Handling: Provide detailed error messages
- Testing: Verify notifications before production use
Troubleshooting
Common Issues and Solutions:
1. No Notifications: - Verify Slack token validity
- Check channel permissions
- Confirm trigger conditions
2. Template Errors: - Validate template syntax
- Check variable references
- Review Slack formatting
3. Permission Issues: - Verify Slack app scopes
- Check channel access
- Review bot permissions
Debug Commands
# Check notification controller logs
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-notifications-controller
# Verify configuration
kubectl get cm argocd-notifications-cm -n argocd -o yaml
# Test notification
kubectl patch application <app-name> -n argocd --type merge -p '{"metadata":{"annotations":{"notifications.argoproj.io/subscribe.on-deployed.slack":"#argocd-alarm"}}}'
Key Points
-
Core Features
- Real-time event monitoring
- Multi-channel notifications
- Customizable templates
- Flexible triggers -
Configuration
- Slack app setup
- Template definition
- Trigger conditions
- Channel subscriptions -
Best Practices
- Organized channels
- Clear messages
- Error handling
- Regular testing
Comments