Closed kolesoffac closed 5 years ago
@kolesoffac how did you manage this issue?
Missing RBAC
apiVersion: v1
kind: ServiceAccount
metadata:
name: kube-consul-register
namespace: consul
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: kube-consul-register
rules:
- apiGroups: [""]
resources: ["configmaps", "services", "endpoints", "pods"]
verbs: ["watch", "get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: kube-consul-register
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: kube-consul-register
subjects:
- kind: ServiceAccount
name: kube-consul-register
namespace: consul
I add config to my kubernetes and rs/kube-consul-register, but in log have:
E1108 13:44:19.614014 1 main.go:93] Unable to load configuration: configmaps "kube-consul-register" is forbidden: User "system:serviceaccount:default:default" cannot get resource "configmaps" in API group "" in the namespace "default"
How can i fix it?
Thanks