Created
May 17, 2018 20:04
-
-
Save cjimti/b06886efc6313192282224d7c84c2151 to your computer and use it in GitHub Desktop.
Kubernetes Ingress Nginx RBAC Configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: ServiceAccount | |
metadata: | |
name: nginx-ingress-serviceaccount | |
namespace: ingress-nginx | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRole | |
metadata: | |
name: nginx-ingress-clusterrole | |
rules: | |
- apiGroups: | |
- "" | |
resources: | |
- configmaps | |
- endpoints | |
- nodes | |
- pods | |
- secrets | |
verbs: | |
- list | |
- watch | |
- apiGroups: | |
- "" | |
resources: | |
- nodes | |
verbs: | |
- get | |
- apiGroups: | |
- "" | |
resources: | |
- services | |
verbs: | |
- get | |
- list | |
- watch | |
- apiGroups: | |
- "extensions" | |
resources: | |
- ingresses | |
verbs: | |
- get | |
- list | |
- watch | |
- apiGroups: | |
- "" | |
resources: | |
- events | |
verbs: | |
- create | |
- patch | |
- apiGroups: | |
- "extensions" | |
resources: | |
- ingresses/status | |
verbs: | |
- update | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: Role | |
metadata: | |
name: nginx-ingress-role | |
namespace: ingress-nginx | |
rules: | |
- apiGroups: | |
- "" | |
resources: | |
- configmaps | |
- pods | |
- secrets | |
- namespaces | |
verbs: | |
- get | |
- apiGroups: | |
- "" | |
resources: | |
- configmaps | |
resourceNames: | |
# Defaults to "<election-id>-<ingress-class>" | |
# Here: "<ingress-controller-leader>-<nginx>" | |
# This has to be adapted if you change either parameter | |
# when launching the nginx-ingress-controller. | |
- "ingress-controller-leader-nginx" | |
verbs: | |
- get | |
- update | |
- apiGroups: | |
- "" | |
resources: | |
- configmaps | |
verbs: | |
- create | |
- apiGroups: | |
- "" | |
resources: | |
- endpoints | |
verbs: | |
- get | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: RoleBinding | |
metadata: | |
name: nginx-ingress-role-nisa-binding | |
namespace: ingress-nginx | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: Role | |
name: nginx-ingress-role | |
subjects: | |
- kind: ServiceAccount | |
name: nginx-ingress-serviceaccount | |
namespace: ingress-nginx | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1beta1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: nginx-ingress-clusterrole-nisa-binding | |
roleRef: | |
apiGroup: rbac.authorization.k8s.io | |
kind: ClusterRole | |
name: nginx-ingress-clusterrole | |
subjects: | |
- kind: ServiceAccount | |
name: nginx-ingress-serviceaccount | |
namespace: ingress-nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment