123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- {{- if .Values.rbac.create -}}
- apiVersion: rbac.authorization.k8s.io/v1
- kind: Role
- metadata:
- labels:
- {{- include "ingress-nginx.labels" . | nindent 4 }}
- app.kubernetes.io/component: controller
- {{- with .Values.controller.labels }}
- {{- toYaml . | nindent 4 }}
- {{- end }}
- name: {{ include "ingress-nginx.fullname" . }}
- namespace: {{ .Release.Namespace }}
- rules:
- - apiGroups:
- - ""
- resources:
- - namespaces
- verbs:
- - get
- - apiGroups:
- - ""
- resources:
- - configmaps
- - pods
- - secrets
- - endpoints
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - ""
- resources:
- - services
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - networking.k8s.io
- resources:
- - ingresses
- verbs:
- - get
- - list
- - watch
- - apiGroups:
- - networking.k8s.io
- resources:
- - ingresses/status
- verbs:
- - update
- - apiGroups:
- - networking.k8s.io
- resources:
- - ingressclasses
- verbs:
- - get
- - list
- - watch
- # TODO(Jintao Zhang)
- # Once we release a new version of the controller,
- # we will be able to remove the configmap related permissions
- # We have used the Lease API for selection
- # ref: https://github.com/kubernetes/ingress-nginx/pull/8921
- - apiGroups:
- - ""
- resources:
- - configmaps
- resourceNames:
- - {{ include "ingress-nginx.controller.electionID" . }}
- verbs:
- - get
- - update
- - apiGroups:
- - ""
- resources:
- - configmaps
- verbs:
- - create
- - apiGroups:
- - coordination.k8s.io
- resources:
- - leases
- resourceNames:
- - {{ include "ingress-nginx.controller.electionID" . }}
- verbs:
- - get
- - update
- - apiGroups:
- - coordination.k8s.io
- resources:
- - leases
- verbs:
- - create
- - apiGroups:
- - ""
- resources:
- - events
- verbs:
- - create
- - patch
- - apiGroups:
- - discovery.k8s.io
- resources:
- - endpointslices
- verbs:
- - list
- - watch
- - get
- {{- if .Values.podSecurityPolicy.enabled }}
- - apiGroups: [{{ template "podSecurityPolicy.apiGroup" . }}]
- resources: ['podsecuritypolicies']
- verbs: ['use']
- {{- with .Values.controller.existingPsp }}
- resourceNames: [{{ . }}]
- {{- else }}
- resourceNames: [{{ include "ingress-nginx.fullname" . }}]
- {{- end }}
- {{- end }}
- {{- end }}
|