Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
b0ef0d1
Red Hat Konflux update ambient-code-backend-main
Apr 6, 2026
78f5c9d
Red Hat Konflux update ambient-code-frontend-main
Apr 6, 2026
70ba199
Red Hat Konflux update ambient-code-operator-main
Apr 6, 2026
ac9edd5
Red Hat Konflux update ambient-code-public-api-main
Apr 6, 2026
2d9a3ca
removing label vendor value
maknop Apr 7, 2026
c5b4bae
Merge pull request #16 from RedHatInsights/update_vendor_value
wcmitchell Apr 7, 2026
b44e31e
Red Hat Konflux update ambient-code-ambient-api-server-main
Apr 6, 2026
d9c2e14
Merge pull request #3 from RedHatInsights/konflux-ambient-code-backen…
maknop Apr 7, 2026
c93ad06
Merge pull request #4 from RedHatInsights/konflux-ambient-code-fronte…
maknop Apr 7, 2026
a38898d
Merge pull request #5 from RedHatInsights/konflux-ambient-code-operat…
maknop Apr 7, 2026
37fb2ab
Merge pull request #6 from RedHatInsights/konflux-ambient-code-public…
maknop Apr 7, 2026
03a447b
Merge pull request #7 from RedHatInsights/konflux-ambient-code-ambien…
maknop Apr 7, 2026
f91ae6e
Red Hat Konflux update ambient-code-ambient-runner-main
Apr 8, 2026
083ded9
fixing file copy to container
maknop Apr 9, 2026
f49b567
Merge pull request #30 from RedHatInsights/konflux-ambient-code-ambie…
maknop Apr 9, 2026
f519b91
Add app-interface overlay for AppSRE platform deployment
wcmitchell Apr 10, 2026
8639118
Add app-interface overlay for AppSRE platform deployment
wcmitchell Apr 10, 2026
c631f34
Merge pull request #34 from RedHatInsights/ambient-code-app-interface…
maknop Apr 10, 2026
5162154
Add OpenShift Templates for AppSRE deployment
wcmitchell Apr 11, 2026
2f79829
Merge branch 'main' into add-openshift-template
wcmitchell Apr 12, 2026
c5b41a3
Merge pull request #35 from RedHatInsights/add-openshift-template
wcmitchell Apr 12, 2026
3471461
fix: correct OpenShift Template objects array format
wcmitchell Apr 13, 2026
1257427
Merge pull request #37 from RedHatInsights/fix-template-objects-array
wcmitchell Apr 13, 2026
c040bb7
refactor: remove in-cluster services from template
wcmitchell Apr 13, 2026
3b3f0fc
Merge pull request #38 from RedHatInsights/remove-in-cluster-services
wcmitchell Apr 13, 2026
2f251bb
updating postgresql db name
maknop Apr 13, 2026
21b201d
Merge pull request #39 from RedHatInsights/api_server_secret_name
wcmitchell Apr 13, 2026
7ecd3c7
enabling ssl mode for rds
maknop Apr 15, 2026
9c2b0f6
Merge pull request #40 from RedHatInsights/rds_ssl_enable
wcmitchell Apr 15, 2026
6e36009
fix: disable OpenTelemetry metrics export in operator
maknop Apr 15, 2026
8e9ca5e
Merge pull request #42 from RedHatInsights/otel_exporter_disable
wcmitchell Apr 15, 2026
71683a5
enabling ssl mode for rds
maknop Apr 15, 2026
4dd36fe
Merge pull request #43 from RedHatInsights/ssl_rds_enable
wcmitchell Apr 15, 2026
97ebefa
Add OAuth proxy and SSL/TLS configuration for app-interface overlay
wcmitchell Apr 17, 2026
6e7ee36
Merge pull request #44 from RedHatInsights/app-interface-oauth-and-ssl
wcmitchell Apr 17, 2026
79ed385
Remove in-cluster services from template-services.yaml
wcmitchell Apr 17, 2026
1b026f4
Merge pull request #45 from RedHatInsights/fix-remove-in-cluster-serv…
wcmitchell Apr 17, 2026
a81ec1f
Fix OAuth proxy configuration to use OpenShift service account auth
wcmitchell Apr 20, 2026
2ea1cc2
Merge pull request #46 from RedHatInsights/update_oauth_sidecar_template
maknop Apr 20, 2026
2d400d7
Exclude ambient-code-rds secret from services template
wcmitchell Apr 20, 2026
f923806
Merge pull request #47 from RedHatInsights/fix-exclude-rds-secret
wcmitchell Apr 20, 2026
67d4d13
fix: fix frontent route termination
wcmitchell Apr 20, 2026
97feae7
Merge pull request #48 from RedHatInsights/update_frontent_route_term…
wcmitchell Apr 20, 2026
f89514d
fix: revert https changes for oauth pods
wcmitchell Apr 20, 2026
dbfea85
Merge pull request #49 from RedHatInsights/more_frontend_tweaks
wcmitchell Apr 20, 2026
5ce42d3
Change TLS termination from reencrypt to edge
wcmitchell Apr 20, 2026
6ca642c
Change health check scheme from HTTPS to HTTP
wcmitchell Apr 20, 2026
2ae85d0
Update upstream URL to use frontend service
wcmitchell Apr 20, 2026
f15ada3
Enable request logging in OAuth proxy configuration
wcmitchell Apr 20, 2026
22229ce
Update OAuth redirect reference for frontend service account
wcmitchell Apr 20, 2026
88d0604
Update Vertex AI credentials to use app-interface Vault secret
wcmitchell Apr 21, 2026
5a01b54
Merge pull request #50 from RedHatInsights/update_token_secret_ref
wcmitchell Apr 21, 2026
c8c52ad
Fix OAuth proxy to pass access token to backend API
wcmitchell Apr 21, 2026
d8ec1ae
Merge pull request #51 from RedHatInsights/update_oauth_args
wcmitchell Apr 21, 2026
f7a43e7
Update OAuth proxy configuration options
wcmitchell Apr 21, 2026
4e5efe3
Remove authorization header setting from template
wcmitchell Apr 21, 2026
26825fb
updating ambient env to production
maknop Apr 21, 2026
0dabcaa
Merge pull request #52 from RedHatInsights/api_server_env_update
maknop Apr 21, 2026
868e653
Add pass-user-bearer-token option to template-services.yaml
wcmitchell Apr 21, 2026
ef594bf
Update template-services.yaml
wcmitchell Apr 21, 2026
5f59d1b
Fix OAuth proxy to forward user tokens to frontend/backend
wcmitchell Apr 21, 2026
82631b0
Merge pull request #53 from RedHatInsights/mount_cookie_secret
wcmitchell Apr 21, 2026
130db34
Update openshift-delegate-urls configuration
wcmitchell Apr 21, 2026
f047289
removing openshift-delegate-urls
maknop Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
586 changes: 586 additions & 0 deletions .tekton/ambient-code-ambient-api-server-main-pull-request.yaml

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions .tekton/ambient-code-ambient-api-server-main-push.yaml

Large diffs are not rendered by default.

582 changes: 582 additions & 0 deletions .tekton/ambient-code-ambient-runner-main-pull-request.yaml

Large diffs are not rendered by default.

579 changes: 579 additions & 0 deletions .tekton/ambient-code-ambient-runner-main-push.yaml

Large diffs are not rendered by default.

586 changes: 586 additions & 0 deletions .tekton/ambient-code-backend-main-pull-request.yaml

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions .tekton/ambient-code-backend-main-push.yaml

Large diffs are not rendered by default.

586 changes: 586 additions & 0 deletions .tekton/ambient-code-frontend-main-pull-request.yaml

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions .tekton/ambient-code-frontend-main-push.yaml

Large diffs are not rendered by default.

586 changes: 586 additions & 0 deletions .tekton/ambient-code-operator-main-pull-request.yaml

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions .tekton/ambient-code-operator-main-push.yaml

Large diffs are not rendered by default.

586 changes: 586 additions & 0 deletions .tekton/ambient-code-public-api-main-pull-request.yaml

Large diffs are not rendered by default.

583 changes: 583 additions & 0 deletions .tekton/ambient-code-public-api-main-push.yaml

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion components/ambient-api-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ EXPOSE 8000
ENTRYPOINT ["/usr/local/bin/ambient-api-server", "serve"]

LABEL name="ambient-api-server" \
vendor="Ambient" \
version="0.0.1" \
summary="Ambient API Server" \
description="REST API server for the Ambient Code Platform"
2 changes: 1 addition & 1 deletion components/ambient-api-server/templates/db-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ parameters:
description: The name of the OpenShift Service exposed for the database.
displayName: Database Service Name
required: true
value: ambient-api-server-db
value: ambient-code-rds

- name: DATABASE_USER
description: Username for PostgreSQL user that will be used for accessing the database.
Expand Down
4 changes: 2 additions & 2 deletions components/manifests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ manifests/
│ ├── platform/ # Cluster-level resources
│ │ ├── namespace.yaml
│ │ ├── ambient-api-server-db.yml # ambient-api-server PostgreSQL deployment
│ │ └── ambient-api-server-secrets.yml # Secret template (values injected per-env)
│ │ └── ambient-api-server-secrets.yml # Secret template (ambient-code-rds secret for DB)
│ ├── crds/ # Custom Resource Definitions
│ │ ├── agenticsessions-crd.yaml
│ │ └── projectsettings-crd.yaml
Expand Down Expand Up @@ -121,7 +121,7 @@ Components are opt-in kustomize modules included via the `components:` block in
|---|---|---|
| `oauth-proxy` | Adds OpenShift OAuth proxy sidecar to frontend | `production` |
| `postgresql-rhel` | Patches PostgreSQL to use `registry.redhat.io/rhel10/postgresql-16` | `production`, `local-dev` |
| `ambient-api-server-db` | Same RHEL patch for the ambient-api-server's dedicated DB | `production`, `local-dev` |
| `ambient-api-server-db` | RHEL patch for ambient-api-server DB (updates ambient-code-rds secret refs) | `production`, `local-dev` |
| `postgresql-init-scripts` | ConfigMap + volume for DB init SQL (vanilla postgres only) | `kind`, `e2e` |

## Building and Validating
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ spec:
volumes:
- name: db-secrets
secret:
secretName: ambient-api-server-db
secretName: ambient-code-rds
- name: app-secrets
secret:
secretName: ambient-api-server
Expand Down
5 changes: 3 additions & 2 deletions components/manifests/base/core/operator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ spec:
# - name: DEFAULT_INACTIVITY_TIMEOUT
# value: "86400" # Default inactivity timeout in seconds (24h). Set to 0 to disable.
# OpenTelemetry configuration
- name: OTEL_EXPORTER_OTLP_ENDPOINT
value: "otel-collector.ambient-code.svc:4317" # Deploy OTel collector separately
# Disabled: OTel collector not deployed. Uncomment when collector is available.
# - name: OTEL_EXPORTER_OTLP_ENDPOINT
# value: "otel-collector.ambient-code.svc:4317" # Deploy OTel collector separately
Comment on lines 125 to +128
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

❓ Verification inconclusive

Script executed:

#!/bin/bash
# Expectation: production overlays that need metrics should define OTEL_EXPORTER_OTLP_ENDPOINT.
rg -n -C3 'OTEL_EXPORTER_OTLP_ENDPOINT|otel-collector' components/manifests components/operator

Repository: ambient-code/platform


Repository: ambient-code/platform
Exit code: 0

stdout:

components/operator/internal/controller/otel_metrics.go-46-)
components/operator/internal/controller/otel_metrics.go-47-
components/operator/internal/controller/otel_metrics.go-48-// InitMetrics initializes OpenTelemetry metrics.
components/operator/internal/controller/otel_metrics.go:49:// Set OTEL_EXPORTER_OTLP_ENDPOINT to configure the collector address.
components/operator/internal/controller/otel_metrics.go-50-// Leave unset or empty to disable metrics export (no-op).
components/operator/internal/controller/otel_metrics.go-51-func InitMetrics(ctx context.Context) (func(), error) {
components/operator/internal/controller/otel_metrics.go-52-	// Get OTLP endpoint from environment; skip if not configured
components/operator/internal/controller/otel_metrics.go:53:	endpoint := os.Getenv("OTEL_EXPORTER_OTLP_ENDPOINT")
components/operator/internal/controller/otel_metrics.go-54-	if endpoint == "" {
components/operator/internal/controller/otel_metrics.go:55:		log.Println("OTEL_EXPORTER_OTLP_ENDPOINT not set, metrics export disabled")
components/operator/internal/controller/otel_metrics.go-56-		return func() {}, nil
components/operator/internal/controller/otel_metrics.go-57-	}
components/operator/internal/controller/otel_metrics.go-58-
--
components/manifests/observability/base/servicemonitor.yaml-1-apiVersion: monitoring.coreos.com/v1
components/manifests/observability/base/servicemonitor.yaml-2-kind: ServiceMonitor
components/manifests/observability/base/servicemonitor.yaml-3-metadata:
components/manifests/observability/base/servicemonitor.yaml:4:  name: ambient-otel-collector
components/manifests/observability/base/servicemonitor.yaml-5-  namespace: ambient-code
components/manifests/observability/base/servicemonitor.yaml-6-  labels:
components/manifests/observability/base/servicemonitor.yaml:7:    app: otel-collector
components/manifests/observability/base/servicemonitor.yaml-8-    # Required for OpenShift User Workload Monitoring to discover this ServiceMonitor
components/manifests/observability/base/servicemonitor.yaml-9-    openshift.io/cluster-monitoring: "true"
components/manifests/observability/base/servicemonitor.yaml-10-spec:
components/manifests/observability/base/servicemonitor.yaml-11-  selector:
components/manifests/observability/base/servicemonitor.yaml-12-    matchLabels:
components/manifests/observability/base/servicemonitor.yaml:13:      app: otel-collector
components/manifests/observability/base/servicemonitor.yaml-14-  endpoints:
components/manifests/observability/base/servicemonitor.yaml-15-  - port: prometheus
components/manifests/observability/base/servicemonitor.yaml-16-    interval: 30s
--
components/manifests/observability/base/kustomization.yaml-4-namespace: ambient-code
components/manifests/observability/base/kustomization.yaml-5-
components/manifests/observability/base/kustomization.yaml-6-resources:
components/manifests/observability/base/kustomization.yaml:7:  - otel-collector.yaml
components/manifests/observability/base/kustomization.yaml-8-  - servicemonitor.yaml
--
components/manifests/observability/README.md-109-### OTel Collector Logs
components/manifests/observability/README.md-110-
components/manifests/observability/README.md-111-```bash
components/manifests/observability/README.md:112:kubectl logs -n ambient-code -l app=otel-collector -f
components/manifests/observability/README.md-113-```
components/manifests/observability/README.md-114-
components/manifests/observability/README.md-115-## Production Setup
--
components/manifests/observability/README.md-147-
components/manifests/observability/README.md-148-2. **Check ServiceMonitor is discovered**:
components/manifests/observability/README.md-149-   ```bash
components/manifests/observability/README.md:150:   oc get servicemonitor ambient-otel-collector -n ambient-code
components/manifests/observability/README.md:151:   oc describe servicemonitor ambient-otel-collector -n ambient-code
components/manifests/observability/README.md-152-   ```
components/manifests/observability/README.md-153-
components/manifests/observability/README.md-154-3. **Check OTel Collector is receiving metrics**:
components/manifests/observability/README.md-155-   ```bash
components/manifests/observability/README.md:156:   kubectl logs -n ambient-code -l app=otel-collector | grep -i "metric"
components/manifests/observability/README.md-157-   ```
components/manifests/observability/README.md-158-
components/manifests/observability/README.md-159-4. **Check operator is sending metrics**:
--
components/manifests/observability/README.md-163-
components/manifests/observability/README.md-164-5. **Test direct query to OTel Collector**:
components/manifests/observability/README.md-165-   ```bash
components/manifests/observability/README.md:166:   kubectl port-forward svc/otel-collector 8889:8889 -n ambient-code
components/manifests/observability/README.md-167-   curl http://localhost:8889/metrics | grep ambient
components/manifests/observability/README.md-168-   ```
components/manifests/observability/README.md-169-
--
components/manifests/observability/base/otel-collector.yaml-1-apiVersion: v1
components/manifests/observability/base/otel-collector.yaml-2-kind: ConfigMap
components/manifests/observability/base/otel-collector.yaml-3-metadata:
components/manifests/observability/base/otel-collector.yaml:4:  name: otel-collector-config
components/manifests/observability/base/otel-collector.yaml-5-data:
components/manifests/observability/base/otel-collector.yaml:6:  otel-collector-config.yaml: |
components/manifests/observability/base/otel-collector.yaml-7-    receivers:
components/manifests/observability/base/otel-collector.yaml-8-      otlp:
components/manifests/observability/base/otel-collector.yaml-9-        protocols:
--
components/manifests/observability/base/otel-collector.yaml-49-apiVersion: apps/v1
components/manifests/observability/base/otel-collector.yaml-50-kind: Deployment
components/manifests/observability/base/otel-collector.yaml-51-metadata:
components/manifests/observability/base/otel-collector.yaml:52:  name: otel-collector
components/manifests/observability/base/otel-collector.yaml-53-  labels:
components/manifests/observability/base/otel-collector.yaml:54:    app: otel-collector
components/manifests/observability/base/otel-collector.yaml-55-spec:
components/manifests/observability/base/otel-collector.yaml-56-  replicas: 1
components/manifests/observability/base/otel-collector.yaml-57-  selector:
components/manifests/observability/base/otel-collector.yaml-58-    matchLabels:
components/manifests/observability/base/otel-collector.yaml:59:      app: otel-collector
components/manifests/observability/base/otel-collector.yaml-60-  template:
components/manifests/observability/base/otel-collector.yaml-61-    metadata:
components/manifests/observability/base/otel-collector.yaml-62-      labels:
components/manifests/observability/base/otel-collector.yaml:63:        app: otel-collector
components/manifests/observability/base/otel-collector.yaml-64-    spec:
components/manifests/observability/base/otel-collector.yaml-65-      containers:
components/manifests/observability/base/otel-collector.yaml:66:      - name: otel-collector
components/manifests/observability/base/otel-collector.yaml-67-        image: otel/opentelemetry-collector-contrib:0.94.0
components/manifests/observability/base/otel-collector.yaml-68-        args:
components/manifests/observability/base/otel-collector.yaml:69:          - "--config=/conf/otel-collector-config.yaml"
components/manifests/observability/base/otel-collector.yaml-70-        ports:
components/manifests/observability/base/otel-collector.yaml-71-        - containerPort: 4317
components/manifests/observability/base/otel-collector.yaml-72-          name: otlp-grpc
--
components/manifests/observability/base/otel-collector.yaml-87-      volumes:
components/manifests/observability/base/otel-collector.yaml-88-      - name: config
components/manifests/observability/base/otel-collector.yaml-89-        configMap:
components/manifests/observability/base/otel-collector.yaml:90:          name: otel-collector-config
components/manifests/observability/base/otel-collector.yaml-91-
components/manifests/observability/base/otel-collector.yaml-92----
components/manifests/observability/base/otel-collector.yaml-93-apiVersion: v1
components/manifests/observability/base/otel-collector.yaml-94-kind: Service
components/manifests/observability/base/otel-collector.yaml-95-metadata:
components/manifests/observability/base/otel-collector.yaml:96:  name: otel-collector
components/manifests/observability/base/otel-collector.yaml-97-  labels:
components/manifests/observability/base/otel-collector.yaml:98:    app: otel-collector
components/manifests/observability/base/otel-collector.yaml-99-spec:
components/manifests/observability/base/otel-collector.yaml-100-  selector:
components/manifests/observability/base/otel-collector.yaml:101:    app: otel-collector
components/manifests/observability/base/otel-collector.yaml-102-  ports:
components/manifests/observability/base/otel-collector.yaml-103-  - port: 4317
components/manifests/observability/base/otel-collector.yaml-104-    name: otlp-grpc
--
components/manifests/base/core/operator-deployment.yaml-124-        #   value: "86400"  # Default inactivity timeout in seconds (24h). Set to 0 to disable.
components/manifests/base/core/operator-deployment.yaml-125-        # OpenTelemetry configuration
components/manifests/base/core/operator-deployment.yaml-126-        # Disabled: OTel collector not deployed. Uncomment when collector is available.
components/manifests/base/core/operator-deployment.yaml:127:        # - name: OTEL_EXPORTER_OTLP_ENDPOINT
components/manifests/base/core/operator-deployment.yaml:128:        #   value: "otel-collector.ambient-code.svc:4317"  # Deploy OTel collector separately
components/manifests/base/core/operator-deployment.yaml-129-        - name: DEPLOYMENT_ENV
components/manifests/base/core/operator-deployment.yaml-130-          value: "production"
components/manifests/base/core/operator-deployment.yaml-131-        - name: VERSION
--
components/manifests/base/core/public-api-deployment.yaml-37-        - name: RATE_LIMIT_BURST
components/manifests/base/core/public-api-deployment.yaml-38-          value: "200"
components/manifests/base/core/public-api-deployment.yaml-39-        # OpenTelemetry configuration (optional)
components/manifests/base/core/public-api-deployment.yaml:40:        # - name: OTEL_EXPORTER_OTLP_ENDPOINT
components/manifests/base/core/public-api-deployment.yaml:41:        #   value: "http://otel-collector:4318"
components/manifests/base/core/public-api-deployment.yaml-42-        # - name: OTEL_ENABLED
components/manifests/base/core/public-api-deployment.yaml-43-        #   value: "true"
components/manifests/base/core/public-api-deployment.yaml-44-        # CORS configuration (optional, defaults to common dev origins)

Metrics disabled by default in the production base deployment.

OTEL_EXPORTER_OTLP_ENDPOINT is commented out, so the operator disables metrics export unless an overlay restores it. The OTel collector infrastructure exists in components/manifests/observability/base/, but the core operator deployment won't use it without the environment variable set. Either uncomment the endpoint or make it overlay-provided so production deployments don't lose observability silently.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/manifests/base/core/operator-deployment.yaml` around lines 125 -
128, The operator deployment currently has the OTEL_EXPORTER_OTLP_ENDPOINT
environment variable commented out, which disables metrics export by default;
update the operator deployment manifest to either uncomment and set
OTEL_EXPORTER_OTLP_ENDPOINT to the observability collector address
("otel-collector.ambient-code.svc:4317") in the core operator Deployment spec
(the env entry named OTEL_EXPORTER_OTLP_ENDPOINT) or move this env var into a
production overlay so the base stays neutral but overlays enable observability;
ensure the env name OTEL_EXPORTER_OTLP_ENDPOINT is present in the container spec
(containers[].env) so the operator can export metrics to the OTel collector.

- name: DEPLOYMENT_ENV
value: "production"
- name: VERSION
Expand Down
6 changes: 3 additions & 3 deletions components/manifests/base/platform/ambient-api-server-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ spec:
valueFrom:
secretKeyRef:
key: db.user
name: ambient-api-server-db
name: ambient-code-rds
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
key: db.password
name: ambient-api-server-db
name: ambient-code-rds
- name: POSTGRES_DB
valueFrom:
secretKeyRef:
key: db.name
name: ambient-api-server-db
name: ambient-code-rds
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
volumeMounts:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: Secret
metadata:
name: ambient-api-server-db
name: ambient-code-rds
labels:
app: ambient-api-server
component: database
Expand Down
15 changes: 15 additions & 0 deletions components/manifests/base/rbac/frontend-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ kind: ServiceAccount
metadata:
name: frontend
namespace: ambient-code
annotations:
serviceaccounts.openshift.io/oauth-redirectreference.frontend: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"frontend"}}'
Comment on lines +6 to +7
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

OAuth redirect reference target doesn't exist.

reference.name: "frontend" doesn't match the actual Route name frontend-route defined in components/manifests/overlays/app-interface/route.yaml and components/manifests/templates/template-operator.yaml. Update to frontend-route to avoid redirect_uri validation failures on OAuth callback.

🔧 Proposed fix
-    serviceaccounts.openshift.io/oauth-redirectreference.frontend: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"frontend"}}'
+    serviceaccounts.openshift.io/oauth-redirectreference.frontend: '{"kind":"OAuthRedirectReference","apiVersion":"v1","reference":{"kind":"Route","name":"frontend-route"}}'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/manifests/base/rbac/frontend-rbac.yaml` around lines 6 - 7, The
OAuth redirect reference annotation
serviceaccounts.openshift.io/oauth-redirectreference.frontend currently
references reference.name "frontend" which doesn't match the actual Route;
update the annotation's reference.name value from "frontend" to "frontend-route"
so it matches the Route resource (ensure the annotation JSON string inside
frontend-rbac.yaml uses "frontend-route" for reference.name).

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand All @@ -28,3 +30,16 @@ subjects:
- kind: ServiceAccount
name: frontend
namespace: ambient-code
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: ambient-frontend-oauth-delegator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:auth-delegator
subjects:
- kind: ServiceAccount
name: frontend
namespace: ambient-code
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@
- name: POSTGRESQL_USER
valueFrom:
secretKeyRef:
name: ambient-api-server-db
name: ambient-code-rds
key: db.user
- name: POSTGRESQL_PASSWORD
valueFrom:
secretKeyRef:
name: ambient-api-server-db
name: ambient-code-rds
key: db.password
- name: POSTGRESQL_DATABASE
valueFrom:
secretKeyRef:
name: ambient-api-server-db
name: ambient-code-rds
key: db.name
- op: replace
path: /spec/template/spec/containers/0/volumeMounts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ spec:
- name: PGHOST
valueFrom:
secretKeyRef:
name: ambient-api-server-db
name: ambient-code-rds
key: db.host
- name: PGUSER
valueFrom:
secretKeyRef:
name: ambient-api-server-db
name: ambient-code-rds
key: db.user
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: ambient-api-server-db
name: ambient-code-rds
key: db.password
- name: PGDATABASE
valueFrom:
secretKeyRef:
name: ambient-api-server-db
name: ambient-code-rds
key: db.name
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component

# Requires: ambient-api-server-db Secret in the target namespace
# Requires: ambient-code-rds Secret in the target namespace

patches:
- path: ambient-api-server-db-json-patch.yaml
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Patch for production frontend deployment
# - Adds OAuth proxy sidecar for authentication
# - Adds OAuth proxy sidecar for authentication using OpenShift OAuth
# - Uses service account token for cookie secret (no vault secret needed)
# - Overrides resource limits to prevent OOMKills (sawtooth memory pattern)
apiVersion: apps/v1
kind: Deployment
Expand All @@ -20,19 +21,17 @@ spec:
cpu: 1000m
# OAuth proxy sidecar
- name: oauth-proxy
image: quay.io/openshift/origin-oauth-proxy:4.14
image: registry.redhat.io/openshift4/ose-oauth-proxy-rhel9:v4.18.0-202506230505.p0.gcbd44ad.assembly.stream.el9
imagePullPolicy: IfNotPresent
args:
- --http-address=:8443
- --https-address=
- --https-address=:8443
- --provider=openshift
- --openshift-service-account=frontend
- --upstream=http://localhost:3000
- --client-id=ambient-frontend
- --client-secret-file=/etc/oauth/config/client-secret
- --cookie-secret-file=/etc/oauth/config/cookie_secret
- --cookie-expire=23h0m0s
- --pass-access-token
- --scope=user:full
- --openshift-delegate-urls={"/":{"resource":"projects","verb":"list"}}
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --cookie-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Confirm how openshift/oauth-proxy validates cookie-secret length in the version used here.
rg -nP --no-messages 'cookie[_-]secret' -C2
# Inspect template-services for the sibling oauth-proxy sidecar to see how cookie secret is wired elsewhere
fd -t f 'template-services.yaml' | xargs -I{} sh -c 'echo "=== {} ==="; rg -n "cookie|oauth-proxy" {} -C2'

Repository: ambient-code/platform

Length of output: 8358


🏁 Script executed:

# Check if this patch is referenced in kustomization or deployment configs
fd -t f 'kustomization.yaml' | xargs grep -l "frontend-oauth-deployment-patch" 2>/dev/null

# Check the full context of the patch file
cat -n components/manifests/components/oauth-proxy/frontend-oauth-deployment-patch.yaml

# See what volumes are mounted in this patch
rg -A20 "volumes:" components/manifests/components/oauth-proxy/frontend-oauth-deployment-patch.yaml

Repository: ambient-code/platform

Length of output: 2963


Cookie secret using service account token will fail at startup.

Line 33 points --cookie-secret-file at the service account token (/var/run/secrets/kubernetes.io/serviceaccount/token), but openshift/oauth-proxy requires the secret to be exactly 16, 24, or 32 bytes for AES cipher creation. The SA token is a JWT of several hundred bytes and will be rejected with cookie_secret must be 16, 24, or 32 bytes to create an AES cipher at container startup.

The patch comment claims "no vault secret needed" by using the SA token, but a dedicated cookie secret must be mounted. Add a volumeMount for a proper cookie secret (see components/manifests/overlays/production/frontend-oauth-patch.yaml and template-services.yaml for working examples). Generate the secret with openssl rand -base64 32 or let the deployment script create it as shown in deploy.sh.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@components/manifests/components/oauth-proxy/frontend-oauth-deployment-patch.yaml`
at line 33, The deployment currently sets --cookie-secret-file to the service
account token path which is invalid for openshift/oauth-proxy (it requires a
16/24/32 byte secret); replace this by mounting a dedicated cookie secret and
point --cookie-secret-file at the mounted secret file instead of
/var/run/secrets/kubernetes.io/serviceaccount/token, add the corresponding
volume and volumeMount that reference a K8s Secret containing a 16/24/32-byte
base64 value (generate via openssl rand -base64 32 or via the deploy script),
and ensure the oauth-proxy container uses that mounted path for the cookie
secret (look for the --cookie-secret-file flag and the container's volumeMount
block to modify).

- --upstream-timeout=5m
- --skip-auth-regex=^/metrics
ports:
- containerPort: 8443
Expand All @@ -41,38 +40,33 @@ spec:
httpGet:
path: /oauth/healthz
port: dashboard-ui
scheme: HTTP
initialDelaySeconds: 30
scheme: HTTPS
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 5
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
readinessProbe:
httpGet:
path: /oauth/healthz
port: dashboard-ui
scheme: HTTP
initialDelaySeconds: 5
scheme: HTTPS
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 5
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
resources:
requests:
memory: 256Mi
cpu: 50m
memory: 50Mi
cpu: 10m
limits:
memory: 512Mi
memory: 200Mi
cpu: 200m
volumeMounts:
- mountPath: /etc/oauth/config
name: oauth-config
- mountPath: /etc/tls/private
name: proxy-tls
name: frontend-proxy-tls
volumes:
- name: oauth-config
secret:
secretName: frontend-oauth-config
- name: proxy-tls
- name: frontend-proxy-tls
secret:
secretName: dashboard-proxy-tls
secretName: frontend-proxy-tls
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Patch to add OAuth port to frontend service
# - Adds HTTPS port for OAuth proxy sidecar
# - Uses service.alpha annotation for auto-generated TLS cert
apiVersion: v1
kind: Service
metadata:
name: frontend-service
annotations:
service.beta.openshift.io/serving-cert-secret-name: dashboard-proxy-tls
service.alpha.openshift.io/serving-cert-secret-name: frontend-proxy-tls
Comment on lines +2 to +9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify service-ca annotation consistency and the mounted TLS secret name.
# Expected: serving-cert annotations use the supported key for the target OpenShift version,
# and the generated secret name matches frontend-proxy-tls.
rg -n -C2 'service\.(alpha|beta)\.openshift\.io/serving-cert-secret-name|frontend-proxy-tls' components/manifests

Repository: ambient-code/platform

Length of output: 6125


Use service.beta.openshift.io for consistent service-ca annotation.

This patch uses service.alpha.openshift.io, but all other service-ca patches in the codebase (overlays/production, overlays/local-dev, overlays/app-interface) use service.beta.openshift.io. If the alpha key is unsupported in your target OpenShift version, the service-ca operator will not generate frontend-proxy-tls, and the OAuth proxy deployment will fail on the volumeMount.

Proposed fix
-# - Uses service.alpha annotation for auto-generated TLS cert
+# - Uses service.beta annotation for auto-generated TLS cert
@@
-    service.alpha.openshift.io/serving-cert-secret-name: frontend-proxy-tls
+    service.beta.openshift.io/serving-cert-secret-name: frontend-proxy-tls
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# - Adds HTTPS port for OAuth proxy sidecar
# - Uses service.alpha annotation for auto-generated TLS cert
apiVersion: v1
kind: Service
metadata:
name: frontend-service
annotations:
service.beta.openshift.io/serving-cert-secret-name: dashboard-proxy-tls
service.alpha.openshift.io/serving-cert-secret-name: frontend-proxy-tls
# - Adds HTTPS port for OAuth proxy sidecar
# - Uses service.beta annotation for auto-generated TLS cert
apiVersion: v1
kind: Service
metadata:
name: frontend-service
annotations:
service.beta.openshift.io/serving-cert-secret-name: frontend-proxy-tls
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@components/manifests/components/oauth-proxy/frontend-oauth-service-patch.yaml`
around lines 2 - 9, Update the Service metadata annotation on the Service named
"frontend-service": replace the annotation key
"service.alpha.openshift.io/serving-cert-secret-name" with
"service.beta.openshift.io/serving-cert-secret-name" so the Service CA operator
will create the "frontend-proxy-tls" secret; locate this in the Service manifest
metadata -> annotations block and change the annotation key accordingly.

spec:
ports:
- port: 8443
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: v1
kind: Secret
metadata:
name: ambient-code-rds
labels:
app: ambient-api-server
component: database
annotations:
# External RDS credentials injected from Vault at runtime
qontract.recycle: "true"
type: Opaque
stringData:
# Placeholders - actual values injected from Vault at runtime
db.host: "VAULT_INJECTED"
db.port: "5432"
db.name: "ambient_code"
db.user: "VAULT_INJECTED"
db.password: "VAULT_INJECTED"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# App-interface: set environment to stage
apiVersion: apps/v1
kind: Deployment
metadata:
name: ambient-api-server
spec:
template:
spec:
containers:
- name: api-server
env:
- name: AMBIENT_ENV
value: stage
Comment on lines +1 to +13
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Verify whether AMBIENT_ENV=stage is registered by the ambient-api-server environment package.
# Expected: either a stage EnvironmentImpl exists, or this patch should use production.
rg -n -C3 'AMBIENT_ENV|EnvironmentImpls|Stage|stage|ProductionEnv' \
  components/ambient-api-server/cmd/ambient-api-server/environments \
  components/manifests/overlays/app-interface/ambient-api-server-env-patch.yaml

Repository: ambient-code/platform

Length of output: 8474


Environment stage is not registered; use production or add a stage implementation.

The EnvironmentImpls map registers only Development, UnitTesting, IntegrationTesting, and Production environments. Setting AMBIENT_ENV=stage will not match any registered implementation, causing the app to miss critical overrides for CORS headers, Red Hat SSO JWKS URL, and production database session setup.

Fix to use production environment
             - name: AMBIENT_ENV
-              value: stage
+              value: production
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# App-interface: set environment to stage
apiVersion: apps/v1
kind: Deployment
metadata:
name: ambient-api-server
spec:
template:
spec:
containers:
- name: api-server
env:
- name: AMBIENT_ENV
value: stage
# App-interface: set environment to stage
apiVersion: apps/v1
kind: Deployment
metadata:
name: ambient-api-server
spec:
template:
spec:
containers:
- name: api-server
env:
- name: AMBIENT_ENV
value: production
🧰 Tools
🪛 Checkov (3.2.519)

[medium] 2-13: Containers should not run with allowPrivilegeEscalation

(CKV_K8S_20)


[medium] 2-13: Minimize the admission of root containers

(CKV_K8S_23)

🪛 Trivy (0.69.3)

[error] 10-13: Root file system is not read-only

Container 'api-server' of Deployment 'ambient-api-server' should set 'securityContext.readOnlyRootFilesystem' to true

Rule: KSV-0014

Learn more

(IaC/Kubernetes)


[error] 10-13: Default security context configured

container ambient-api-server in default namespace is using the default security context

Rule: KSV-0118

Learn more

(IaC/Kubernetes)


[error] 8-13: Default security context configured

deployment ambient-api-server in default namespace is using the default security context, which allows root privileges

Rule: KSV-0118

Learn more

(IaC/Kubernetes)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@components/manifests/overlays/app-interface/ambient-api-server-env-patch.yaml`
around lines 1 - 13, The AMBIENT_ENV is set to an unregistered value "stage" for
the Deployment named ambient-api-server; change the env var AMBIENT_ENV under
the container named api-server to "production" so it matches the registered
EnvironmentImpls and picks up production overrides (CORS, SSO JWKS URL, DB
session setup); alternatively, if you intend a true "stage" environment, add a
corresponding EnvironmentImpl registration and implementation to the environment
map instead of using the unregistered value.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ambient-api-server
labels:
app: ambient-api-server
component: api
spec:
to:
kind: Service
name: ambient-api-server
port:
targetPort: api
tls:
termination: reencrypt
insecureEdgeTerminationPolicy: Redirect
---
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: ambient-api-server-grpc
labels:
app: ambient-api-server
component: grpc
spec:
to:
kind: Service
name: ambient-api-server
port:
targetPort: grpc
tls:
termination: reencrypt
insecureEdgeTerminationPolicy: Redirect
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# OpenShift service-ca: auto-provision and rotate TLS certs for ambient-api-server
apiVersion: v1
kind: Service
metadata:
name: ambient-api-server
annotations:
service.beta.openshift.io/serving-cert-secret-name: ambient-api-server-tls
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# App-interface (stage): enable SSL for external RDS connection
apiVersion: apps/v1
kind: Deployment
metadata:
name: ambient-api-server
spec:
template:
spec:
# Migration init container: add SSL mode
initContainers:
- name: migration
command:
- /usr/local/bin/ambient-api-server
- migrate
- --db-host-file=/secrets/db/db.host
- --db-port-file=/secrets/db/db.port
- --db-user-file=/secrets/db/db.user
- --db-password-file=/secrets/db/db.password
- --db-name-file=/secrets/db/db.name
- --db-sslmode=require
- --alsologtostderr
- -v=4
# API server container: add SSL mode
containers:
- name: api-server
command:
- /usr/local/bin/ambient-api-server
- serve
- --db-host-file=/secrets/db/db.host
- --db-port-file=/secrets/db/db.port
- --db-user-file=/secrets/db/db.user
- --db-password-file=/secrets/db/db.password
- --db-name-file=/secrets/db/db.name
- --enable-jwt=true
- --enable-authz=false
- --jwk-cert-file=/configs/authentication/jwks.json
- --enable-https=false
- --api-server-bindaddress=:8000
- --metrics-server-bindaddress=:4433
- --health-check-server-bindaddress=:4434
- --db-sslmode=require
- --db-max-open-connections=50
- --enable-db-debug=false
- --enable-metrics-https=false
- --http-read-timeout=5s
- --http-write-timeout=30s
- --cors-allowed-origins=*
- --cors-allowed-headers=X-Ambient-Project
- --enable-grpc=true
- --grpc-server-bindaddress=:9000
- --alsologtostderr
- -v=4
Loading