Skip to content

Commit

Permalink
Added reference YAML files for RBAC configs for driver and shuffle se…
Browse files Browse the repository at this point in the history
…rvice (#502)
  • Loading branch information
liyinan926 authored and mccheah committed Sep 26, 2017
1 parent 8b17246 commit 84f4602
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 0 deletions.
80 changes: 80 additions & 0 deletions conf/k8s-shuffle-service-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: v1
kind: ServiceAccount
metadata:
name: spark-shuffle-service-service-account
namespace: default
labels:
app: spark-shuffle-service
spark-version: 2.2.0
---
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: spark-shuffle-service-pod-security-policy
labels:
app: spark-shuffle-service
spark-version: 2.2.0
spec:
privileged: false
fsGroup:
rule: RunAsAny
runAsUser:
rule: RunAsAny
volumes:
- "hostPath"
- "secret"
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: spark-shuffle-service-role
labels:
app: spark-shuffle-service
spark-version: 2.2.0
rules:
- apiGroups:
- "extensions"
resources:
- "podsecuritypolicies"
resourceNames:
- "spark-shuffle-service-pod-security-policy"
verbs:
- "use"
- apiGroups:
- "" # "" indicates the core API group
resources:
- "pods"
verbs:
- "get"
- "list"
- "watch"
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: spark-shuffle-service-role-binding
subjects:
- kind: ServiceAccount
name: spark-shuffle-service-service-account
namespace: default
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: spark-shuffle-service-role
55 changes: 55 additions & 0 deletions conf/k8s-spark-rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

apiVersion: v1
kind: ServiceAccount
metadata:
name: spark
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
namespace: default
name: spark-role
rules:
- apiGroups:
- "" # "" indicates the core API group
resources:
- "pods"
verbs:
- "*"
- apiGroups:
- "" # "" indicates the core API group
resources:
- "services"
verbs:
- "*"
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
name: spark-role-binding
namespace: default
subjects:
- kind: ServiceAccount
name: spark
namespace: default
roleRef:
kind: Role
name: spark-role
apiGroup: rbac.authorization.k8s.io

0 comments on commit 84f4602

Please sign in to comment.