-
Notifications
You must be signed in to change notification settings - Fork 43
/
openshift_rbac.yaml
73 lines (64 loc) · 1.37 KB
/
openshift_rbac.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
#
# Copyright (c) 2023, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
#
---
# Create a Security Context Contraint
kind: SecurityContextConstraints
apiVersion: v1
metadata:
name: sidb-scc
namespace: default
allowPrivilegedContainer: false
users:
- system:serviceaccount:default:sidb-sa
- system:serviceaccount:default:oracle-database-operator
runAsUser:
type: MustRunAsRange
uidRangeMin: 0
uidRangeMax: 60000
seLinuxContext:
type: RunAsAny
fsGroup:
type: MustRunAs
ranges:
- min: 0
max: 60000
supplementalGroups:
type: MustRunAs
ranges:
- min: 0
max: 60000
---
# Create Service Account
apiVersion: v1
kind: ServiceAccount
metadata:
name: sidb-sa
namespace: default
---
# Create a rbac role
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-sidb-scc
namespace: default
rules:
- apiGroups: ["security.openshift.io"]
resources: ["securitycontextconstraints"]
resourceNames: ["sidb-scc"]
verbs: ["use"]
---
# Create a rbac role binding
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: use-sidb-scc
namespace: default
subjects:
- kind: ServiceAccount
name: sidb-sa
roleRef:
kind: Role
name: use-sidb-scc
apiGroup: rbac.authorization.k8s.io