From 37728d7e264d1c49b933a3860cc735fa3afd47d3 Mon Sep 17 00:00:00 2001 From: mtojek Date: Mon, 19 Apr 2021 15:02:55 +0200 Subject: [PATCH] Fix: define role and rolebinding --- .../static_kubernetes_elastic_agent_yml.go | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/internal/install/static_kubernetes_elastic_agent_yml.go b/internal/install/static_kubernetes_elastic_agent_yml.go index cfcab2d3f..b6bec48b8 100644 --- a/internal/install/static_kubernetes_elastic_agent_yml.go +++ b/internal/install/static_kubernetes_elastic_agent_yml.go @@ -127,6 +127,34 @@ rules: verbs: - get --- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + namespace: kube-system + name: kind-fleet-agent +subjects: + - kind: ServiceAccount + name: kind-fleet-agent + namespace: kube-system +roleRef: + kind: Role + name: kind-fleet-agent + apiGroup: rbac.authorization.k8s.io +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: kind-fleet-agent + namespace: kube-system + labels: + k8s-app: kind-fleet-agent +rules: + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: ["get", "create", "update"] +--- apiVersion: v1 kind: ServiceAccount metadata: