Skip to content

Conversation

@LilyLinh
Copy link
Contributor

@LilyLinh LilyLinh commented Dec 1, 2025

Adds security hardening settings to ray-operator/config/manager/manager.yaml to align with the Helm chart defaults and Kubernetes Pod Security Standards.

##Changes:

  • Add capabilities.drop: [ALL]
  • Add readOnlyRootFilesystem: true

Why?

The Helm chart (helm-chart/kuberay-operator/values.yaml) already includes these security settings by default. This PR ensures consistency between kustomize and Helm deployments.

These settings follow:

  • Kubernetes Pod Security Standards (restricted profile)
  • OpenShift Security Context Constraints (restricted-v2 SCC)

Testing

  • Helm unit tests pass (39 tests)
  • E2E tests pass (core functionality)
  • Verified on local Kind cluster
  • Verified security context applied correctly

Copy link
Member

@andrewsykim andrewsykim left a comment

Choose a reason for hiding this comment

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

@vinayakankugoyal would appreciate your review on this

Copy link
Member

@Future-Outlier Future-Outlier left a comment

Choose a reason for hiding this comment

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

thank you, cc @rueian for merge

Copy link
Member

@Future-Outlier Future-Outlier left a comment

Choose a reason for hiding this comment

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

cc @AndySung320 @justinyeh1995 @400Ping for review if you are interested

Copy link
Contributor

@justinyeh1995 justinyeh1995 left a comment

Choose a reason for hiding this comment

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

I tested this on a fresh kind cluster

kind create cluster --name kuberay-test-pr4243 --image=kindest/node:v1.26.0
kubectl create -k ray-operator/config/default
kubectl get deploy kuberay-operator -o yaml | yq '.spec.template.spec.containers[0].securityContext'

The kuberay-operator Deployment’s container now has the hardened securityContext

{
  "allowPrivilegeEscalation": false,
  "capabilities": {
    "drop": [
      "ALL"
    ]
  },
  "readOnlyRootFilesystem": true,
  "seccompProfile": {
    "type": "RuntimeDefault"
  }
}

The operator works fine, and I also applied a sample RayCluster to confirm that reconciliation proceeds normally.

Looks good to me.

Copy link
Contributor

@400Ping 400Ping left a comment

Choose a reason for hiding this comment

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

Tested locally as well, LGTM.

@AndySung320
Copy link

LGTM, thanks for the clarification.
Good to know the official operator image is already distroless and compatible with the hardened security context.

@rueian rueian merged commit 2926163 into ray-project:master Dec 8, 2025
27 checks passed
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.

10 participants