setup/manifests/base/node/node-termination-handler-rbac.yaml (42 lines of code) (raw):

# Copyright 2018 Google Inc. All Rights Reserved. # # Licensed 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: labels: k8s-app: node-termination-handler name: node-termination-handler namespace: kube-system --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: labels: k8s-app: node-termination-handler name: node-termination-handler namespace: kube-system rules: # Allow Node Termination Handler to get and update nodes (for posting taints). - apiGroups: [""] resources: ["nodes"] verbs: ["get", "update"] # Allow Node Termination Handler to create events - apiGroups: [""] resources: ["events"] verbs: ["create"] # Allow Node Termination Handler to list and delete pods (for draining nodes) - apiGroups: [""] resources: ["pods"] verbs: ["get", "list", "delete"] --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: node-termination-handler namespace: kube-system labels: k8s-app: node-termination-handler roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: node-termination-handler subjects: - kind: ServiceAccount name: node-termination-handler namespace: kube-system