From 264569f215ed51a45fa9ece0a431c87c072cd9ea Mon Sep 17 00:00:00 2001 From: Nash Luffman Date: Sun, 16 Aug 2020 00:46:50 -0400 Subject: [PATCH] Added clusterRole, clusterRoleBinding, and SA to metallb module --- modules/metallb.jsonnet | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/metallb.jsonnet b/modules/metallb.jsonnet index 1a4bc0e..578c9f6 100644 --- a/modules/metallb.jsonnet +++ b/modules/metallb.jsonnet @@ -24,5 +24,24 @@ local k = import 'ksonnet/ksonnet.beta.4/k.libsonnet'; service.mixin.metadata.withNamespace('metallb-system') + service.mixin.metadata.withLabels({ 'k8s-app': 'metallb-controller' }) + service.mixin.spec.withClusterIp('None'), + + clusterRole: + utils.newClusterRole('metallb-exporter', [ + { + apis: [''], + res: ['services', 'endpoints', 'pods'], + verbs: ['get', 'list', 'watch'], + }, + ], null), + + + serviceAccount: + utils.newServiceAccount('metallb-exporter', $._config.namespace, null), + + + clusterRoleBinding: + utils.newClusterRoleBinding('metallb-exporter', 'metallb-exporter', $._config.namespace, 'metallb-exporter', null), + + }, }