Repository navigation
Closed
Labels
effort/mediumEffort Mediumpriority/p2-mediumPriority P2: standard workscope/k8sKubernetes commands, Helm charts, pods, services, and policiestype/featureType feature: a new functionvalue/highValue High: the delivery of the item matters much
Description
Problem
Checked on 2026-10-08: release/v0.2.29 at 910b823; the cluster, read-only; the argo-cd chart 10.9.6, Argo CD v3.5.3 and argoproj/notifications-engine.
- The controller is off.
notifications.enabled: false(k8s/argocd/values.yaml:84-85).- Argo CD v3.5.3 (chart 10.9.6) ships the controller, with values for its Secret, notifiers, subscriptions, templates and triggers. The chart sets
notifications.triggers: {}andnotifications.templates: {}, so the catalog's triggers have to be copied in.
- Deploys are checked by hand.
- Argo CD applies every merge into
main, and after a merge a person checks that thedevopsApplication is Synced and Healthy. Image Updater rolls the service image only when a release publishes it, and roadmap-service restarts then (k8s/README.md, "When a pull request merges intomain"). - On 2026-10-07 the Service restarted on its own, two minutes after the ship (fix(roadmap): a shipped release starts the next one without a person: the poll reports the ship, and close and reprioritize run before a capped intake batch #1360), and nothing reported it.
- Argo CD applies every merge into
- A failed sync shows only in Argo CD.
devops argo cd apps statusor the UI shows it. On 2026-10-07 fix(k8s): resolve argocd application out-of-sync and manifest generation failures #1279 found three failed Applications that way, by hand.- Argo CD's metrics aren't scraped:
argocd_app_infohad no series on 2026-10-08. - Metrics for the rest of the platform #551 owns that scrape, and the alerts on lasting OutOfSync or Degraded states.
- Argo CD's Mattermost service would put homelab values in git.
- It needs a bot token, and a channel ID for each subscription (Argo CD docs, "Mattermost").
- Subscriptions live in
notifications.subscriptionsor in Application annotations. Both are in git, and the repository holds no homelab value (fix(k8s): argo cd takes homelab values from deploy-time overrides, and the repository holds no private or placeholder config #1290). - The generic webhook service can read its URL from the notifications Secret.
replaceServiceConfigSecretssubstitutes$<key>in every string of a service's settings (notifications-engine,pkg/api/config.go). push-secrets can write that Secret.
- The controller picks up its Secret without a restart. It reads
argocd-notifications-secretthrough an informer (nc_controller.go:94,:102in v3.5.3), and notifications-engine drops its cached configuration on every change of that Secret (pkg/api/factory.go:60-70). - Only the Mattermost side can block this traffic today.
k8s/argocd/networkpolicy.yamlallows public egress on 80, 443, 22 and 9418, and nothing on 8065 (:67-81). But no Application syncs that file (test_perimeters_in_applications,tests/test_k8s_argocd_apps.py:342-354), and deploy-stack doesn't list it (src/devops_cli/commands/k8s/stack_lifecycle.py:168-194).- Live, namespace
argocdhas only the chart's Ingress-only policies, so its egress is open.
- feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387 turns the same controller on. It sends deploy outcomes to the Service, and defines the notifications configuration both items share.
Acceptance criteria
In the gate. New tests touch no network, and each one's call phase stays under 1 s.
- The shared notifications configuration, as feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387 defines it: whichever of the two items lands first adds it, and the second adds only its own service, template bodies, subscriptions and Secret entry. It holds
notifications.enabled: true,notifications.secret.create: false, an emptynotifications.argocdUrl, the controller's requests and limits, the catalog triggers each item uses, and theargocd/argocd-notifications-secretrow, which restarts nothing. - Service.
notifications.notifiersdeclaresservice.webhook.mattermost, withurl: $mattermost-deploys-url, the headerContent-Type: application/json, andretryMax: 1, for the reason feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387 gives: the controller's one processor re-sends at its 60 s resync anyway. - Triggers and templates. This item uses the catalog's
on-deployedandon-sync-failedtriggers and their templatesapp-deployedandapp-sync-failed, copied from v3.5.3 if feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387 hasn't yet.on-deployedfires once per revision, when the operationSucceededand health isHealthy.on-sync-failedfires when the operation phase isErrororFailed.- Each template gains a
webhook.mattermostbody that POSTs{"text": ...}. The text names the Application and its revision, and for a failure, the operation's message. - Each body is one JSON object whose only value is a
toJsonpipeline, so a quote in a sync message can't break the body. Optional fields are read with sprig'sdigand an empty default, as feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387's are. A test asserts both.
- Subscriptions.
on-sync-failedcovers every Application, throughnotifications.subscriptions, with themattermostwebhook as recipient and no selector.on-deployedcovers only thedevopsApplication, through the annotationnotifications.argoproj.io/subscribe.on-deployed.mattermost: ""ink8s/argocd/apps/devops.yaml.
- The Secret's entry.
argocd/argocd-notifications-secretgains keymattermost-deploys-url, a derived entry (feat(k8s): mattermost team edition runs under argo cd from the mattermost operator, on a cloudnativepg database and a protected volume, at https://mattermost.<domain> through the tunnel #1391) built from the base URL constant and the managed optionmattermost.deploys_hook(keyringmattermost_deploys_hook).- The entry is optional: if the keyring lacks the key, the push skips it with a warning.
--dry-runlists the key with no value.
- Path.
- The
mattermostperimeter admits only the notifications controller on 8065: one peer with namespaceargocdand pod labelapp.kubernetes.io/name: argocd-notifications-controller. This is the rule with a live effect. k8s/argocd/networkpolicy.yamlgains egress to namespacemattermoston 8065, so the file is right once fix(k8s): deploy-stack applies the monitoring namespace perimeter #913's follow-up or feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082 applies it. It has no live effect until then, and the item says so.tests/test_k8s_network_policies.pyasserts both.
- The
- Tests, in
tests/test_k8s_argocd_apps.pyor a newtests/test_k8s_argocd_notifications.py, cover:- the values above;
- the subscription split;
- no channel ID, homelab host or hook key in any value.
- Guide. The "GitOps" section of
k8s/README.mdgains "Notifications":- creating the
deployshook, with "Lock to this channel" ticked; uv run devops config set mattermost.deploys_hook;uv run devops k8s push-secrets --only argocd/argocd-notifications-secret --context <context>;- what posts, and what Metrics for the rest of the platform #551's alerts and feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387's GitHub deployments cover instead.
- creating the
-
uv run devops pr check-readinesspasses. -
uv run devops cipasses within its 5-minute budget.
Pending a person, after merge and after #1391:
- (a) After the push:
kubectl -n argocd rollout status deploy/argocd-notifications-controllersucceeds;- its log has no error for service
mattermost, and never shows a literal$mattermost-deploys-url.
- (b) The next merge into
mainthat changes whatdevopsrenders posts one message indeploys, namingdevopsand the revision. - (c) The next failed sync posts one message with Argo CD's error. Alternatively, force one with a scratch Application that points at a missing path, then delete it.
Key questions
- The webhook service, or Argo CD's Mattermost service? Proposed: the webhook.
- It needs no bot account, no token and no channel ID.
- It follows the same pattern as the other children.
- The cost: plain text, not attachments.
- Through the Service, which feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387 already makes a notifier target? Proposed: no. The Service is down while its pod restarts after each release (feat(release): a release is cut only after every argo cd application builds at the release head and its live changes are shown #1343), and it would only relay the text. feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386's ADR records that Argo CD posts to Mattermost directly.
- Which events? Proposed: deploys of
devops, and any failed sync.- Lasting states (OutOfSync, Degraded) are Metrics for the rest of the platform #551's alerts, delivered through feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392. So each kind of signal has one path, and alerts resolve.
- Every Application's deploys? Proposed: no, only
devops.- Argo CD auto-syncs only an Application that is OutOfSync, so
on-deployedfires only for Applications whose rendered manifests a merge changed. Subscribing all of them would post once per changed Application, often several per merge. devops's changes are the ones a person checks after a merge (k8s/README.md:400-405), and Image Updater sets its service image digest when a release publishes (k8s/argocd/image-updater-values.yaml).- A post means "
devops's manifests changed and it is healthy". That includes perimeter edits, such as those feat(roadmap): a /roadmap slash command in mattermost shows each repository's roadmap service state, answered in-cluster through the service's webhook router #1395 makes, not only a release. - Every Application's outcome is recorded in GitHub by feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387.
- Argo CD auto-syncs only an Application that is OutOfSync, so
- Links to Argo CD? Proposed: none until feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291 gives the homelab host a home outside this public repository.
Strategic alignment
- Priority: P3.
- Deploys and failed syncs are visible in Argo CD today.
- This puts them where the person already looks.
- Value: M. Effort: S.
- Library-first: Argo CD's own notifications controller, catalog triggers and webhook service. The only code is the Secret entry.
- Depends on: feat(k8s): mattermost team edition runs under argo cd from the mattermost operator, on a cloudnativepg database and a protected volume, at https://mattermost.<domain> through the tunnel #1391.
- Blocks: nothing.
- Related:
- feat(k8s): the homelab hosts mattermost, and the cluster's alerts and argo cd deploys post to its channels #1390: the parent;
- feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387: defines the shared notifications configuration and the
retryMaxreasoning, and records every Application's outcome in GitHub; - feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386: its ADR records chat routing;
- feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392: the alerts path for lasting states;
- Metrics for the rest of the platform #551: Argo CD metrics and state alerts;
- fix(k8s): argo cd git-source targetRevision tracks main while service image pin tracks release #1261: Applications track
main; - fix(k8s): resolve argocd application out-of-sync and manifest generation failures #1279: the failures found by hand;
- fix(k8s): argo cd takes homelab values from deploy-time overrides, and the repository holds no private or placeholder config #1290 and feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291: homelab values;
- fix(k8s): deploy-stack applies the monitoring namespace perimeter #913 and feat(k8s): Point Argo CD to Gitea for git and PR dev images #1082: the argocd perimeter, unapplied today;
- feat(release): a release is cut only after every argo cd application builds at the release head and its live changes are shown #1343: the Service's rollout outage.
Proposed design
Problem statement
Argo CD's notifications controller is disabled. Deploy outcomes and failed syncs are visible only in the Argo CD UI or CLI. A person must check them by hand after every merge. This item enables the controller to post devops Application deploy successes and any Application's failed sync to a Mattermost channel through a webhook service.
Acceptance criteria
- Criterion 1: The shared notifications configuration is present in k8s/argocd/values.yaml, with notifications.enabled true, notifications.secret.create false, an empty notifications.argocdUrl, the controller's requests and limits, the catalog triggers, and the argocd/argocd-notifications-secret row.
Verification: Read k8s/argocd/values.yaml and confirm each key is set as stated. Run uv run devops pr check-readiness. - Criterion 2: The webhook service is declared under notifications.notifiers with url $mattermost-deploys-url, header Content-Type application/json, and retryMax 1.
Verification: Read the values file and confirm the service.webhook.mattermost block. Run the new or existing tests in tests/test_k8s_argocd_notifications.py. - Criterion 3: The on-deployed and on-sync-failed triggers and their templates app-deployed and app-sync-failed are defined, each with a webhook.mattermost body that POSTs a JSON object whose only value is a toJson pipeline.
Verification: Read the triggers and templates in the values file. Run the test that asserts both bodies use toJson and dig with an empty default. - Criterion 4: The on-sync-failed subscription covers every Application through notifications.subscriptions with the mattermost webhook and no selector. The on-deployed subscription covers only the devops Application through an annotation in k8s/argocd/apps/devops.yaml.
Verification: Read notifications.subscriptions in the values file and the annotation in k8s/argocd/apps/devops.yaml. Run the subscription-split test. - Criterion 5: The argocd/argocd-notifications-secret gains key mattermost-deploys-url as a derived entry from the base URL constant and the managed option mattermost.deploys_hook. The entry is optional: a missing keyring key skips it with a warning. --dry-run lists the key with no value.
Verification: Run uv run devops k8s push-secrets --only argocd/argocd-notifications-secret --dry-run and confirm the key appears with no value. Confirm the skip-with-warning path in the push-secrets code. - Criterion 6: The mattermost perimeter admits only the notifications controller on port 8065, with pod label app.kubernetes.io/name: argocd-notifications-controller. k8s/argocd/networkpolicy.yaml gains egress to namespace mattermost on 8065.
Verification: Read k8s/argocd/networkpolicy.yaml and the mattermost perimeter. Run tests/test_k8s_network_policies.py. - Criterion 7: Tests in tests/test_k8s_argocd_notifications.py or tests/test_k8s_argocd_apps.py cover the values, the subscription split, and the absence of any channel ID, homelab host or hook key in any value.
Verification: Run uv run devops ci and confirm the new tests pass. Inspect the test file for the three coverage areas. - Criterion 8: The GitOps section of k8s/README.md gains a Notifications subsection with the hook creation steps, the config set command, the push-secrets command, and what posts versus what Metrics for the rest of the platform #551 and feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387 cover.
Verification: Read the Notifications subsection in k8s/README.md and confirm all four points are present. - Criterion 9: uv run devops pr check-readiness passes and uv run devops ci passes within its 5-minute budget.
Verification: Run both commands and confirm exit code 0 within the time limit.
Key questions
- The webhook service, or Argo CD's Mattermost service?: The webhook service. It needs no bot account, no token and no channel ID. It follows the same pattern as the other children. The cost is plain text, not attachments. (proposed) [sources: k8s/argocd/values.yaml]
- Through the Service, which feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387 already makes a notifier target?: No. The Service is down while its pod restarts after each release (feat(release): a release is cut only after every argo cd application builds at the release head and its live changes are shown #1343), and it would only relay the text. feat(service): one webhook router verifies each provider its own way, parses a typed payload and delivers each event only to the consumers subscribed to it #1386's ADR records that Argo CD posts to Mattermost directly. (proposed) [sources: docs/adr/0001-github-is-the-roadmap-source.md]
- Which events?: Deploys of devops, and any failed sync. Lasting states (OutOfSync, Degraded) are Metrics for the rest of the platform #551's alerts, delivered through feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392. Each kind of signal has one path. (proposed) [sources: k8s/README.md]
- Every Application's deploys?: No, only devops. Argo CD auto-syncs only an Application that is OutOfSync, so on-deployed fires only for Applications whose rendered manifests a merge changed. devops's changes are the ones a person checks after a merge. Every Application's outcome is recorded in GitHub by feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387. (proposed) [sources: k8s/README.md, k8s/argocd/image-updater-values.yaml]
- Links to Argo CD?: None until feat(k8s): Read homelab config from in-cluster Gitea, drop overrides #1291 gives the homelab host a home outside this public repository. (proposed) [sources: k8s/README.md]
Open questions
- It needs no bot account, no token and no channel ID.
- It follows the same pattern as the other children.
- The cost: plain text, not attachments.
- Lasting states (OutOfSync, Degraded) are Metrics for the rest of the platform #551's alerts, delivered through feat(k8s): alertmanager posts critical and warning alerts to mattermost's alerts channel, and a roadmap service repository whose rounds all fail for an hour alerts #1392. So each kind of signal has one path, and alerts resolve.
- Argo CD auto-syncs only an Application that is OutOfSync, so
on-deployedfires only for Applications whose rendered manifests a merge changed. Subscribing all of them would post once per changed Application, often several per merge. devops's changes are the ones a person checks after a merge (k8s/README.md:400-405), and Image Updater sets its service image digest when a release publishes (k8s/argocd/image-updater-values.yaml).- A post means "
devops's manifests changed and it is healthy". That includes perimeter edits, such as those feat(roadmap): a /roadmap slash command in mattermost shows each repository's roadmap service state, answered in-cluster through the service's webhook router #1395 makes, not only a release. - Every Application's outcome is recorded in GitHub by feat(k8s): argo cd records each single-source github application's deploy outcome as a github deployment on the synced commit, through its own deployments-only github app #1387.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Metadata
Metadata
Assignees
Labels
effort/mediumEffort Mediumpriority/p2-mediumPriority P2: standard workscope/k8sKubernetes commands, Helm charts, pods, services, and policiestype/featureType feature: a new functionvalue/highValue High: the delivery of the item matters much
Type
Projects
- StatusShow more project fieldsNew
- StatusShow more project fieldsNew
Activity
dan-petty-bot commentedon Oct 8, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
Improves operational visibility and removes a manual check, but the cluster functions without it and no incident is blocked.Reduces the chance of missed failed syncs or unreported restarts, but the team can still detect issues via Argo CD UI or metrics once dan-petty/devops-cli#551 lands.Requires enabling the controller, defining the Mattermost service, triggers, templates, subscriptions, and wiring the Secret via push-secrets, but the chart already ships the controller and the Secret-informer path is confirmed.dan-petty commentedon Oct 8, 2026
The '#913 follow-up' this item names is #1371 (v0.2.31), which applies
k8s/argocd/networkpolicy.yaml; whichever lands second rebases on the file. Found by the 2026-10-08 backlog review.dan-petty commentedon Oct 26, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
This item improves operational visibility and automation but is not critical or urgent.It provides valuable real-time feedback on deployments and sync failures, improving team responsiveness.Implementation requires configuring notifications engine, secrets, and network policies, which is moderately complex.Both items involve Argo CD notifications but the candidate focuses on Mattermost while dan-petty/homelab#330 focuses on GitHub notifications.dan-petty commentedon Oct 28, 2026
Refine cannot set this item to Ready at d509dba until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
on-deployedfires only for Applications whose rendered manifests a merge changed. Subscribing all of them would post once per changed Application, often several per merge.devops's changes are the ones a person checks after a merge (k8s/README.md:400-405), and Image Updater sets its service image digest when a release publishes (k8s/argocd/image-updater-values.yaml).devops's manifests changed and it is healthy". That includes perimeter edits, such as those feat(roadmap): a /roadmap slash command in mattermost shows each repository's roadmap service state, answered in-cluster through the service's webhook router #1395 makes, not only a release.feat(k8s): push the Argo CD notifier App's IDs and key (#2608)
feat(k8s): derived push entries, Secret types, one stack list (#2618)