From 639dbb1d88261a73425db3dad553dcaa4db49a46 Mon Sep 17 00:00:00 2001 From: lwabish Date: Thu, 9 May 2024 15:46:25 +0800 Subject: [PATCH] chart: Expose the speaker's name as env variable and update rbac config Use k8s downward api to expose speaker pod name as env variable. Update the rbac config to allow the speaker to get the speaker pod. With these modification, metallb installation from helm can work correctly. Signed-off-by: lwabish --- charts/metallb/templates/rbac.yaml | 2 +- charts/metallb/templates/speaker.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/metallb/templates/rbac.yaml b/charts/metallb/templates/rbac.yaml index 914ff82af23..0acff046c6a 100644 --- a/charts/metallb/templates/rbac.yaml +++ b/charts/metallb/templates/rbac.yaml @@ -79,7 +79,7 @@ metadata: rules: - apiGroups: [""] resources: ["pods"] - verbs: ["list"] + verbs: ["list", "get"] - apiGroups: [""] resources: ["secrets"] verbs: ["get", "list", "watch"] diff --git a/charts/metallb/templates/speaker.yaml b/charts/metallb/templates/speaker.yaml index ac7ee629812..fa428dee25f 100644 --- a/charts/metallb/templates/speaker.yaml +++ b/charts/metallb/templates/speaker.yaml @@ -288,6 +288,10 @@ spec: - name: METALLB_BGP_TYPE value: frr-k8s {{- end }} + - name: METALLB_POD_NAME + valueFrom: + fieldRef: + fieldPath: metadata.name ports: - name: monitoring containerPort: {{ .Values.prometheus.metricsPort }}