cw-infra-apps/grafana/templates/platform_specific/openshift/alloy-receiver-scc.yaml
2025-05-28 10:01:42 +03:00

81 lines
1.8 KiB
YAML

{{- if and (index .Values "alloy-receiver").enabled (eq .Values.global.platform "openshift") }}
---
apiVersion: security.openshift.io/v1
kind: SecurityContextConstraints
metadata:
name: {{ include "alloy.fullname" (index .Subcharts "alloy-receiver") }}
allowHostDirVolumePlugin: false
allowHostIPC: false
allowHostNetwork: false
allowHostPID: false
allowHostPorts: false
allowPrivilegeEscalation: false
allowPrivilegedContainer: false
allowedCapabilities:
- CHOWN
- DAC_OVERRIDE
- FOWNER
- FSETID
- KILL
- SETGID
- SETUID
- SETPCAP
- NET_BIND_SERVICE
- NET_RAW
- SYS_CHROOT
- MKNOD
- AUDIT_WRITE
- SETFCAP
defaultAddCapabilities: null
defaultAllowPrivilegeEscalation: false
forbiddenSysctls:
- '*'
fsGroup:
type: RunAsAny
groups: []
priority: null
readOnlyRootFilesystem: false # Set because Grafana Alloy needs to write to /tmp/alloy
requiredDropCapabilities: null
runAsUser:
type: RunAsAny
seLinuxContext:
type: RunAsAny
seccompProfiles:
- runtime/default
supplementalGroups:
type: RunAsAny
users: []
volumes:
- configMap
- emptyDir
- projected
- secret
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "alloy.fullname" (index .Subcharts "alloy-receiver") }}-scc
rules:
- verbs:
- use
apiGroups:
- security.openshift.io
resources:
- securitycontextconstraints
resourceNames:
- {{ include "alloy.fullname" (index .Subcharts "alloy-receiver") }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "alloy.fullname" (index .Subcharts "alloy-receiver") }}-scc
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ include "alloy.fullname" (index .Subcharts "alloy-receiver") }}-scc
subjects:
- kind: ServiceAccount
name: {{ include "alloy.fullname" (index .Subcharts "alloy-receiver") }}
namespace: {{ .Release.Namespace }}
{{- end }}