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 SCC for clusterController on OpenShift #3730

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
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
30 changes: 30 additions & 0 deletions cost-analyzer/templates/cloud-controller-ocp-scc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{{- if and (.Capabilities.APIVersions.Has "security.openshift.io/v1/SecurityContextConstraints") (.Values.global.platforms.openshift.scc.clusterController) (.Values.clusterController.enabled) }}
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: {{ template "kubecost.clusterControllerName" . }}
priority: 10
allowPrivilegedContainer: true
allowHostDirVolumePlugin: true
allowHostNetwork: true
allowHostPorts: true
allowHostPID: false
allowHostIPC: false
readOnlyRootFilesystem: false
runAsUser:
type: RunAsAny
fsGroup:
type: RunAsAny
seLinuxContext:
type: RunAsAny
supplementalGroups:
type: RunAsAny
seccompProfiles:
- runtime/default
volumes:
- hostPath
- projected
- configMap
users:
- system:serviceaccount:{{ .Release.Namespace }}:{{ template "kubecost.clusterControllerName" . }}
{{- end }}
3 changes: 3 additions & 0 deletions cost-analyzer/values-openshift.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ global:
scc:
nodeExporter: false # Creates an SCC for Prometheus Node Exporter. This requires Node Exporter be enabled.
networkCosts: false # Creates an SCC for Kubecost network-costs. This requires network-costs be enabled.
clusterController: false # Creates an SCC for Kubecost Cluster Controller. This requires clusterController be enabled.
# When OpenShift is enabled, the following securityContext will be applied to all resources unless they define their own.
securityContext:
runAsNonRoot: true
Expand All @@ -33,3 +34,5 @@ global:
# prometheus:
# nodeExporter:
# enabled: true # Enable Prometheus Node Exporter.
# clusterController:
# enabled: true # Enable the Cluster Controller.