Skip to content

feat(smart-alerting): deploy it with its own Valkey and an OpenBao token (#2352) - #2574

Merged
paruff merged 4 commits into
mainfrom
feat/deploy-smart-alerting
Dec 2, 2026
Merged

paruff merged 4 commits into
mainfrom
feat/deploy-smart-alerting

Conversation

@paruff

@paruff paruff commented Dec 2, 2026

Copy link
Copy Markdown
Owner

smart-alerting is the last thing failing the resources and security planes: with #2573 merged, the latest verification run (46849886601) has 6 of 8 planes green and only Deployment 'smart-alerting' not found red. You asked for it to be deployed (#2352 findings); this does that. Layers: platform/, services/, scripts/.

SECURITY-SENSITIVE (secrets, auth) and an Argo CD Application change (AGENTS.md §6). Needs a human review. Not for the author to merge.

What changes

  • The Application moves from platform/apps-deferred/ to platform/apps/smart-alerting/ and is registered in path-based-applications.yaml (it deploys services/smart-alerting/k8s, image ghcr.io/paruff/smart-alerting:57282ad, which exists in GHCR).
  • Redis: the app raises at startup without it and the fawkes namespace had none. New redis.yaml: a single-replica Valkey 9.2.1 (BSD; Redis 8 is AGPL, and this project moved off Vault for the same reason, ADR-037) behind a Service named redis, non-root (uid 999), read-only root filesystem, all capabilities dropped, in-memory only, no password, cluster-internal. I ran the image locally in Docker with those exact restrictions and it answers PONG.
  • Secret: the empty secret.yaml is deleted. store-secrets.sh generates alerting-api-token (32 random bytes) into OpenBao at fawkes/smart-alerting-secrets, with the three channel credentials left empty for you to fill in; an ExternalSecret creates the Kubernetes Secret.
  • Fail closed: ALERTING_API_TOKEN was optional: true, so a late Secret would start the service with auth off. It is required now; the pod will not start until the Secret exists.
  • Tests: tests/unit/test_smart_alerting_deploy.py (red before, green after); full unit suite 266 passed; render-all-applications.sh: 25 sources, 0 failed; server-side dry run accepted every object in services/smart-alerting/k8s/.

Before merging, run scripts/store-secrets.sh (it keeps existing values and only generates the missing one). Otherwise the pod sits in CreateContainerConfigError until you do, by design.

Not verified live: nothing applied; the Valkey pod and smart-alerting readiness need the sync. Redis has no auth and no NetworkPolicy; the only protection is that it is ClusterIP-only.

Part of #2352.

🤖 Generated with Claude Code

…ken (#2352)

Moves the Application out of apps-deferred and registers it, adds a hardened Valkey behind the Service the app expects (redis), replaces the empty Secret in Git with an ExternalSecret and a generated alerting-api-token, and makes that token required so the pod fails closed instead of starting with auth off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Comment on lines +60 to +93
- name: redis
image: valkey/valkey:9.2.1-alpine
imagePullPolicy: IfNotPresent
args: ["valkey-server", "--save", "", "--appendonly", "no"]
ports:
- name: redis
containerPort: 6379
protocol: TCP
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
readinessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 10
periodSeconds: 15
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data
Comment on lines +38 to +96
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
app.kubernetes.io/name: redis
app.kubernetes.io/version: 9.2.1
app.kubernetes.io/component: cache
app.kubernetes.io/part-of: fawkes
spec:
securityContext:
runAsNonRoot: true
runAsUser: 999
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: redis
image: valkey/valkey:9.2.1-alpine
imagePullPolicy: IfNotPresent
args: ["valkey-server", "--save", "", "--appendonly", "no"]
ports:
- name: redis
containerPort: 6379
protocol: TCP
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
readinessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 10
periodSeconds: 15
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
emptyDir: {}
Comment on lines +38 to +96
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
app.kubernetes.io/name: redis
app.kubernetes.io/version: 9.2.1
app.kubernetes.io/component: cache
app.kubernetes.io/part-of: fawkes
spec:
securityContext:
runAsNonRoot: true
runAsUser: 999
runAsGroup: 1000
fsGroup: 1000
seccompProfile:
type: RuntimeDefault
containers:
- name: redis
image: valkey/valkey:9.2.1-alpine
imagePullPolicy: IfNotPresent
args: ["valkey-server", "--save", "", "--appendonly", "no"]
ports:
- name: redis
containerPort: 6379
protocol: TCP
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
readinessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 10
periodSeconds: 15
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data
volumes:
- name: data
emptyDir: {}
Comment on lines +60 to +93
- name: redis
image: valkey/valkey:9.2.1-alpine
imagePullPolicy: IfNotPresent
args: ["valkey-server", "--save", "", "--appendonly", "no"]
ports:
- name: redis
containerPort: 6379
protocol: TCP
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
readinessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 10
periodSeconds: 15
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data
Comment on lines +60 to +93
- name: redis
image: valkey/valkey:9.2.1-alpine
imagePullPolicy: IfNotPresent
args: ["valkey-server", "--save", "", "--appendonly", "no"]
ports:
- name: redis
containerPort: 6379
protocol: TCP
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 250m
memory: 128Mi
readinessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
exec:
command: ["valkey-cli", "ping"]
initialDelaySeconds: 10
periodSeconds: 15
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: data
mountPath: /data
Comment on lines +108 to +116
app.kubernetes.io/managed-by: argocd
spec:
type: ClusterIP
ports:
- name: redis
port: 6379
targetPort: redis
protocol: TCP
selector:
Comment on lines +108 to +116
app.kubernetes.io/managed-by: argocd
spec:
type: ClusterIP
ports:
- name: redis
port: 6379
targetPort: redis
protocol: TCP
selector:
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Coverage report

This PR does not seem to contain any modification to coverable code.

store-secrets.sh refuses empty values, and the three optional channel credentials were empty strings, so the smart-alerting secret could not be stored. They are optional in the Deployment; only alerting-api-token is generated.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality success
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality success
Shell Tests (BATS) failure
YAML Quality success
Security Integration success
Security Scanning failure

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

1 similar comment
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality success
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality success
Shell Tests (BATS) failure
YAML Quality success
Security Integration success
Security Scanning failure

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

The BATS test asserted exactly 15 stored secrets; smart-alerting-secrets makes 16. Also checks its token is a 64-char generated value.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality success
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality success
Shell Tests (BATS) success
YAML Quality success
Security Integration success
Security Scanning failure

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

2 similar comments
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality success
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality success
Shell Tests (BATS) success
YAML Quality success
Security Integration success
Security Scanning failure

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality success
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality success
Shell Tests (BATS) success
YAML Quality success
Security Integration success
Security Scanning failure

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

The test fixture uses a Spring Boot parent POM which triggers Maven Central
rate limiting (429) during Trivy dependency scanning, causing the Security
Scanning job in the Code Quality workflow to fail. This mirrors the existing
exclusions for templates/java-service/skeleton and services/samples/sample-java-app.

Fixes the Security Scanning / Security Scanning check failure on PR #2574.
@github-actions

github-actions Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

📊 Code Quality Report

Check Status
Python Quality success
Python BDD Acceptance success
Python Integration Collect success
TypeScript Quality skipped
Go Quality skipped
Shell Quality success
Shell Tests (BATS) success
YAML Quality success
Security Integration success
Security Scanning success

📈 Quality Gates

✅ Passed: All checks completed successfully
⚠️ Warning: Some checks have warnings
❌ Failed: Critical issues found

🔧 How to Fix

Run locally before pushing:

make pre-commit-setup  # Install pre-commit hooks
make lint              # Run all linters
make test-bats         # Run shell script tests
pytest --cov=. --cov-report=term-missing  # Check coverage

See Code Quality Standards for more details.

@paruff
paruff merged commit 84cc910 into main Dec 2, 2026
46 checks passed
@paruff
paruff deleted the feat/deploy-smart-alerting branch December 2, 2026 11:25
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.

2 participants