Skip to content

Commit

Permalink
Add a SCC for Kepler (#715)
Browse files Browse the repository at this point in the history
Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall authored Sep 6, 2024
1 parent 8efc3ce commit 99c3345
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{{- if and (eq .Values.cluster.platform "openshift") .Values.kepler.enabled }}
---
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: {{ include "kepler.fullname" .Subcharts.kepler }}
allowHostDirVolumePlugin: true
allowHostIPC: false
allowHostNetwork: true
allowHostPID: false
allowHostPorts: true
allowPrivilegeEscalation: true
allowPrivilegedContainer: true
allowedCapabilities: []
defaultAddCapabilities: null
defaultAllowPrivilegeEscalation: false
forbiddenSysctls:
- '*'
fsGroup:
type: RunAsAny
groups: []
priority: null
readOnlyRootFilesystem: true
requiredDropCapabilities: null
runAsUser:
type: RunAsAny
seLinuxContext:
type: RunAsAny
seccompProfiles:
- runtime/default
supplementalGroups:
type: RunAsAny
users:
- system:serviceaccount:{{ .Release.Namespace }}:{{ include "kepler.fullname" .Subcharts.kepler }}
volumes:
- configMap
- hostPath
- projected
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "kepler.fullname" .Subcharts.kepler }}-scc
rules:
- verbs:
- use
apiGroups:
- security.openshift.io
resources:
- securitycontextconstraints
resourceNames:
- {{ include "kepler.fullname" .Subcharts.kepler }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "kepler.fullname" .Subcharts.kepler }}-scc
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "kepler.fullname" .Subcharts.kepler }}-scc
subjects:
- kind: ServiceAccount
name: {{ include "kepler.fullname" .Subcharts.kepler }}
namespace: {{ .Release.Namespace }}
{{- end -}}
18 changes: 9 additions & 9 deletions examples/openshift-compatible/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 99c3345

Please sign in to comment.