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 all commits
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
10 changes: 10 additions & 0 deletions ray-operator/config/openshift/kuberay-operator-image-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: kuberay-operator
spec:
template:
spec:
containers:
- name: kuberay-operator
image: $(image)
44 changes: 44 additions & 0 deletions ray-operator/config/openshift/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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
- name: image
objref:
kind: ConfigMap
name: ray-config
apiVersion: v1
fieldref:
fieldpath: data.odh-kuberay-operator-controller-image

resources:
- ray_operator_scc.yaml
- ../default

commonLabels:
app.kubernetes.io/name: kuberay
app.kubernetes.io/component: kuberay-operator

patches:
- path: kuberay-operator-image-patch.yaml
target:
group: apps
version: v1
kind: Deployment
name: kuberay-operator
2 changes: 2 additions & 0 deletions ray-operator/config/openshift/params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
namespace=opendatahub
odh-kuberay-operator-controller-image=quay.io/kuberay/operator:v0.6.0
5 changes: 5 additions & 0 deletions ray-operator/config/openshift/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
varReference:
- 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
Loading