Skip to content

Commit

Permalink
Remove custom Security Context Constraints (#1838)
Browse files Browse the repository at this point in the history
  • Loading branch information
0sewa0 committed Jun 6, 2023
1 parent f620141 commit c294951
Show file tree
Hide file tree
Showing 43 changed files with 538 additions and 986 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{{- include "dynatrace-operator.platformRequired" . }}
{{- if eq (default false .Values.olm) true}}
{{ if eq (include "dynatrace-operator.partial" .) "false" }}
{{- if (eq (include "dynatrace-operator.openshiftOrOlm" .) "true") }}

# Copyright 2021 Dynatrace LLC

Expand All @@ -25,11 +24,25 @@ rules:
- apiGroups:
- security.openshift.io
resourceNames:
- host
- privileged
- nonroot-v2
resources:
- securitycontextconstraints
verbs:
- use
{{- end -}}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: dynatrace-activegate
labels:
{{- include "dynatrace-operator.activegateLabels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: dynatrace-activegate
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: dynatrace-activegate
apiGroup: rbac.authorization.k8s.io
{{- end -}}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,29 @@ rules:
- get
- list
- watch
{{- if (eq (include "dynatrace-operator.openshiftOrOlm" .) "true") }}
- apiGroups:
- security.openshift.io
resourceNames:
- privileged
resources:
- securitycontextconstraints
verbs:
- use
{{ end }}
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: dynatrace-oneagent-csi-driver
labels:
{{- include "dynatrace-operator.csiLabels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: dynatrace-oneagent-csi-driver
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: dynatrace-oneagent-csi-driver
apiGroup: rbac.authorization.k8s.io
{{- end -}}

This file was deleted.

16 changes: 16 additions & 0 deletions config/helm/chart/default/templates/Common/csi/role-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,20 @@ rules:
- get
- list
- watch
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: dynatrace-oneagent-csi-driver
namespace: {{ .Release.Namespace }}
labels:
{{- include "dynatrace-operator.csiLabels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: dynatrace-oneagent-csi-driver
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: dynatrace-oneagent-csi-driver
apiGroup: rbac.authorization.k8s.io
{{- end -}}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,30 @@ rules:
- /livez
verbs:
- get
{{- if eq (default false .Values.olm) true}}
{{- if (eq (include "dynatrace-operator.openshiftOrOlm" .) "true") }}
- apiGroups:
- security.openshift.io
resourceNames:
- host
- privileged
- nonroot-v2
resources:
- securitycontextconstraints
verbs:
- use
{{ end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: dynatrace-kubernetes-monitoring
labels:
{{- include "dynatrace-operator.activegateLabels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: dynatrace-kubernetes-monitoring
subjects:
- kind: ServiceAccount
name: dynatrace-kubernetes-monitoring
namespace: {{ .Release.Namespace }}
{{ end }}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,24 @@ rules:
- apiGroups:
- security.openshift.io
resourceNames:
- host
- privileged
resources:
- securitycontextconstraints
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: dynatrace-dynakube-oneagent-privileged
labels:
{{- include "dynatrace-operator.oneagentLabels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: "dynatrace-dynakube-oneagent-privileged"
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: "dynatrace-dynakube-oneagent-privileged"
{{ end }}
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,24 @@ rules:
- apiGroups:
- security.openshift.io
resourceNames:
- host
- privileged
resources:
- securitycontextconstraints
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: dynatrace-dynakube-oneagent-unprivileged
labels:
{{- include "dynatrace-operator.oneagentLabels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: dynatrace-dynakube-oneagent-unprivileged
namespace: {{ .Release.Namespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: dynatrace-dynakube-oneagent-unprivileged
{{ end }}

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,30 @@ rules:
verbs:
- get
- update
{{- if eq (default false .Values.olm) true}}
{{- if (eq (include "dynatrace-operator.openshiftOrOlm" .) "true") }}
- apiGroups:
- security.openshift.io
resourceNames:
- host
- privileged
- nonroot-v2
resources:
- securitycontextconstraints
verbs:
- use
{{ end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ .Release.Name }}
labels:
{{- include "dynatrace-operator.operatorLabels" . | nindent 4 }}
subjects:
- kind: ServiceAccount
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ .Release.Name }}
apiGroup: rbac.authorization.k8s.io
{{ end }}
Loading

0 comments on commit c294951

Please sign in to comment.