Skip to content

feat: add kserve - #56

Open
henrichter-sap wants to merge 4 commits into
cobaltcore-dev:mainfrom
henrichter-sap:feat/kserve
Open

feat: add kserve#56
henrichter-sap wants to merge 4 commits into
cobaltcore-dev:mainfrom
henrichter-sap:feat/kserve

Conversation

@henrichter-sap

@henrichter-sap henrichter-sap commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features
    • Added support for deploying LLM inference services from chart values, including per-model configs, replicas, args, and resources.
    • Added support for rendering reusable service config resources and updated deployment/install ordering for related platform components.
  • Bug Fixes
    • Simplified readiness checks in end-to-end runs to wait on the LLM inference service directly.
    • Updated policy and routing behavior to use the newer model naming and authentication flow.
  • Chores
    • Refreshed example values and version pins to match the updated deployment setup.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 4a37278d-e286-4644-89fa-721768959218

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR migrates model serving in the Thalamus Helm chart from custom Deployment/EPP/InferencePool templates to KServe's LLMInferenceService/LLMInferenceServiceConfig resources, reworks values schema (configs/models), updates gateway/httproute policy rendering, adds cert-manager/KServe helmfile releases, downgrades the gateway-api-inference-extension to v1.4.0, and updates E2E readiness checks accordingly.

Changes

KServe LLMInferenceService migration

Layer / File(s) Summary
New values schema
helm/thalamus/values.yaml
Replaces accelerators/epp/apiKeyAuth with configs (image-overrides, non-root, nvidia/cpu specs) and a new models schema (name/config/replicas/args/resources); reworks policies.bbr/policies.apikey-auth.
LLMInferenceService templates
helm/thalamus/templates/configs.yaml, helm/thalamus/templates/llmisvc.yaml, helm/thalamus/templates/models.yaml, helm/thalamus/templates/epp.yaml
Adds templates rendering LLMInferenceServiceConfig and LLMInferenceService per config/model entry; removes legacy Deployment/Service/InferencePool/HTTPRoute and EPP templates.
Gateway policy and HTTPRoute updates
helm/thalamus/templates/gateway.yaml, helm/thalamus/templates/httproute.yaml
Renders AgentgatewayPolicy values via tpl, removes conditional apiKeyAuth policy block, and updates directResponse id/owned_by fields to use model.name.
Example and CI values updates
helm/example.values.cpu.yaml, helm/example.values.yaml, helm/thalamus/ci/test-values.yaml
Aligns example model entries with the new name/config/replicas/args schema and removes the CI test-values models block.
Helmfile release wiring
helm/helmfile.yaml.gotmpl
Adds cert-manager and KServe LLMISVC CRD/resources/runtime-configs releases with dependency ordering; extends an existing release's needs list.
Gateway-api-inference-extension version pin
helm/Makefile, helm/gateway-api-inference-extension/Chart.yaml, helm/gateway-api-inference-extension/templates/crds.yaml
Downgrades version references from v1.5.0 to v1.4.0 and replaces the InferencePool CRD's v1alpha2 schema block.
E2E readiness checks
.github/workflows/e2e.yaml
Replaces prior gateway/vLLM/EPP rollout waits with a single kubectl wait on LLMInferenceService readiness; adds llminferenceservices dump to failure debug output.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related PRs

Suggested reviewers: Varsius

One nit worth flagging directly: the gateway-api-inference-extension version change is a downgrade (v1.5.0 → v1.4.0), not an upgrade — worth double-checking that's intentional given it also swaps out the InferencePool CRD schema wholesale. Also, models.yaml/epp.yaml removal with zero backward-compat shim means any consumer still relying on those Deployment/Service/InferencePool resources breaks outright on upgrade.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title matches the main change: adding KServe support and related Helm/chart resources.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@henrichter-sap
henrichter-sap force-pushed the feat/kserve branch 16 times, most recently from 811b564 to 92e2da7 Compare July 7, 2026 16:24
@henrichter-sap
henrichter-sap marked this pull request as ready for review July 7, 2026 17:06
@henrichter-sap
henrichter-sap requested a review from a team as a code owner July 7, 2026 17:06
@henrichter-sap

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@henrichter-sap henrichter-sap changed the title wip: add kserve feat: add kserve Jul 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🧹 Nitpick comments (1)
.github/workflows/e2e.yaml (1)

59-65: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Verify the wait timeout still fits inside the job's overall budget.

The step now allows up to 600s (10 min) for a single wait, but the job-level timeout-minutes is still 20 (line 24). Combined with cluster bootstrap, helmfile apply (image pulls), port-forward, and validation retries, a slow model pull could push the total runtime close to or past the 20-minute cap, killing the job before validate.sh even runs.

Consider bumping timeout-minutes or trimming the wait timeout to preserve headroom for the remaining steps.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/e2e.yaml around lines 59 - 65, The LLMInferenceService
readiness wait can consume too much of the job’s total runtime, leaving
insufficient headroom for later bootstrap and validation steps. Review the e2e
workflow job that contains the kubectl wait for
LLMInferenceService/vllm-arnir0-tiny-llm and either raise the job-level
timeout-minutes or reduce the wait --timeout so the overall pipeline still
comfortably fits within the budget, especially before validate.sh runs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@helm/example.values.cpu.yaml`:
- Around line 11-14: The example still contains legacy thalamus.epp.resources
configuration even though it now uses the KServe model schema. Remove that dead
EPP override from the example values file, or migrate the resource settings into
the new config model if they are still needed, and keep the example aligned with
the updated schema used by the arnir0/Tiny-LLM entry.

In `@helm/thalamus/templates/llmisvc.yaml`:
- Line 7: The LLMInferenceService name generation in the templating logic for
the vllm resource can exceed the DNS label limit and break downstream KServe
child resource creation. Update the name construction around the vllm-{{
regexReplaceAll ... }} expression to cap the base slug length, leaving room for
generated suffixes, and if needed append a stable hash so names remain unique
while staying within the 63-character limit.

In `@helm/thalamus/values.yaml`:
- Line 148: The documented default for replicas is not actually applied, because
the llmisvc template reads $m.replicas directly instead of falling back to 1.
Update the rendering logic in the llmisvc template to use a default value when
replicas is omitted, and make sure the values.yaml documentation stays
consistent with the template behavior by referencing the existing $m.replicas
field and the template’s replica count output.
- Around line 133-138: The default CPU security settings are too permissive
because the CPU model config currently sets an unconfined seccomp profile and
adds SYS_NICE for every deployment. Update the Helm values in the CPU default
securityContext to use RuntimeDefault and remove elevated capabilities from the
default path, then move any special privileges into an explicit opt-in override
or dedicated config. Keep the change localized to the securityContext block so
the default chart remains locked down.

---

Nitpick comments:
In @.github/workflows/e2e.yaml:
- Around line 59-65: The LLMInferenceService readiness wait can consume too much
of the job’s total runtime, leaving insufficient headroom for later bootstrap
and validation steps. Review the e2e workflow job that contains the kubectl wait
for LLMInferenceService/vllm-arnir0-tiny-llm and either raise the job-level
timeout-minutes or reduce the wait --timeout so the overall pipeline still
comfortably fits within the budget, especially before validate.sh runs.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 996a90c6-77db-475e-8b60-e5ca8444251e

📥 Commits

Reviewing files that changed from the base of the PR and between b838c86 and 26ff33e.

📒 Files selected for processing (15)
  • .github/workflows/e2e.yaml
  • helm/Makefile
  • helm/example.values.cpu.yaml
  • helm/example.values.yaml
  • helm/gateway-api-inference-extension/Chart.yaml
  • helm/gateway-api-inference-extension/templates/crds.yaml
  • helm/helmfile.yaml.gotmpl
  • helm/thalamus/ci/test-values.yaml
  • helm/thalamus/templates/configs.yaml
  • helm/thalamus/templates/epp.yaml
  • helm/thalamus/templates/gateway.yaml
  • helm/thalamus/templates/httproute.yaml
  • helm/thalamus/templates/llmisvc.yaml
  • helm/thalamus/templates/models.yaml
  • helm/thalamus/values.yaml
💤 Files with no reviewable changes (3)
  • helm/thalamus/ci/test-values.yaml
  • helm/thalamus/templates/epp.yaml
  • helm/thalamus/templates/models.yaml

Comment on lines +11 to +14
- name: arnir0/Tiny-LLM
config: cpu
replicas: 1
extraArgs:
args:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Finish removing the legacy EPP override from this example.

This example now uses the KServe model schema, but the same file still contains thalamus.epp.resources below. Since this PR removes the legacy EPP values/templates, that block is dead config and should be deleted or migrated to the new config model.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm/example.values.cpu.yaml` around lines 11 - 14, The example still
contains legacy thalamus.epp.resources configuration even though it now uses the
KServe model schema. Remove that dead EPP override from the example values file,
or migrate the resource settings into the new config model if they are still
needed, and keep the example aligned with the updated schema used by the
arnir0/Tiny-LLM entry.

Comment thread helm/thalamus/templates/llmisvc.yaml Outdated
apiVersion: serving.kserve.io/v1alpha2
kind: LLMInferenceService
metadata:
name: vllm-{{ regexReplaceAll "[^a-z0-9-]+" (lower $m.name) "-" }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check whether KServe truncates/hashes derived child resource names itself,
# which would make this non-issue.
rg -n "trunc|63|DNS1035|GenerateName" --type=go -C3 -g '*llmisvc*'

Repository: cobaltcore-dev/thalamus

Length of output: 161


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the target template and locate related naming logic.
git ls-files 'helm/thalamus/templates/*' 'helm/**' | sed -n '1,120p'
echo '--- llmisvc.yaml ---'
cat -n helm/thalamus/templates/llmisvc.yaml | sed -n '1,120p'
echo '--- search ---'
rg -n "LLMInferenceService|GenerateName|GenerateName:|metadata.name|trunc|trimSuffix|DNS1035|DNS-1035|name:" helm -g '*.yaml' -g '*.yml' -g '*.tpl' -g '*.gotmpl'

Repository: cobaltcore-dev/thalamus

Length of output: 26981


🌐 Web query:

KServe LLMInferenceService child resource name truncation DNS1035 generated Service Deployment EndpointSlice 63 characters

💡 Result:

In Kubernetes, resources requiring DNS-compliant names (such as Services and certain label values) must adhere to the RFC 1035 standard, which mandates a maximum length of 63 characters [1]. When KServe creates child resources—such as Kubernetes Services, Deployments, or EndpointSlices—based on the name of an LLMInferenceService (LLMISVC) resource, the combined length of the parent name and the appended suffix often exceeds this 63-character limit [2][3]. If the resulting resource name exceeds 63 characters, the Kubernetes API server will reject the creation of the child resource because it violates the DNS-1035 label constraint [2][3][4]. Key points regarding this limitation: 1. Resource Creation Failure: When a user defines an LLMInferenceService with a long name (e.g., nearing or exceeding 50+ characters), KServe's automatic generation of child resources (e.g., appending suffixes like -predictor, -service, or -inference-pool) frequently causes the final name to surpass the 63-character limit [2][5][3]. 2. Validation Challenges: Because Kubernetes validation is strict regarding DNS-1035 labels, KServe must account for these limits when generating names [6][4]. While some attempts have been made to shorten internal component names (such as webhooks) to comply with label limits, these can occasionally conflict with existing installations or OLM requirements, leading to reverts or more complex solutions like label sanitization (hashing) by operators rather than truncation [7][8]. 3. Recommended Practice: To avoid these failures, users should ensure that the names of their LLMInferenceService resources are kept sufficiently short to allow for the additional characters appended by the controller during resource generation [2][3]. As a rule of thumb, developers should subtract the length of the expected suffix (e.g., the length of "-predictor" or other operational suffixes) from 63 to determine the maximum allowed length for their custom resource names [3].

Citations:


Cap the LLMInferenceService name length. The slugified model id can push the base name past the 63-char DNS label limit, and KServe-derived child resource names can then be rejected. Truncate or hash the base name so there is room for suffixes.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm/thalamus/templates/llmisvc.yaml` at line 7, The LLMInferenceService name
generation in the templating logic for the vllm resource can exceed the DNS
label limit and break downstream KServe child resource creation. Update the name
construction around the vllm-{{ regexReplaceAll ... }} expression to cap the
base slug length, leaving room for generated suffixes, and if needed append a
stable hash so names remain unique while staying within the 63-character limit.

Comment thread helm/thalamus/values.yaml
Comment on lines +133 to +138
securityContext:
seccompProfile:
type: Unconfined
capabilities:
add:
- SYS_NICE

@coderabbitai coderabbitai Bot Jul 7, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not ship the default CPU config with elevated runtime privileges.

seccompProfile: Unconfined plus SYS_NICE weakens container isolation for every CPU model using this default. Move this into an explicit opt-in config, or keep the default on RuntimeDefault with dropped capabilities.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@helm/thalamus/values.yaml` around lines 133 - 138, The default CPU security
settings are too permissive because the CPU model config currently sets an
unconfined seccomp profile and adds SYS_NICE for every deployment. Update the
Helm values in the CPU default securityContext to use RuntimeDefault and remove
elevated capabilities from the default path, then move any special privileges
into an explicit opt-in override or dedicated config. Keep the change localized
to the securityContext block so the default chart remains locked down.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@henrichter-sap Thanks for the reference — that's a well-known and documented requirement for vLLM's CPU backend (NUMA memory policy calls need SYS_NICE, and the default Docker seccomp profile blocks get_mempolicy). Since this is scoped to the cpu config only and doesn't affect the nvidia config, I'm withdrawing this concern.

🐰💭


✏️ Learnings added
Learnt from: henrichter-sap
Repo: cobaltcore-dev/thalamus PR: 56
File: helm/thalamus/values.yaml:133-138
Timestamp: 2026-07-07T19:44:27.966Z
Learning: In helm/thalamus/values.yaml, the `configs.cpu.spec.template.containers[].securityContext` intentionally sets `seccompProfile.type: Unconfined` and adds the `SYS_NICE` capability for the vLLM CPU backend. This is required per official vLLM docs (https://docs.vllm.ai/en/stable/getting_started/installation/cpu/) to avoid `get_mempolicy: Operation not permitted` errors caused by NUMA memory policy calls being blocked by Docker's default seccomp profile. This is not a security oversight and should not be flagged as such in future reviews.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

Comment thread helm/thalamus/values.yaml
@henrichter-sap
henrichter-sap force-pushed the feat/kserve branch 2 times, most recently from 9ad404a to 9492ecf Compare July 8, 2026 15:50
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