From 07dee784673862b1d6858412373471e426c575e0 Mon Sep 17 00:00:00 2001 From: Andres Morelos Date: Thu, 13 Aug 2026 16:12:05 -0500 Subject: [PATCH] fix(k8s): stop hardcoding the CloudWatch logging annotations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #223. Five annotations were literals in both deployment templates: the CloudWatch gate plus the log group, retention, stream name pattern and region. Every pod in every account therefore shipped to CloudWatch, under `.`, kept for exactly 7 days — and none of it could change without editing this repository. They are removed rather than made configurable here. All five are the logs controller's inputs, and whoever owns an account's logging setup already stamps annotations through k8s_modifiers.deployment.annotations; splitting them across two layers would mean two sources for one decision. Keeping them in one place is also what allows the gate and the naming to disagree in only one direction: a pod that nothing annotates ships nowhere, which is the right outcome for an account with no logging provider. The templates still render `annotations:` and the modifier merges, so an override supplies the same keys with the same values it used to get from here — verified against a real render. Also drops a bug: scheduled_task hardcoded `region: us-east-1` rather than deriving it from the context like the k8s template did, so every scheduled task outside that region named the wrong CloudWatch region. BREAKING: a cluster relying on these templates to stamp `nullplatform.logs.cloudwatch: 'true'` stops shipping application logs until an override injects the gate. --- CHANGELOG.md | 1 + k8s/deployment/templates/deployment.yaml.tpl | 6 ------ scheduled_task/deployment/templates/deployment.yaml.tpl | 6 ------ 3 files changed, 1 insertion(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3eae3cca..3ad5d4f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +- Remove unused cloudwatch annotations from deployment objects ## [1.15.0] - 2026-08-10 - Fix: **finalize** and **rollback** on blue/green k8s scopes now wait until the load balancer sends all traffic to the surviving deployment before deleting the other one, preventing the 5xx window that happened when it was deleted mid-switch (these actions may take slightly longer as a result) diff --git a/k8s/deployment/templates/deployment.yaml.tpl b/k8s/deployment/templates/deployment.yaml.tpl index 0ce3af0b..92c08298 100644 --- a/k8s/deployment/templates/deployment.yaml.tpl +++ b/k8s/deployment/templates/deployment.yaml.tpl @@ -74,12 +74,6 @@ spec: {{- end }} {{- end }} annotations: - nullplatform.logs.cloudwatch: 'true' - nullplatform.logs.cloudwatch.log_group_name: {{ .namespace.slug }}.{{ .application.slug }} - nullplatform.logs.cloudwatch.log_stream_log_retention_days: '7' - nullplatform.logs.cloudwatch.log_stream_name_pattern: >- - type=${type};application={{ .application.id }};scope={{ .scope.id }};deploy={{ .deployment.id }};instance=${instance};container=${container} - nullplatform.logs.cloudwatch.region: {{ .region }} {{- $global := index .k8s_modifiers "global" }} {{- if $global }} {{- $annotations := index $global "annotations" }} diff --git a/scheduled_task/deployment/templates/deployment.yaml.tpl b/scheduled_task/deployment/templates/deployment.yaml.tpl index c556acfd..ef797236 100644 --- a/scheduled_task/deployment/templates/deployment.yaml.tpl +++ b/scheduled_task/deployment/templates/deployment.yaml.tpl @@ -96,12 +96,6 @@ spec: {{- end }} {{- end }} annotations: - nullplatform.logs.cloudwatch: 'true' - nullplatform.logs.cloudwatch.log_group_name: {{ .namespace.slug }}.{{ .application.slug }} - nullplatform.logs.cloudwatch.log_stream_log_retention_days: '7' - nullplatform.logs.cloudwatch.log_stream_name_pattern: >- - type=${type};application={{ .application.id }};scope={{ .scope.id }};deploy={{ .deployment.id }};instance=${instance};container=${container} - nullplatform.logs.cloudwatch.region: us-east-1 {{- $global := index .k8s_modifiers "global" }} {{- if $global }} {{- $annotations := index $global "annotations" }}