RHAI-58416 #267
<!-- coderabbit-ai-generated:v1 -->
<!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- This is an auto-generated comment: skip review by coderabbit.ai -->
[!IMPORTANT]
## Review skipped
> Auto reviews are disabled on base/target branches other than the default branch.
> <details>
<summary><strong>🗂️ Base branches to auto review: 4</strong></summary>
<dl>
<dd>
<br>
> main
master
incubation
rhoai
> </dd>
</dl>
</details>
> Please check the settings in the CodeRabbit UI or the.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.
> <details>
<summary><strong><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</strong></summary>
<dl>
<dd>
<br>
> - Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Central YAML (base), Organization UI (inherited)
- Review profile: CHILL
- Plan: Advanced
- Run ID: c238c4a3-5030-48c9-8a4c-760ea99b4842> </dd>
</dl>
</details>
> You can disable this status message by setting thereviews.review_statustofalsein the CodeRabbit configuration file.
> Use the checkbox below for a quick retry:
- [ ] <!-- {"checkboxId":"e9bb8d72-00e8-4f67-9cb2-caf3b22574fe"} --> Trigger review
<!-- end of auto-generated comment: skip review by coderabbit.ai -->
should this change be committed?
Actually yeah I think we should include it. The samples directory normally assumes kuberay-system despite a lot of guides advising inclusion in default. We override this in our manifests I believe but I don't think we've a mechanism for that here as it's just a sample so I'd propose leaving it be, knowing this is the namespace we should be deploying in within RHOAI. WDYT?
sure. sounds good
OpenShift §6: minimal access client 403 until proxy config uses SAR field name (RHOAI odh-kube-rbac-proxy-rhel9).
Use name: default (not resourceName). RHOAI kube-rbac-proxy maps YAML name to SAR only; resourceName is ignored → 403 with valid access RBAC.
Assert name: default instead of resourceName: default.
Remove — name: default should be present.
thanks! reverified. all good!
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: <a href="https://github.com/opendatahub-io/kuberay/pull/267#" title="Author self-approved">chipspeak</a>, <a href="https://github.com/opendatahub-io/kuberay/pull/267#pullrequestreview-6130460449" title="Approved">pawelpaszki</a>
The full list of commands accepted by this bot can be found here.
<details open>
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
</details>
<!-- META={"approvers":[]} -->
pawelpaszki
chipspeak
Managed History Server lifecycle
The downstream deployment enables
RayClusterHistoryServer. Creating thecluster-scoped
RayHistoryServernameddefaultrequests the shared server;deleting it removes its managed Kubernetes resources. There is no
spec.enabled; configuration validity and readiness do not change the featuregate.
This controller implements the History Server lifecycle (RHAI-58416).
Namespace label-based RayCluster enrollment and application-namespace
credential copies are a separate implementation. Existing explicit per-
RayCluster collector options and injection are unchanged. Collectors write to
object storage; they do not connect to the History Server.
Deployment configuration
The server and administrator-owned source Secret reside in the platform
application namespace. On OpenShift, this is read from the injected
APPLICATION_NAMESPACEvalue and falls back toredhat-ods-applications. Onnon-OpenShift installations, the existing
POD_NAMESPACEfallback is used. Acredentials reference may omit its namespace or name this same namespace;
cross-namespace references are rejected. The cluster-scoped singleton requires
the operator's cluster-scoped RBAC.
Set
RELATED_IMAGE_RAY_HISTORY_SERVERon the operator to a supported HistoryServer image. The proxy uses the existing
RELATED_IMAGE_ODH_KUBE_RBAC_PROXY_IMAGEresolution and OpenShift TLS-profileflags.
For storage, configure the backend, bucket/container, and endpoint in the CR.
S3 requires a region. Explicit S3 endpoints and Azure account URLs must use
HTTPS. Credential values are never put into CR specs or ConfigMaps; the Pod
uses explicit SecretKeyRefs or a restricted Secret volume rather than
envFrom.Supported credential Secret keys:
AWS_ACCESS_KEY_ID,AWS_SECRET_ACCESS_KEY, and optionalAWS_SESSION_TOKEN.credentials.json, mounted and referenced throughGOOGLE_APPLICATION_CREDENTIALS.connection_string:AZURE_STORAGE_CONNECTION_STRING.default:AZURE_TENANT_ID,AZURE_CLIENT_ID, andAZURE_CLIENT_SECRET.Omitting the credentials reference leaves authentication to the SDK's default
credential chain. The controller does not provision cloud identities or
projected federation tokens.
security.caBundlecontains PEM certificates for storage trust. It is mountedinto the server and passed to the Go/system and AWS certificate configuration;
it is not a request for client-certificate authentication.
Serving security
Only a ClusterIP Service on port 443 is created, targeting the authenticated
proxy on 8443. The server's HTTP port 8080 is not exposed by the Service. No
Route or Ingress is created. Live-cluster proxying and explicitly disabling the
authentication proxy are rejected with
ConfigurationValid=False.The proxy authorizes the custom verb
accesson cluster-scoped resourcerayhistoryservers.ray.io, resource namedefault. No user bindings arecreated. Any additional grant must be restricted to trusted administrators
because the shared server has no tenant-aware archive filtering.
By default, cert-manager issues a serving certificate using an owned
self-signed Issuer. Clients must trust that certificate, or use a suitable
trusted Issuer.
security.tls.issuerRefsupports an existing Issuer in theoperator namespace or a ClusterIssuer.
security.tls.secretNamewithout anissuer reference uses an administrator-provided certificate.
No client certificates or RayCluster mTLS resources are involved.
OpenShift verification runbook
The following steps verify an OpenShift deployment using AWS S3. Replace the
namespace, bucket, region, endpoint, and image values for the target cluster.
Run these commands from the KubeRay repository, with
oclogged into thecluster and the AWS CLI authenticated as an identity allowed to use the bucket.
1. Prepare the AWS bucket
If the bucket does not exist, create it. For
us-east-1:For another AWS region:
The AWS identity used by the History Server needs bucket existence and object
read/write permissions for the configured root directory.
2. Create the storage Secret
Export credentials from the approved credential source. Do not put them in a
YAML file or commit them. Set
AWS_SESSION_TOKENwhen using temporary AWScredentials.
The credentials are injected at runtime using Secret references; they are not
stored in the CR or ConfigMap.
3. Configure and deploy KubeRay
Set the OpenShift overlay values in
[
config/openshift/params.env](../../ray-operator/config/openshift/params.env),including the application namespace, operator image, kube-rbac-proxy image,
and History Server image. Ensure the feature-gate patch contains:
Apply the overlay:
4. Create the History Server
Update the S3 values and credential Secret namespace in
[
rayhistoryserver_v1alpha1_default.yaml](../../ray-operator/config/samples/rayhistoryserver_v1alpha1_default.yaml),then apply it:
The History Server is cluster-scoped, so do not use
-nwhen retrieving thecustom resource. Verify its managed resources and logs:
Expected results are
READY=True, a running History Server Pod, successful S3bucket initialization, and a server listening on its internal HTTP port.
5. Create a RayCluster with a collector
This branch verifies collector injection through explicit collector options in
the RayCluster sample. Apply:
[
ray-history-test.yaml](../../ray-operator/config/samples/ray-history-test.yaml)Verify that the Ray head Pod contains the collector and inspect its logs:
The collector should discover the Ray Dashboard, start polling, and write
cluster metadata, endpoint snapshots, and event data below the configured S3
root directory.
6. Verify authentication and TLS
For a temporary verification, port-forward the HTTPS Service:
An unauthenticated request must be rejected:
Expected response:
401 Unauthorized.Create or use a ServiceAccount with the intended
accesspermission:Grant only the required cluster-scoped permission according to the platform's
RBAC policy, then test:
Expected response:
200 OK. A403should be investigated by checking thegenerated proxy configuration and kube-rbac-proxy image. The proxy must honor
the configured custom
accessverb; granting ordinarygetaccess is only atemporary diagnostic.
Verify the certificate and exposure:
Confirm that clients use HTTPS, the certificate covers the service or Route
hostname, and the unauthenticated History Server port is not externally
exposed.
Reconciliation and recovery
ConfigurationValidreflects local storage/security configuration andreferenced Secret validation, not remote storage connectivity.
DeploymentAvailablerequires the current rollout and desired replicas tobe available.
Readyadditionally requires a currently valid serving certificate.RayClusters.