Skip to content

Conversation

@tombojer
Copy link

@tombojer tombojer commented Jun 4, 2025

This pull request introduces a new notification service for NATS, adding support for sending messages via NATS.

Parameters

This notification service is capable of sending simple messages via Nats.

  • Url - Nats server URL, e.g. nats://nats:4222
  • Headers - optional, additional headers to be sent with the message
  • User - optional, Nats user for authentication used in combination with password
  • Password - optional, Nats password for authentication used in combination with user
  • Nkey - optional, Nats key for authentication

Example

Resource Annotation:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-deployment
  annotations:
    notifications.argoproj.io/subscribe.on-deployment-ready.nats: "mytopic"
  • ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-notifications-cm
data:
  service.nats: |
    url: "nats://nats:4222"
    headers:
      my-header: "my-value"

template.deployment-ready: |
    message: |
      Deployment {{.obj.metadata.name}} is ready!

  trigger.on-deployment-ready: |
    - when: any(obj.status.conditions, {.type == 'Available' && .status == 'True'})
      send: [deployment-ready]
    - oncePer: obj.metadata.annotations["generation"]

@tombojer tombojer force-pushed the add-nats-service branch from c95cb55 to fd5ecec Compare June 4, 2025 10:53
Signed-off-by: Tom Bojer <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant