Skip to content
This repository was archived by the owner on Jan 9, 2020. It is now read-only.

Commit 3eb04bb

Browse files
authored
Added reference YAML files for RBAC configs for driver and shuffle service (#502)
1 parent 7477cbe commit 3eb04bb

File tree

2 files changed

+135
-0
lines changed

2 files changed

+135
-0
lines changed

conf/k8s-shuffle-service-rbac.yaml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
apiVersion: v1
19+
kind: ServiceAccount
20+
metadata:
21+
name: spark-shuffle-service-service-account
22+
namespace: default
23+
labels:
24+
app: spark-shuffle-service
25+
spark-version: 2.2.0
26+
---
27+
apiVersion: extensions/v1beta1
28+
kind: PodSecurityPolicy
29+
metadata:
30+
name: spark-shuffle-service-pod-security-policy
31+
labels:
32+
app: spark-shuffle-service
33+
spark-version: 2.2.0
34+
spec:
35+
privileged: false
36+
fsGroup:
37+
rule: RunAsAny
38+
runAsUser:
39+
rule: RunAsAny
40+
volumes:
41+
- "hostPath"
42+
- "secret"
43+
---
44+
apiVersion: rbac.authorization.k8s.io/v1beta1
45+
kind: ClusterRole
46+
metadata:
47+
name: spark-shuffle-service-role
48+
labels:
49+
app: spark-shuffle-service
50+
spark-version: 2.2.0
51+
rules:
52+
- apiGroups:
53+
- "extensions"
54+
resources:
55+
- "podsecuritypolicies"
56+
resourceNames:
57+
- "spark-shuffle-service-pod-security-policy"
58+
verbs:
59+
- "use"
60+
- apiGroups:
61+
- "" # "" indicates the core API group
62+
resources:
63+
- "pods"
64+
verbs:
65+
- "get"
66+
- "list"
67+
- "watch"
68+
---
69+
apiVersion: rbac.authorization.k8s.io/v1beta1
70+
kind: ClusterRoleBinding
71+
metadata:
72+
name: spark-shuffle-service-role-binding
73+
subjects:
74+
- kind: ServiceAccount
75+
name: spark-shuffle-service-service-account
76+
namespace: default
77+
roleRef:
78+
apiGroup: rbac.authorization.k8s.io
79+
kind: ClusterRole
80+
name: spark-shuffle-service-role

conf/k8s-spark-rbac.yaml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
apiVersion: v1
19+
kind: ServiceAccount
20+
metadata:
21+
name: spark
22+
namespace: default
23+
---
24+
apiVersion: rbac.authorization.k8s.io/v1beta1
25+
kind: Role
26+
metadata:
27+
namespace: default
28+
name: spark-role
29+
rules:
30+
- apiGroups:
31+
- "" # "" indicates the core API group
32+
resources:
33+
- "pods"
34+
verbs:
35+
- "*"
36+
- apiGroups:
37+
- "" # "" indicates the core API group
38+
resources:
39+
- "services"
40+
verbs:
41+
- "*"
42+
---
43+
apiVersion: rbac.authorization.k8s.io/v1beta1
44+
kind: RoleBinding
45+
metadata:
46+
name: spark-role-binding
47+
namespace: default
48+
subjects:
49+
- kind: ServiceAccount
50+
name: spark
51+
namespace: default
52+
roleRef:
53+
kind: Role
54+
name: spark-role
55+
apiGroup: rbac.authorization.k8s.io

0 commit comments

Comments
 (0)