-
Notifications
You must be signed in to change notification settings - Fork 100
Inital prompt time increase #1528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
6031ec7
606ce90
6c55b40
f0c83d1
27ca356
ecc111f
423fe26
5a526ef
05d3dad
2cf0e26
c608bd0
813c4e6
9d1e6c0
4c0ee4b
85b6476
9b27e17
76e9181
5fb4711
12d027e
e252262
b673993
07c771f
3b12dbc
cd29d3e
19cae2a
eea6dbf
d8ca236
aca8627
da9e091
59db0de
f7c264f
fc506ef
88d2738
ab195e8
bc7a893
81be018
8409458
4a337c6
f946eb2
58123c5
3731512
04290ab
8e365a1
fabbc95
5d31cec
d292964
336a759
f190ae5
2af8216
f0cafaf
a96106f
9a63f96
93927f7
6e294e7
622f62f
db6bdd3
0d7e8c0
a3ede83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| 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 | ||
|
|
@@ -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
+34
to
+35
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: find . -type f -name "frontend-oauth-deployment-patch.yaml" -o -name "template-services.yaml" | head -20Repository: ambient-code/platform Length of output: 204 🏁 Script executed: # Let's also check the structure of oauth-proxy related files
find . -type d -name "oauth-proxy" 2>/dev/nullRepository: ambient-code/platform Length of output: 111 🏁 Script executed: # Search for oauth-proxy configurations and references
rg "cookie-secret" --type yaml -A 2 -B 2Repository: ambient-code/platform Length of output: 2838 🏁 Script executed: # Look for any oauth-proxy documentation or setup patterns in the codebase
rg "oauth.*secret" -i --type yamlRepository: ambient-code/platform Length of output: 2097 🏁 Script executed: cat -n ./components/manifests/components/oauth-proxy/frontend-oauth-deployment-patch.yamlRepository: ambient-code/platform Length of output: 3036 🏁 Script executed: cat -n ./components/manifests/templates/template-services.yaml | head -100Repository: ambient-code/platform Length of output: 3299 🏁 Script executed: cat -n ./components/manifests/overlays/production/frontend-oauth-patch.yamlRepository: ambient-code/platform Length of output: 2660 Use a dedicated Secret for cookie signing instead of the service account token. The service account token at 🤖 Prompt for AI Agents |
||
| - --skip-auth-regex=^/metrics | ||
| ports: | ||
| - containerPort: 8443 | ||
|
|
@@ -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 |
|---|---|---|
| @@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default DB template name now risks colliding with external RDS secret naming.
Line 17 sets
DATABASE_SERVICE_NAMEtoambient-code-rds, and this template reuses that value for Service/Deployment/PVC/Secret names. That can conflict with externally managedambient-code-rdscredentials and cause wrong DB host/credentials to be consumed.Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents