Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: Security context constraints #3

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ray-operator/config/openshift/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: opendatahub

configMapGenerator:
- name: ray-config
envs:
- params.env
configurations:
- params.yaml

vars:
- name: namespace
objref:
kind: ConfigMap
name: ray-config
apiVersion: v1
fieldref:
fieldpath: data.namespace

resources:
- ray_operator_scc.yaml
- ../default

commonLabels:
app.kubernetes.io/name: kuberay
app.kubernetes.io/component: kuberay-operator
1 change: 1 addition & 0 deletions ray-operator/config/openshift/params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
namespace=opendatahub
7 changes: 7 additions & 0 deletions ray-operator/config/openshift/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
varReference:
- path: subjects[]/namespace
kind: ClusterRoleBinding
astefanutti marked this conversation as resolved.
Show resolved Hide resolved
- path: users[]
kind: SecurityContextConstraints
- path: spec/template/spec/containers[]/image
astefanutti marked this conversation as resolved.
Show resolved Hide resolved
kind: Deployment
11 changes: 11 additions & 0 deletions ray-operator/config/openshift/ray_operator_scc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
kind: SecurityContextConstraints
apiVersion: security.openshift.io/v1
metadata:
name: run-as-ray-user
seLinuxContext:
type: MustRunAs
runAsUser:
type: MustRunAs
uid: 1000
users:
- 'system:serviceaccount:$(namespace):kuberay-operator'
astefanutti marked this conversation as resolved.
Show resolved Hide resolved