Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
6031ec7
Red Hat Konflux update ambient-code-backend-main
Apr 6, 2026
606ce90
Red Hat Konflux update ambient-code-frontend-main
Apr 6, 2026
6c55b40
Red Hat Konflux update ambient-code-operator-main
Apr 6, 2026
f0c83d1
Red Hat Konflux update ambient-code-public-api-main
Apr 6, 2026
27ca356
Red Hat Konflux update ambient-code-ambient-api-server-main
Apr 6, 2026
ecc111f
Red Hat Konflux update ambient-code-ambient-runner-main
Apr 8, 2026
423fe26
Add app-interface overlay for AppSRE platform deployment
wcmitchell Apr 10, 2026
5a526ef
Add OpenShift Templates for AppSRE deployment
wcmitchell Apr 11, 2026
05d3dad
Add app-interface overlay for AppSRE platform deployment
wcmitchell Apr 10, 2026
2cf0e26
fix: correct OpenShift Template objects array format
wcmitchell Apr 13, 2026
c608bd0
refactor: remove in-cluster services from template
wcmitchell Apr 13, 2026
813c4e6
updating postgresql db name
maknop Apr 13, 2026
9d1e6c0
enabling ssl mode for rds
maknop Apr 15, 2026
4c0ee4b
fix: disable OpenTelemetry metrics export in operator
maknop Apr 15, 2026
85b6476
enabling ssl mode for rds
maknop Apr 15, 2026
9b27e17
Add OAuth proxy and SSL/TLS configuration for app-interface overlay
wcmitchell Apr 17, 2026
76e9181
Remove in-cluster services from template-services.yaml
wcmitchell Apr 17, 2026
5fb4711
Fix OAuth proxy configuration to use OpenShift service account auth
wcmitchell Apr 20, 2026
12d027e
Exclude ambient-code-rds secret from services template
wcmitchell Apr 20, 2026
e252262
fix: fix frontent route termination
wcmitchell Apr 20, 2026
b673993
fix: revert https changes for oauth pods
wcmitchell Apr 20, 2026
07c771f
Change TLS termination from reencrypt to edge
wcmitchell Apr 20, 2026
3b12dbc
Change health check scheme from HTTPS to HTTP
wcmitchell Apr 20, 2026
cd29d3e
Update upstream URL to use frontend service
wcmitchell Apr 20, 2026
19cae2a
Enable request logging in OAuth proxy configuration
wcmitchell Apr 20, 2026
eea6dbf
Update OAuth redirect reference for frontend service account
wcmitchell Apr 20, 2026
d8ca236
Update Vertex AI credentials to use app-interface Vault secret
wcmitchell Apr 21, 2026
aca8627
Fix OAuth proxy to pass access token to backend API
wcmitchell Apr 21, 2026
da9e091
Update OAuth proxy configuration options
wcmitchell Apr 21, 2026
59db0de
Remove authorization header setting from template
wcmitchell Apr 21, 2026
f7c264f
updating ambient env to production
maknop Apr 21, 2026
fc506ef
Add pass-user-bearer-token option to template-services.yaml
wcmitchell Apr 21, 2026
88d2738
Update template-services.yaml
wcmitchell Apr 21, 2026
ab195e8
Fix OAuth proxy to forward user tokens to frontend/backend
wcmitchell Apr 21, 2026
bc7a893
Update openshift-delegate-urls configuration
wcmitchell Apr 21, 2026
81be018
removing openshift-delegate-urls
maknop Apr 21, 2026
8409458
Revert "removing openshift-delegate-urls"
maknop Apr 21, 2026
4a337c6
Update openshift-delegate-urls path in template-services.yaml
wcmitchell Apr 22, 2026
f946eb2
Remove scope option from OAuth proxy configuration
wcmitchell Apr 22, 2026
58123c5
chore: Update konflux deps
wcmitchell Apr 22, 2026
3731512
Merge pull request #56 from RedHatInsights/update_rpm_sig_scan_ref
wcmitchell Apr 22, 2026
81d36eb
elevating user scope access
maknop Apr 22, 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.

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 @@ -136,8 +136,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
- 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
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

rg -n -C3 'secretName:\s*ambient-api-server-db|secretKeyRef:|name:\s*ambient-api-server-db' components/manifests

Repository: ambient-code/platform

Length of output: 50377


🏁 Script executed:

cat -n components/manifests/base/platform/ambient-api-server-secrets.yml

Repository: ambient-code/platform

Length of output: 1066


🏁 Script executed:

sed -n '140,150p' components/manifests/overlays/mpp-openshift/ambient-api-server.yaml

Repository: ambient-code/platform

Length of output: 355


🏁 Script executed:

sed -n '50,70p' components/manifests/overlays/mpp-openshift/ambient-api-server-db.yaml

Repository: ambient-code/platform

Length of output: 776


Update all Secret references in mpp-openshift overlay before renaming.

The Secret rename to ambient-code-rds affects multiple consumers in components/manifests/overlays/mpp-openshift/:

  1. Line 146 in ambient-api-server.yaml: secretName: ambient-api-server-db (volume mount)
  2. Lines 57, 62, 67 in ambient-api-server-db.yaml: name: ambient-api-server-db (secretKeyRef for db.user, db.password, db.name)

All must be updated to ambient-code-rds or pods will fail at startup.

Required fixes

ambient-api-server.yaml line 146:

        - name: db-secrets
          secret:
-           secretName: ambient-api-server-db
+           secretName: ambient-code-rds

ambient-api-server-db.yaml lines 57, 62, 67:

          env:
            - name: POSTGRESQL_USER
              valueFrom:
                secretKeyRef:
                  key: db.user
-                 name: ambient-api-server-db
+                 name: ambient-code-rds
            - name: POSTGRESQL_PASSWORD
              valueFrom:
                secretKeyRef:
                  key: db.password
-                 name: ambient-api-server-db
+                 name: ambient-code-rds
            - name: POSTGRESQL_DATABASE
              valueFrom:
                secretKeyRef:
                  key: db.name
-                 name: ambient-api-server-db
+                 name: ambient-code-rds
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@components/manifests/base/platform/ambient-api-server-secrets.yml` at line 5,
Update all Secret references in the mpp-openshift overlay to match the new name
ambient-code-rds: in
components/manifests/overlays/mpp-openshift/ambient-api-server.yaml update the
volume's secretName (currently secretName: ambient-api-server-db) to
ambient-code-rds, and in
components/manifests/overlays/mpp-openshift/ambient-api-server-db.yaml update
each secretKeyRef/name entries (currently name: ambient-api-server-db at the
db.user, db.password, db.name refs on lines ~57, ~62, ~67) to ambient-code-rds
so all secretName and secretKeyRef name fields reference the renamed Secret.

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 | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: List frontend Route definitions and OAuth redirect references.
# Expected: The OAuthRedirectReference route name matches an actual Route metadata.name.
rg -n -C3 'kind:\s*Route|name:\s*frontend|name:\s*frontend-route|oauth-redirectreference' components/manifests

Repository: ambient-code/platform

Length of output: 44268


Update OAuth redirect reference to match actual Route name in app-interface and production overlays.

The frontend-rbac.yaml base file references Route frontend, but overlays define frontend-route (app-interface line 4, production line 4). This breaks OAuth redirects in those environments. Only the local-dev overlay has a Route named frontend.

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 annotation
serviceaccounts.openshift.io/oauth-redirectreference.frontend currently
references the Route name "frontend", which mismatches overlays that define
"frontend-route"; update the annotation's reference name from "frontend" to
"frontend-route" in frontend-rbac.yaml (or alternatively add overlay patches in
app-interface and production to set the annotation to "frontend-route") so the
OAuth redirect reference matches the actual Route name used by the app-interface
and production overlays.

---
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
Comment on lines +14 to +24
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 overlays that include the in-cluster DB component alongside external-RDS settings.
# Expected: production should not include the local DB component when external RDS is active.
rg -n -C4 'components/ambient-api-server-db|components/postgresql-rhel|ambient-code-rds|--db-sslmode=require' --iglob '*.yaml'

Repository: ambient-code/platform

Length of output: 24426


Gate the local Postgres Deployment or use separate bootstrap credentials in production.

Production includes both the in-cluster Postgres pod (postgresql-rhel component) and the ambient-api-server-db component, which patches the local Postgres pod to mount the ambient-code-rds Secret. However, production is configured for external AWS RDS (--db-sslmode=require). The local Postgres pod unnecessarily receives external RDS credentials. Either remove the ambient-api-server-db component from production, or provide a separate local-bootstrap Secret for Postgres initialization.

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

In
`@components/manifests/components/ambient-api-server-db/ambient-api-server-db-json-patch.yaml`
around lines 14 - 24, The manifest patch mounts the ambient-code-rds Secret into
the ambient-api-server-db container (env vars
POSTGRESQL_PASSWORD/POSTGRESQL_DATABASE), which leaks external RDS credentials
into the in-cluster Postgres (postgresql-rhel) even though prod uses external
RDS (--db-sslmode=require); fix by gating or changing the secret: either remove
or disable the ambient-api-server-db component from production deployments, or
create and reference a separate local-bootstrap Secret (e.g.,
ambient-code-local-bootstrap) in the ambient-api-server-db patch so
POSTGRESQL_PASSWORD and POSTGRESQL_DATABASE use the local-secret instead of
ambient-code-rds, and ensure the production overlay does not apply this patch.

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,18 @@ 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"}}
- --openshift-delegate-urls={"/api":{"resource":"namespaces","verb":"get","name":"ambient-code","namespace":"ambient-code"},"/federate":{"resource":"namespaces","verb":"get","name":"ambient-code","namespace":"ambient-code"}}
- --tls-cert=/etc/tls/private/tls.crt
- --tls-key=/etc/tls/private/tls.key
- --cookie-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token
- --upstream-timeout=5m
Comment on lines 26 to +35
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
# Description: Verify final oauth-proxy patches include token forwarding, full scope, and a shared cookie secret.
# Expected: Every oauth-proxy args replacement includes --pass-access-token, --scope=user:full, and cookie-secret-file points to a mounted shared Secret.
rg -n -C5 -- '--pass-access-token|--scope=user:full|--cookie-secret-file|oauth-cookie|serviceaccount/token|disable_cookies' components/manifests

Repository: ambient-code/platform

Length of output: 10233


Fix oauth-proxy token forwarding, scope, and session configuration.

This patch replaces the oauth-proxy args list, omitting --pass-access-token, --scope=user:full, and using a pod-local service-account token as the cookie secret. The template and production overlays show the correct pattern: use a mounted shared Secret for cookies and include both flags.

Proposed fix
-        - --cookie-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token
+        - --cookie-secret-file=/etc/oauth-cookie/cookie_secret
+        - --pass-access-token
+        - --scope=user:full
         - --upstream-timeout=5m
         - --skip-auth-regex=^/metrics
@@
         volumeMounts:
         - mountPath: /etc/tls/private
           name: frontend-proxy-tls
+        - mountPath: /etc/oauth-cookie
+          name: oauth-cookie-secret
       volumes:
       - name: frontend-proxy-tls
         secret:
           secretName: frontend-proxy-tls
+      - name: oauth-cookie-secret
+        secret:
+          secretName: stage-cookie-secret

Also applies to: 67-73

🤖 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`
around lines 26 - 35, The oauth-proxy container args removed important flags and
changed cookie secret sourcing; restore the flags --pass-access-token and
--scope=user:full in the args list (the container args block) and change the
cookie secret source from the pod service-account token
(--cookie-secret-file=/var/run/secrets/kubernetes.io/serviceaccount/token) to a
mounted shared Secret path used by other overlays (use the same mounted Secret
file path used in the template/production overlays), ensuring both flags and the
shared Secret mount are present in the args and Pod spec for oauth-proxy.

- --skip-auth-regex=^/metrics
ports:
- containerPort: 8443
Expand All @@ -41,38 +41,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

# Expect serving-cert annotations to use service.beta.openshift.io.
rg -n -C2 'service\.(alpha|beta)\.openshift\.io/serving-cert-secret-name' components/manifests

Repository: ambient-code/platform

Length of output: 4636


Use the OpenShift service-ca beta annotation key.

service.alpha.openshift.io/serving-cert-secret-name is not honored by OpenShift service-ca, so frontend-proxy-tls won't be auto-generated and the OAuth proxy TLS mount will fail. The codebase uses service.beta.openshift.io consistently elsewhere.

Proposed fix
-# - Uses service.alpha annotation for auto-generated TLS cert
+# - Uses service.beta annotation for auto-generated TLS cert
 apiVersion: v1
 kind: Service
 metadata:
   name: frontend-service
   annotations:
-    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, Replace the unsupported OpenShift annotation key so the
service-ca will auto-generate the TLS secret: in the Service resource (kind:
Service, metadata.name: frontend-service) change the annotation key from
service.alpha.openshift.io/serving-cert-secret-name to
service.beta.openshift.io/serving-cert-secret-name while keeping the secret
value frontend-proxy-tls so the OAuth proxy TLS secret is created and mounted
correctly.

spec:
ports:
- port: 8443
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
apiVersion: v1
kind: Secret
metadata:
name: ambient-code-rds
labels:
app: ambient-api-server
component: database
annotations:
# External RDS connection managed via Vault secrets from app-interface Phase 2
# These values will be injected by vault-secret-manager from Vault path:
# app-interface/data/ambient-code-platform/stage/rds-credentials
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
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