Skip to content

Configure Istio Ingress And Gateway Prompt Storage - #363

Merged
Pengfei Ni (feiskyer) merged 3 commits into
mainfrom
fix/deployment-chart-config
Oct 30, 2026
Merged

Pengfei Ni (feiskyer) merged 3 commits into
mainfrom
fix/deployment-chart-config

Conversation

@feiskyer

@feiskyer Pengfei Ni (feiskyer) commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Add validated Istio options for wildcard hosts, OAuth2 Proxy bearer authentication, logging, and the legacy cookie Secret namespace. Their defaults preserve the existing choices.
  • Separately constrain ingress authentication and HTTP filters to port 443, enable PKCE S256, and require OIDC nonce verification. These change authentication behavior; see the compatibility notes below.
  • Preserve current cookie Secret values during upgrades. Reject an upgrade with no reusable key instead of generating a replacement. Keep TLS ownership unchanged.
  • Add spendLogs.storePrompts, defaulting to true, so database spend logs include prompts and responses. Explicit false disables content storage in the rendered configuration. Both choices use the spend-log retention and leave stdout request logs metadata-only.

Related issue

Requested Chart configuration follow-up; no separate issue.

Validation

CI is complete for b4fba948: 26 checks passed, eight deployment/build/report jobs were skipped by their existing conditions, and none failed or remain pending. No skip conditions were changed.

Passed after rebasing onto current main, using Helm 4.2.3 and PyYAML 6.0.1. Helm checks used /dev/null for Kubernetes and Helm registry/repository configuration. The Secret lookup tests use their own synthetic loopback API.

bash scripts/cetirun-istio-helm-test.sh
bash scripts/cetirun-ai-gateway-helm-test.sh
python3 -B -m unittest discover -s scripts/tests -p 'test_istio_*.py' -v
python3 -B -m unittest scripts.tests.test_native_gateway_chart -v
helm lint infra/istio --set-string clientId=lint-client --set-string tenantId=lint-tenant --set-string allowedGroups=lint-group --set-string cookieSecret=0123456789abcdef0123456789abcdef
helm lint app/cetirun-ai-gateway/chart
make license-check
git diff --check origin/main...HEAD

Both render suites, both lints, all 59 Istio tests, license headers, and whitespace checks passed. The Gateway suite includes the upstream JEV fallback checks. The prompt-storage correction also passes all 32 native Gateway Chart and health-probe tests. The new default, explicit opt-out, and missing-old-value regression failed before the correction and passes afterward.

The actual platform Chart, with dependencies packaged locally from this checkout, renders prompt storage as true by default and honors both explicit false and true through cetirun-ai-gateway.spendLogs.storePrompts.

The kind CI failure came from three upgrade scenarios that disabled spendLogs.enabled without disabling the newly default-on storePrompts. Each now sets both values to false. The updated kind run passed: all 17 initial successful synthetic requests stored both prompt and response content, stdout stayed metadata-only, explicit spend-log opt-out worked, and upgrade/restart/reinstall checks passed. Salt, master and database credentials were preserved. The content query returns counts, not stored bodies.

The full repository suite was not run locally. No staging or production cluster, real provider, or existing database was accessed. Kind uses a new namespace, its own PostgreSQL, and a mock provider. Real OIDC sign-in, session refresh, and Istio traffic qualification remain separate checks.

Compatibility and operational impact

Wildcard hosts and OAuth2 Proxy logging stay enabled by default. Bearer authentication keeps its existing mode default and cannot be enabled in local OIDC mode. Existing CSRF, API 401, token stripping, and owner checks remain in place.

The fixed authentication settings are not all no-op defaults:

Setting Before Compatibility impact
Policy and HTTP filter port match All matching gateway listeners Only port 443 is covered. This keeps port-80 HTTP-01 traffic out of business authentication. Any other listener serving business traffic needs its own authentication policy; this Chart still declares only HTTPS 443.
PKCE No code challenge configured S256 is required for new sign-ins. Custom OIDC providers must support it. The pinned Entra federated-token path forwards the code verifier.
OIDC nonce Verification skipped by the pinned OAuth2 Proxy default New sign-ins and subsequent token validation check the nonce. Older sessions lacking a matching nonce can require sign-in again when validated or refreshed. Keeping the Cookie Secret does not guarantee every old session remains valid.
HttpOnly Already true by the pinned OAuth2 Proxy default Now explicit; no intended behavior change.

These comparisons use OAuth2 Proxy v7.15.5's provider defaults, OIDC validation, and cookie defaults. Default cookie-only sessions have refresh disabled; they are not all revalidated on each request.

Client-only upgrade rendering cannot look up live Secrets and now fails without an explicit cookie key. Use synthetic keys only in offline tests. Normal upgrades must retain the existing key through server lookup or protected explicit input.

Prompt and response storage is on by default for new installs and upgrades without an explicit spendLogs.storePrompts value. Set it to false to render store_prompts_in_spend_logs: false while retaining call metadata. Disabling the entire spend log also requires storePrompts: false. Existing content is not erased.

LiteLLM settings saved in the database can override the Chart setting and retention. This change does not read or rewrite the database, rotate TLS keys, or change pricing or model classification.

Checklist

  • The change is focused and preserves unrelated work.
  • Tests cover the changed behavior.
  • Documentation and examples match the public behavior changes.
  • No generated artifacts are affected.
  • No dependencies or lockfiles change.
  • The diff contains no credentials, private endpoints, customer data, conversations, or internal documents.
  • The CLA bot check passed.
  • Live checks are identified above and were not run.

Expose validated ingress deployment options and preserve cookie secrets across upgrades. Keep prompt and response storage off unless explicitly enabled in the Gateway chart.
Store prompts and responses in the database by default. Render both boolean values so an explicit Helm opt-out writes false, while preserving retention, metadata-only stdout logs and existing database override semantics.
Disable prompt storage in each upgrade scenario that disables spend logs. Verify synthetic prompts and responses are stored by default while stdout logs remain metadata-only.
@feiskyer
Pengfei Ni (feiskyer) merged commit 2202d19 into main Oct 30, 2026
34 checks passed
@feiskyer
Pengfei Ni (feiskyer) deleted the fix/deployment-chart-config branch October 30, 2026 07:42
Zhupku added a commit that referenced this pull request Nov 2, 2026
…re it writes (#397)

* Align the install, Sandbox and smart-routing docs with make deploy, decision-model Team routers and optional Teams

Since #364, make deploy DEPLOY_CONFIG=<environment.yaml> installs the
platform. The site still told readers to run the platform helper with DOMAIN
and VALUES_FILE, which now exits with an error, and to install Sandbox
admission without enforcement themselves, which make deploy refuses.

- Install CetiRun: make publish with the VS Code Server license acceptance,
  what must exist before the first make deploy (with the Gateway's Secrets),
  the environment file, make deploy-plan and make deploy.
- Policy-bound Teams: the admission certificate and administrators before the
  first run, then the registration, the peer labels, and a second make deploy
  that enables Sandbox execution.
- Smart routing: models in the environment file, with the auto router and the
  decision model that make deploy requires; a Team router named auto-team,
  because auto is the Gateway's; decision models for Team routers (#348);
  default_model_fallback, and a log query on routing_cause.
- Gateway chart README, teams.md and models.md: a jev router falls back to its
  default model, and the guard shortens its classifier requests (#348). make
  publish needs the license flag.
- first-instance.md: a Team is optional (#353), and the form's model switches,
  default model and Agent Identity switch.
- helm.md, scripts.md, infrastructure.md, and the platform README and values
  comments: make deploy instead of the earlier helper's variables.
- The site test now expects make deploy on the installation page, and no
  VALUES_FILE invocation.

* Say that LiteLLM's spend log keeps prompts and responses by default

Since #363, spendLogs.storePrompts defaults to true, so each row of
LiteLLM_SpendLogs holds the call's prompt and response. The Helm reference
and the platform values comment still said that neither is stored. The
stdout request log still carries no content.

* Name a wrong managed Istio Deployment or mesh ConfigMap before make deploy writes

AKS managed Istio adds the revision to the name of the ingress gateway
Deployment, but the example environment file had the name without it. The
preflight then failed at kubectl rollout status, and the helper withholds
tool output, so the run only said "kubectl --context failed with exit 1".

The preflight now makes sure that the configured control plane and ingress
Deployments exist before it waits for them. If one does not exist, it names
the input, and the name with the revision when that Deployment exists. It
does not replace a configured name.

A mesh ConfigMap that does not exist is created by the helper. AKS managed
Istio reads only istio-shared-configmap-<revision>, so a different name left
the OAuth2 provider out of the mesh without an error. The preflight now stops
when the configured ConfigMap does not exist but that one does.

* Give the example's ingress Deployment its revision, and say how to read the AKS Istio names

The example named the control plane Deployment and the mesh ConfigMap with
the revision placeholder, but not the ingress gateway Deployment. Install
CetiRun and the platform README now say which managed Istio names carry the
revision, how to read them from the cluster, and when make deploy stops.

---------

Co-authored-by: Scott Zhu <mengzezhu@microsoft.com>
Pengfei Ni (feiskyer) pushed a commit that referenced this pull request Nov 3, 2026
…fault (#413)

Since #363, spendLogs.storePrompts is true by default, and LiteLLM's spend
log keeps the request and the response of each call. PRIVACY.md still said
that the records held no prompt or response. It now says what they hold, that
LiteLLM shortens each value longer than 2,048 characters, who can read them,
and what storePrompts: false changes. The security page lists the spend log
with the other logs, and the Gateway chart README says what the prompt is and
how LiteLLM shortens it.

Co-authored-by: Scott Zhu <mengzezhu@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant