← Back to Pull requests

RHAI-58416 #267

Merged
chipspeak merged 12 files (1679 lines) on Dec 01, 2026 11:38 UTC
View on GitHub
chipspeak chipspeak commented on Nov 26, 2026 13:57 UTC
Author

Managed History Server lifecycle

The downstream deployment enables RayClusterHistoryServer. Creating the
cluster-scoped RayHistoryServer named default requests the shared server;
deleting it removes its managed Kubernetes resources. There is no
spec.enabled; configuration validity and readiness do not change the feature
gate.

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_NAMESPACE value and falls back to redhat-ods-applications. On
non-OpenShift installations, the existing POD_NAMESPACE fallback is used. A
credentials 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_SERVER on the operator to a supported History
Server image. The proxy uses the existing
RELATED_IMAGE_ODH_KUBE_RBAC_PROXY_IMAGE resolution and OpenShift TLS-profile
flags.

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:

  • S3: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and optional

  • AWS_SESSION_TOKEN.
  • GCS: credentials.json, mounted and referenced through

  • GOOGLE_APPLICATION_CREDENTIALS.
  • Azure connection_string: AZURE_STORAGE_CONNECTION_STRING.

  • Azure default: AZURE_TENANT_ID, AZURE_CLIENT_ID, and

  • AZURE_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.caBundle contains PEM certificates for storage trust. It is mounted
    into 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 access on cluster-scoped resource
    rayhistoryservers.ray.io, resource name default. No user bindings are
    created. 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.issuerRef supports an existing Issuer in the
    operator namespace or a ClusterIssuer. security.tls.secretName without an
    issuer 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 oc logged into the
    cluster and the AWS CLI authenticated as an identity allowed to use the bucket.

    1. Prepare the AWS bucket

    export APP_NAMESPACE=redhat-ods-applications
    export S3_BUCKET=history-server-s3-bucket
    export AWS_REGION=us-east-1
    export S3_ENDPOINT=https://s3.amazonaws.com
    
    aws sts get-caller-identity
    aws s3api head-bucket --bucket "$S3_BUCKET"
    

    If the bucket does not exist, create it. For us-east-1:

    aws s3api create-bucket --bucket "$S3_BUCKET" --region "$AWS_REGION"
    

    For another AWS region:

    aws s3api create-bucket \
      --bucket "$S3_BUCKET" \
      --region "$AWS_REGION" \
      --create-bucket-configuration LocationConstraint="$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_TOKEN when using temporary AWS
    credentials.

    export AWS_ACCESS_KEY_ID=...
    export AWS_SECRET_ACCESS_KEY=...
    export AWS_SESSION_TOKEN=...
    
    secret_args=(
      --from-literal=AWS_ACCESS_KEY_ID="$AWS_ACCESS_KEY_ID"
      --from-literal=AWS_SECRET_ACCESS_KEY="$AWS_SECRET_ACCESS_KEY"
    )
    
    if [[ -n "${AWS_SESSION_TOKEN:-}" ]]; then
      secret_args+=(--from-literal=AWS_SESSION_TOKEN="$AWS_SESSION_TOKEN")
    fi
    
    oc -n "$APP_NAMESPACE" create secret generic ray-history-storage \
      "${secret_args[@]}" \
      --dry-run=client -o yaml | oc apply -f -
    

    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:

    RayClusterHistoryServer=true
    

    Apply the overlay:

    oc apply -k config/openshift --server-side
    oc -n "$APP_NAMESPACE" get deployment kuberay-operator
    oc -n "$APP_NAMESPACE" get pods -l control-plane=kuberay-operator
    oc -n "$APP_NAMESPACE" get deployment kuberay-operator \
      -o jsonpath='{.spec.template.spec.containers[0].args}'
    

    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:

    oc apply -f ray-operator/config/samples/rayhistoryserver_v1alpha1_default.yaml
    oc get rayhistoryserver default
    oc describe rayhistoryserver default
    

    The History Server is cluster-scoped, so do not use -n when retrieving the
    custom resource. Verify its managed resources and logs:

    oc -n "$APP_NAMESPACE" get deployment,service,pod \
      -l app.kubernetes.io/name=ray-history-server
    oc -n "$APP_NAMESPACE" logs deployment/ray-history-server -c history-server
    

    Expected results are READY=True, a running History Server Pod, successful S3
    bucket 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)

    oc apply -f ray-operator/config/samples/ray-history-test.yaml
    oc -n "$APP_NAMESPACE" get raycluster ray-history-test
    oc -n "$APP_NAMESPACE" get pods
    

    Verify that the Ray head Pod contains the collector and inspect its logs:

    HEAD_POD=$(oc -n "$APP_NAMESPACE" get pods \
      -l ray.io/cluster=ray-history-test,ray.io/node-type=head \
      -o jsonpath='{.items[0].metadata.name}')
    oc -n "$APP_NAMESPACE" get pod "$HEAD_POD" \
      -o jsonpath='{.spec.containers[*].name}'
    oc -n "$APP_NAMESPACE" logs "$HEAD_POD" -c collector
    

    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:

    oc -n "$APP_NAMESPACE" port-forward service/ray-history-server 8443:443
    

    An unauthenticated request must be rejected:

    curl -k -i https://localhost:8443/readz
    

    Expected response: 401 Unauthorized.

    Create or use a ServiceAccount with the intended access permission:

    oc -n "$APP_NAMESPACE" create serviceaccount history-client
    TOKEN=$(oc -n "$APP_NAMESPACE" create token history-client)
    

    Grant only the required cluster-scoped permission according to the platform's
    RBAC policy, then test:

    curl -k -i \
      -H "Authorization: Bearer $TOKEN" \
      https://localhost:8443/readz
    

    Expected response: 200 OK. A 403 should be investigated by checking the
    generated proxy configuration and kube-rbac-proxy image. The proxy must honor
    the configured custom access verb; granting ordinary get access is only a
    temporary diagnostic.

    Verify the certificate and exposure:

    oc -n "$APP_NAMESPACE" get certificate,issuer,secret
    oc -n "$APP_NAMESPACE" get service ray-history-server
    oc get route
    

    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

  • ConfigurationValid reflects local storage/security configuration and

  • referenced Secret validation, not remote storage connectivity.
  • DeploymentAvailable requires the current rollout and desired replicas to

  • be available.
  • Ready additionally requires a currently valid serving certificate.

  • Secret rotation rolls the History Server Deployment; it does not restart

  • RayClusters.

    Diff: 1679 lines (+1654 / -25) across 12 files Reviewer: pawelpaszki Review duration: 7061m
    All Vouch review confidence checks passed
    Residual risk 0.06 = Change Risk (0.64) × (1 − Review Confidence (0.91)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.64 · 1679 lines diff across 12 files
    0.64
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.89 · 5 substantive comment(s)
    0.89
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 50%
    90%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.400
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    11 items
    coderabbitai[bot] coderabbitai[bot] commented on Nov 26, 2026 13:57 UTC
    Bot

    <!-- 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.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

    > <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 the reviews.review_status to false in 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 -->

    pawelpaszki pawelpaszki commented on code on Nov 27, 2026 09:22 UTC
    Code Review
    ray-operator/config/samples/rayhistoryserver_v1alpha1_default.yaml:1
    @@ -10,7 +10,7 @@ spec:
         rootDir: ray-history
         credentialsSecret:
           name: ray-history-storage
    -      namespace: kuberay-system
    +      namespace: redhat-ods-applications

    should this change be committed?

    chipspeak chipspeak commented on code on Nov 27, 2026 12:43 UTC
    Code Review
    ray-operator/config/samples/rayhistoryserver_v1alpha1_default.yaml:1
    @@ -10,7 +10,7 @@ spec:
         rootDir: ray-history
         credentialsSecret:
           name: ray-history-storage
    -      namespace: kuberay-system
    +      namespace: redhat-ods-applications

    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?

    pawelpaszki pawelpaszki commented on code on Nov 27, 2026 12:45 UTC
    Code Review
    ray-operator/config/samples/rayhistoryserver_v1alpha1_default.yaml:1
    @@ -10,7 +10,7 @@ spec:
         rootDir: ray-history
         credentialsSecret:
           name: ray-history-storage
    -      namespace: kuberay-system
    +      namespace: redhat-ods-applications

    sure. sounds good

    pawelpaszki pawelpaszki commented on Nov 30, 2026 09:32 UTC
    Reviewer

    OpenShift §6: minimal access client 403 until proxy config uses SAR field name (RHOAI odh-kube-rbac-proxy-rhel9).

    pawelpaszki pawelpaszki commented on code on Nov 30, 2026 09:32 UTC
    Code Review
    ray-operator/controllers/ray/rayhistoryserver_resources.go:1
    @@ -0,0 +1,157 @@
    +package ray
    +
    +import (
    +	"fmt"
    +	"net/url"
    +	"sort"
    +	"strconv"
    +
    +	appsv1 "k8s.io/api/apps/v1"
    +	corev1 "k8s.io/api/core/v1"
    +	networkingv1 "k8s.io/api/networking/v1"
    +	rbacv1 "k8s.io/api/rbac/v1"
    +	"k8s.io/apimachinery/pkg/api/resource"
    +	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
    +	"k8s.io/apimachinery/pkg/util/intstr"
    +	"k8s.io/utils/ptr"
    +	"sigs.k8s.io/controller-runtime/pkg/client"
    +
    +	rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" //nolint:staticcheck // RayHistoryServer is intentionally introduced in the v1alpha1 API.
    +	"github.com/ray-project/kuberay/ray-operator/controllers/ray/utils"
    +)
    +
    +type historyServerInputs struct {
    +	Namespace, Image, ProxyImage, TLSSecretName, Revision string
    +	ProxyTLSArgs                                          []string
    +	Env                                                   []corev1.EnvVar
    +	Volumes                                               []corev1.Volume
    +	VolumeMounts                                          []corev1.VolumeMount
    +}
    +
    +func historyServerResources(hs *rayv1alpha1.RayHistoryServer, in historyServerInputs) ([]client.Object, error) {
    +	if in.Namespace == "" || in.Image == "" || in.ProxyImage == "" || in.TLSSecretName == "" {
    +		return nil, fmt.Errorf("History Server namespace, images and TLS Secret must be configured")
    +	}
    +	const name = "ray-history-server"
    +	labels := func() map[string]string {
    +		return map[string]string{"app.kubernetes.io/name": name, "app.kubernetes.io/managed-by": "kuberay-operator"}
    +	}
    +	metadata := func(objectName string) metav1.ObjectMeta {
    +		return metav1.ObjectMeta{Name: objectName, Namespace: in.Namespace, Labels: labels()}
    +	}
    +	config := &corev1.ConfigMap{ObjectMeta: metadata(name + "-config"), Data: map[string]string{
    +		// Custom access permission avoids treating ordinary CR viewers as archive
    +		// administrators. No user bindings or namespace-tenant claims are made.
    +		"config.yaml": "authorization:\n  resourceAttributes:\n    apiGroup: ray.io\n    resource: rayhistoryservers\n    resourceName: default\n    verb: access\n",

    Use name: default (not resourceName). RHOAI kube-rbac-proxy maps YAML name to SAR only; resourceName is ignored → 403 with valid access RBAC.

    pawelpaszki pawelpaszki commented on code on Nov 30, 2026 09:32 UTC
    Code Review
    ray-operator/controllers/ray/rayhistoryserver_resources_test.go:1
    @@ -0,0 +1,101 @@
    +package ray
    +
    +import (
    +	"testing"
    +
    +	"github.com/stretchr/testify/require"
    +	appsv1 "k8s.io/api/apps/v1"
    +	corev1 "k8s.io/api/core/v1"
    +	networkingv1 "k8s.io/api/networking/v1"
    +	rbacv1 "k8s.io/api/rbac/v1"
    +	"k8s.io/apimachinery/pkg/api/resource"
    +
    +	rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" //nolint:staticcheck // RayHistoryServer is intentionally introduced in the v1alpha1 API.
    +)
    +
    +func TestHistoryServerResourcesSecureExposure(t *testing.T) {
    +	hs := historyServerTestCR()
    +	hs.Spec.Storage.S3.Endpoint = "https://s3.example.test:9443"
    +	input := historyServerInputs{Namespace: "operator", Image: "history:tested", ProxyImage: "proxy:tested", TLSSecretName: "serving-cert", Revision: "revision-1", ProxyTLSArgs: []string{"--tls-min-version=VersionTLS12"}, Env: []corev1.EnvVar{{Name: "AWS_SECRET_ACCESS_KEY", ValueFrom: &corev1.EnvVarSource{SecretKeyRef: &corev1.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{Name: "source"}, Key: "AWS_SECRET_ACCESS_KEY"}}}}}
    +	objects, err := historyServerResources(hs, input)
    +	require.NoError(t, err)
    +	require.Len(t, objects, 6)
    +	for _, object := range objects {
    +		switch obj := object.(type) {
    +		case *corev1.Service:
    +			require.Equal(t, corev1.ServiceTypeClusterIP, obj.Spec.Type)
    +			require.Len(t, obj.Spec.Ports, 1)
    +			require.EqualValues(t, 443, obj.Spec.Ports[0].Port)
    +			require.Equal(t, "https", obj.Spec.Ports[0].TargetPort.StrVal)
    +		case *appsv1.Deployment:
    +			pod := obj.Spec.Template.Spec
    +			require.Equal(t, "revision-1", obj.Spec.Template.Annotations["ray.io/history-server-revision"])
    +			require.True(t, *pod.SecurityContext.RunAsNonRoot)
    +			require.Nil(t, pod.SecurityContext.RunAsUser)
    +			require.Equal(t, corev1.SeccompProfileTypeRuntimeDefault, pod.SecurityContext.SeccompProfile.Type)
    +			require.Len(t, pod.Containers, 2)
    +			server, proxy := pod.Containers[0], pod.Containers[1]
    +			require.Equal(t, input.Env, server.Env)
    +			require.Empty(t, server.EnvFrom)
    +			require.Contains(t, server.Args, "--enable-live-clusters=false")
    +			require.Equal(t, "/readz", server.ReadinessProbe.HTTPGet.Path)
    +			require.Equal(t, "/livez", server.LivenessProbe.HTTPGet.Path)
    +			require.Contains(t, proxy.Args, "--upstream=http://127.0.0.1:8080/")
    +			require.Contains(t, proxy.Args, "--tls-cert-file=/etc/tls/tls.crt")
    +			require.Contains(t, proxy.Args, input.ProxyTLSArgs[0])
    +			for _, container := range pod.Containers {
    +				require.False(t, *container.SecurityContext.AllowPrivilegeEscalation)
    +				require.True(t, *container.SecurityContext.ReadOnlyRootFilesystem)
    +				require.Contains(t, container.SecurityContext.Capabilities.Drop, corev1.Capability("ALL"))
    +				for _, mount := range container.VolumeMounts {
    +					require.Empty(t, mount.SubPath)
    +				}
    +			}
    +		case *networkingv1.NetworkPolicy:
    +			require.Len(t, obj.Spec.Ingress, 1)
    +			require.Len(t, obj.Spec.Ingress[0].Ports, 1)
    +			require.EqualValues(t, 8443, obj.Spec.Ingress[0].Ports[0].Port.IntVal)
    +			ports := []int32{}
    +			for _, port := range obj.Spec.Egress[0].Ports {
    +				ports = append(ports, port.Port.IntVal)
    +			}
    +			require.Contains(t, ports, int32(9443))
    +			require.Contains(t, ports, int32(6443))
    +			require.Contains(t, ports, int32(5353))
    +			require.NotContains(t, ports, int32(8080))
    +		case *corev1.ConfigMap:
    +			require.Contains(t, obj.Data["config.yaml"], "verb: access")
    +			require.Contains(t, obj.Data["config.yaml"], "resource: rayhistoryservers")
    +			require.Contains(t, obj.Data["config.yaml"], "apiGroup: ray.io")
    +			require.Contains(t, obj.Data["config.yaml"], "resourceName: default")

    Assert name: default instead of resourceName: default.

    pawelpaszki pawelpaszki commented on code on Nov 30, 2026 09:32 UTC
    Code Review
    ray-operator/controllers/ray/rayhistoryserver_resources_test.go:1
    @@ -0,0 +1,101 @@
    +package ray
    +
    +import (
    +	"testing"
    +
    +	"github.com/stretchr/testify/require"
    +	appsv1 "k8s.io/api/apps/v1"
    +	corev1 "k8s.io/api/core/v1"
    +	networkingv1 "k8s.io/api/networking/v1"
    +	rbacv1 "k8s.io/api/rbac/v1"
    +	"k8s.io/apimachinery/pkg/api/resource"
    +
    +	rayv1alpha1 "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" //nolint:staticcheck // RayHistoryServer is intentionally introduced in the v1alpha1 API.
    +)
    +
    +func TestHistoryServerResourcesSecureExposure(t *testing.T) {
    +	hs := historyServerTestCR()
    +	hs.Spec.Storage.S3.Endpoint = "https://s3.example.test:9443"
    +	input := historyServerInputs{Namespace: "operator", Image: "history:tested", ProxyImage: "proxy:tested", TLSSecretName: "serving-cert", Revision: "revision-1", ProxyTLSArgs: []string{"--tls-min-version=VersionTLS12"}, Env: []corev1.EnvVar{{Name: "AWS_SECRET_ACCESS_KEY", ValueFrom: &corev1.EnvVarSource{SecretKeyRef: &corev1.SecretKeySelector{LocalObjectReference: corev1.LocalObjectReference{Name: "source"}, Key: "AWS_SECRET_ACCESS_KEY"}}}}}
    +	objects, err := historyServerResources(hs, input)
    +	require.NoError(t, err)
    +	require.Len(t, objects, 6)
    +	for _, object := range objects {
    +		switch obj := object.(type) {
    +		case *corev1.Service:
    +			require.Equal(t, corev1.ServiceTypeClusterIP, obj.Spec.Type)
    +			require.Len(t, obj.Spec.Ports, 1)
    +			require.EqualValues(t, 443, obj.Spec.Ports[0].Port)
    +			require.Equal(t, "https", obj.Spec.Ports[0].TargetPort.StrVal)
    +		case *appsv1.Deployment:
    +			pod := obj.Spec.Template.Spec
    +			require.Equal(t, "revision-1", obj.Spec.Template.Annotations["ray.io/history-server-revision"])
    +			require.True(t, *pod.SecurityContext.RunAsNonRoot)
    +			require.Nil(t, pod.SecurityContext.RunAsUser)
    +			require.Equal(t, corev1.SeccompProfileTypeRuntimeDefault, pod.SecurityContext.SeccompProfile.Type)
    +			require.Len(t, pod.Containers, 2)
    +			server, proxy := pod.Containers[0], pod.Containers[1]
    +			require.Equal(t, input.Env, server.Env)
    +			require.Empty(t, server.EnvFrom)
    +			require.Contains(t, server.Args, "--enable-live-clusters=false")
    +			require.Equal(t, "/readz", server.ReadinessProbe.HTTPGet.Path)
    +			require.Equal(t, "/livez", server.LivenessProbe.HTTPGet.Path)
    +			require.Contains(t, proxy.Args, "--upstream=http://127.0.0.1:8080/")
    +			require.Contains(t, proxy.Args, "--tls-cert-file=/etc/tls/tls.crt")
    +			require.Contains(t, proxy.Args, input.ProxyTLSArgs[0])
    +			for _, container := range pod.Containers {
    +				require.False(t, *container.SecurityContext.AllowPrivilegeEscalation)
    +				require.True(t, *container.SecurityContext.ReadOnlyRootFilesystem)
    +				require.Contains(t, container.SecurityContext.Capabilities.Drop, corev1.Capability("ALL"))
    +				for _, mount := range container.VolumeMounts {
    +					require.Empty(t, mount.SubPath)
    +				}
    +			}
    +		case *networkingv1.NetworkPolicy:
    +			require.Len(t, obj.Spec.Ingress, 1)
    +			require.Len(t, obj.Spec.Ingress[0].Ports, 1)
    +			require.EqualValues(t, 8443, obj.Spec.Ingress[0].Ports[0].Port.IntVal)
    +			ports := []int32{}
    +			for _, port := range obj.Spec.Egress[0].Ports {
    +				ports = append(ports, port.Port.IntVal)
    +			}
    +			require.Contains(t, ports, int32(9443))
    +			require.Contains(t, ports, int32(6443))
    +			require.Contains(t, ports, int32(5353))
    +			require.NotContains(t, ports, int32(8080))
    +		case *corev1.ConfigMap:
    +			require.Contains(t, obj.Data["config.yaml"], "verb: access")
    +			require.Contains(t, obj.Data["config.yaml"], "resource: rayhistoryservers")
    +			require.Contains(t, obj.Data["config.yaml"], "apiGroup: ray.io")
    +			require.Contains(t, obj.Data["config.yaml"], "resourceName: default")
    +			require.NotContains(t, obj.Data["config.yaml"], "group: ray.io")
    +			require.NotContains(t, obj.Data["config.yaml"], "name: default")

    Remove — name: default should be present.

    pawelpaszki pawelpaszki approved these changes on Dec 01, 2026 11:38 UTC
    Approved Reviewer

    thanks! reverified. all good!

    openshift-ci[bot] openshift-ci[bot] commented on Dec 01, 2026 11:38 UTC
    Bot

    [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:

  • OWNERS
  • 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":[]} -->

    Reviewers
    Assignees
    chipspeak chipspeak
    Labels
    risk: low confidence: 90.8% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 64.1% (MEDIUM) · Higher = larger blast radius
    64.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 90.8% · Lower = rushed or shallow review
    90.8%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 5.9% · Safe to merge
    5.9%