Describe the bug
Role and RoleBinding for pyroscope-discovery are missing namespace: {{ .Release.Namespace }}.
This results in error log entries, like e.g.:
caller=builder.go:44 target=kubernetes:///pyroscope-headless.pyroscope-test.svc.cluster.local.:9095 component=kuberesolver-discovery msg="watching ended with error, will reconnect again" err="invalid response code 403 for service pyroscope-headless in namespace pyroscope-test"
To Reproduce
helm template pyroscope grafana/pyroscope --version 2.2.0 --namespace pyroscope-test > pyroscope-test.yaml results in:
# Source: pyroscope/templates/rbac-discovery.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: pyroscope-discovery
labels:
helm.sh/chart: pyroscope-2.2.0
app.kubernetes.io/name: pyroscope
app.kubernetes.io/instance: pyroscope
app.kubernetes.io/version: "2.2.0"
app.kubernetes.io/managed-by: Helm
rules:
- apiGroups:
- ""
- discovery.k8s.io
resources:
- endpointslices
- endpoints
- services
- pods
verbs:
- get
- watch
- list
---
# Source: pyroscope/templates/rbac-discovery.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: pyroscope-discovery
labels:
helm.sh/chart: pyroscope-2.2.0
app.kubernetes.io/name: pyroscope
app.kubernetes.io/instance: pyroscope
app.kubernetes.io/version: "2.2.0"
app.kubernetes.io/managed-by: Helm
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: pyroscope-discovery
subjects:
- kind: ServiceAccount
name: pyroscope
namespace: pyroscope-test
kubectl apply -f pyroscope-test.yaml
- Inspect logs via
kubectl logs -n pyroscope-test statefulsets/pyroscope, watch for above mentioned log entries
kubectl get role -n pyroscope-test returns No resources
Expected behavior
Role and RoleBinding are created in the release namespace (matching all other chart resources) and the Pyroscope ServiceAccount can watch Endpoints/EndpointSlices in its own namespace.
Environment
- Infrastructure: Kubernetes (GKE)
- Deployment tool: helm
Additional Context
Describe the bug
RoleandRoleBindingforpyroscope-discoveryare missingnamespace: {{ .Release.Namespace }}.This results in error log entries, like e.g.:
To Reproduce
helm template pyroscope grafana/pyroscope --version 2.2.0 --namespace pyroscope-test > pyroscope-test.yamlresults in:kubectl apply -f pyroscope-test.yamlkubectl logs -n pyroscope-test statefulsets/pyroscope, watch for above mentioned log entrieskubectl get role -n pyroscope-testreturnsNo resourcesExpected behavior
RoleandRoleBindingare created in the release namespace (matching all other chart resources) and the Pyroscope ServiceAccount can watch Endpoints/EndpointSlices in its own namespace.Environment
Additional Context