1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- {{- /*
- Copyright 2020 Crown Copyright
- 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.
- */ -}}
- {{- if and .Values.config.rackAwareness .Values.config.rackAwareness.nodeTopologyLabel -}}
- apiVersion: rbac.authorization.k8s.io/v1
- kind: ClusterRole
- metadata:
- name: {{ template "hdfs.fullname" . }}-namenode
- labels:
- {{- include "hdfs.labels" . | nindent 4 }}
- app.kubernetes.io/component: namenode
- rules:
- - apiGroups: [""]
- resources: ["nodes"]
- verbs: ["get"]
- ---
- apiVersion: rbac.authorization.k8s.io/v1
- kind: Role
- metadata:
- name: {{ template "hdfs.fullname" . }}-namenode
- labels:
- {{- include "hdfs.labels" . | nindent 4 }}
- app.kubernetes.io/component: namenode
- rules:
- - apiGroups: [""]
- resources: ["pods"]
- verbs: ["list"]
- ---
- apiVersion: rbac.authorization.k8s.io/v1
- kind: ClusterRoleBinding
- metadata:
- name: {{ template "hdfs.fullname" . }}-namenode
- labels:
- {{- include "hdfs.labels" . | nindent 4 }}
- app.kubernetes.io/component: namenode
- roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: ClusterRole
- name: {{ template "hdfs.fullname" . }}-namenode
- subjects:
- - kind: ServiceAccount
- name: {{ template "hdfs.namenodeServiceAccountName" . }}
- namespace: {{ .Release.Namespace }}
- ---
- apiVersion: rbac.authorization.k8s.io/v1
- kind: RoleBinding
- metadata:
- name: {{ template "hdfs.fullname" . }}-namenode
- labels:
- {{- include "hdfs.labels" . | nindent 4 }}
- app.kubernetes.io/component: namenode
- roleRef:
- apiGroup: rbac.authorization.k8s.io
- kind: Role
- name: {{ template "hdfs.fullname" . }}-namenode
- subjects:
- - kind: ServiceAccount
- name: {{ template "hdfs.namenodeServiceAccountName" . }}
- namespace: {{ .Release.Namespace }}
- {{- end -}}
|