Repository navigation
feat(smart-alerting): deploy it with its own Valkey and an OpenBao token (#2352) - #2574
Conversation
…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>
| - 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 |
| 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: {} |
| 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: {} |
| - 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 |
| - 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 |
| app.kubernetes.io/managed-by: argocd | ||
| spec: | ||
| type: ClusterIP | ||
| ports: | ||
| - name: redis | ||
| port: 6379 | ||
| targetPort: redis | ||
| protocol: TCP | ||
| selector: |
| app.kubernetes.io/managed-by: argocd | ||
| spec: | ||
| type: ClusterIP | ||
| ports: | ||
| - name: redis | ||
| port: 6379 | ||
| targetPort: redis | ||
| protocol: TCP | ||
| selector: |
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>
📊 Code Quality Report
📈 Quality Gates✅ Passed: All checks completed successfully 🔧 How to FixRun 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 coverageSee Code Quality Standards for more details. |
1 similar comment
📊 Code Quality Report
📈 Quality Gates✅ Passed: All checks completed successfully 🔧 How to FixRun 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 coverageSee 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>
📊 Code Quality Report
📈 Quality Gates✅ Passed: All checks completed successfully 🔧 How to FixRun 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 coverageSee Code Quality Standards for more details. |
2 similar comments
📊 Code Quality Report
📈 Quality Gates✅ Passed: All checks completed successfully 🔧 How to FixRun 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 coverageSee Code Quality Standards for more details. |
📊 Code Quality Report
📈 Quality Gates✅ Passed: All checks completed successfully 🔧 How to FixRun 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 coverageSee 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.
📊 Code Quality Report
📈 Quality Gates✅ Passed: All checks completed successfully 🔧 How to FixRun 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 coverageSee Code Quality Standards for more details. |
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 foundred. 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
platform/apps-deferred/toplatform/apps/smart-alerting/and is registered inpath-based-applications.yaml(it deploysservices/smart-alerting/k8s, imageghcr.io/paruff/smart-alerting:57282ad, which exists in GHCR).fawkesnamespace had none. Newredis.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 namedredis, 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 answersPONG.secret.yamlis deleted.store-secrets.shgeneratesalerting-api-token(32 random bytes) into OpenBao atfawkes/smart-alerting-secrets, with the three channel credentials left empty for you to fill in; anExternalSecretcreates the Kubernetes Secret.ALERTING_API_TOKENwasoptional: 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/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 inservices/smart-alerting/k8s/.Before merging, run
scripts/store-secrets.sh(it keeps existing values and only generates the missing one). Otherwise the pod sits inCreateContainerConfigErroruntil 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