This repository has been archived by the owner on Sep 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
policy-deployment.yaml
executable file
·87 lines (87 loc) · 2.04 KB
/
policy-deployment.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
apiVersion: v1
kind: Namespace
metadata:
name: user-container-selinux
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: user-container-selinux
namespace: user-container-selinux
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: user-container-selinux
rules:
- apiGroups:
- security.openshift.io
resourceNames:
- privileged
resources:
- securitycontextconstraints
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: user-container-selinux
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: user-container-selinux
subjects:
- kind: ServiceAccount
name: user-container-selinux
namespace: user-container-selinux
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: container-selinux-policy
namespace: user-container-selinux
spec:
selector:
matchLabels:
app: container-selinux-policy
template:
metadata:
labels:
app: container-selinux-policy
spec:
initContainers:
- name: container-selinux-init
image: >-
registry.connect.redhat.com/intel/user-container-selinux:latest
imagePullPolicy: Always
securityContext:
privileged: true
volumeMounts:
- name: var-lib-selinux
mountPath: /var/lib/selinux
- name: etc-selinux
mountPath: /etc/selinux
- name: sys
mountPath: /sys
containers:
- name: container-selinux
image: >-
registry.access.redhat.com/ubi8-micro:latest
imagePullPolicy: IfNotPresent
command: [ "/bin/bash", "-c", "--" ]
args: [ "while true; do sleep 60; done;" ]
volumes:
- name: var-lib-selinux
hostPath:
path: /var/lib/selinux
type: DirectoryOrCreate
- name: etc-selinux
hostPath:
path: /etc/selinux
type: DirectoryOrCreate
- name: sys
hostPath:
path: /sys
type: DirectoryOrCreate
serviceAccountName: user-container-selinux