Argo CD instance Red Hat OpenShift GitOps 1.15 Installing and deploying Argo CD instances, enabling notifications with an Argo CD instance, and configuring the NotificationsConfiguration CR Red Hat OpenShift Documentation Team

Commands:
apiVersion: argoproj.io/v1beta1 kind: ArgoCD metadata: name: example namespace: openshift-gitops spec: server: route: enabled: true
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: openshift-gitops-operator namespace: openshift-gitops-operator spec: config: env: - name: CONTROLLER_CLUSTER_ROLE value: gitops-controller-role 1 - name: SERVER_CLUSTER_ROLE value: gitops-server-role 2
apiVersion: argoproj.io/v1beta1 kind: ArgoCD metadata: name: example-argocd labels: example: repo spec: repo: replicas: <number_of_replicas> server: replicas: <number_of_replicas> route: enabled: true path: / tls: insecureEdgeTerminationPolicy: Redirect termination: passthrough wildcardPolicy: None
oc label namespace <namespace> argocd.argoproj.io/managed-by=<namespace> 1
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: openshift-gitops-operator spec: config: env: - name: DISABLE_DEFAULT_ARGOCD_CONSOLELINK value: 'true'
apiVersion: argoproj.io/v1beta1 kind: ArgoCD metadata: name: openshift-gitops spec: notifications: enabled: true #.
patch argocd openshift-gitops -n openshift-gitops --type merge --patch '{"spec": {"notifications": {"enabled": true}}}'
apiVersion: argoproj.io/v1alpha1 kind: NotificationsConfiguration metadata: name: default-notifications-configuration 1 spec: templates: template.my-custom-template: | 2 message: | Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
apiVersion: argoproj.io/v1alpha1 kind: NotificationsConfiguration metadata: name: default-notifications-configuration 1 spec: triggers: trigger.on-sync-status-unknown: | 2 - when: app.status.sync.status == 'Unknown' send: [my-custom-template]
apiVersion: argoproj.io/v1alpha1 kind: NotificationsConfiguration metadata: name: default-notifications-configuration 1 spec: Services: service.slack: | token: USDslack-token 2 username: <override-username> # optional username icon: <override-icon> # optional icon for the message (supports both emoji and url notation)
apiVersion: argoproj.io/v1alpha1 kind: NotificationsConfiguration metadata: name: default-notifications-configuration 1 spec: Subscriptions: | subscriptions: | 2 # subscription for on-sync-status-unknown trigger notifications - recipients: - slack:test2 - email:test@gmail.com triggers: - on-sync-status-unknown # subscription restricted to applications with matching labels only - recipients: - slack:test3 selector: test=true triggers: - on-sync-status-unknown icon: <override-icon> # optional icon for the message (supports both emoji and url notation)
template.my-custom-template: | message: | Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
oc edit notificationsconfiguration default-notifications-configuration -n <namespace>
template.my-custom-template: | message: | Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
oc edit cm argocd-notifications-cm -n <namespace>