Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loki: duplicate ServiceAccounts rendered #13170

Closed
NickLarsenNZ opened this issue Oct 26, 2022 · 4 comments · Fixed by #13242
Closed

Loki: duplicate ServiceAccounts rendered #13170

NickLarsenNZ opened this issue Oct 26, 2022 · 4 comments · Fixed by #13242
Assignees
Labels
grafana-loki solved tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@NickLarsenNZ
Copy link

NickLarsenNZ commented Oct 26, 2022

Name and Version

bitnami/loki 2.4.5

What steps will reproduce the bug?

  1. Add the bitnami helm repo
  helm repo add bitnami https://charts.bitnami.com/bitnami
  helm repo update
  1. Run
  helm template loki bitnami/grafana-loki \
     --version=v2.4.5 \
     --set serviceAccount.create=true

Are you using any custom parameters or values?

Only --set serviceAccount.create=true

What is the expected behavior?

I would expect the Promtail ServiceAccount to have a different name, unique to any others

What do you see instead?

Notice two ServiceAccounts with the same name

---
# Source: grafana-loki/templates/promtail/service-account.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: loki-grafana-loki
  namespace: "default"
  labels:
    app.kubernetes.io/name: grafana-loki
    helm.sh/chart: grafana-loki-2.4.5
    app.kubernetes.io/instance: loki
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/part-of: grafana-loki
    app.kubernetes.io/component: loki
  annotations:
automountServiceAccountToken: true
---
# Source: grafana-loki/templates/service-account.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: loki-grafana-loki
  namespace: "default"
  labels:
    app.kubernetes.io/name: grafana-loki
    helm.sh/chart: grafana-loki-2.4.5
    app.kubernetes.io/instance: loki
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/part-of: grafana-loki
    app.kubernetes.io/component: loki
  annotations:
automountServiceAccountToken: true
---

Additional information

This is probably ok when using Helm on its own, but it breaks when using the rendered template as a base for Kustomize, which gives the error: may not add resource with an already registered id: ~G_v1_ServiceAccount|default|loki-grafana-loki

Error: accumulating resources: accumulation err='accumulating resources from 'helm-template.yml': may not add resource with an already registered id: ~G_v1_ServiceAccount|default|loki-grafana-loki': got file 'helm-template.yml', but '/tmp/loki/helm-template.yml' must be a directory to be a root
@NickLarsenNZ NickLarsenNZ added the tech-issues The user has a technical issue about an application label Oct 26, 2022
@github-actions github-actions bot added the triage Triage is needed label Oct 26, 2022
@carrodher
Copy link
Member

Thanks for reporting this issue. Would you like to contribute by creating a PR to solve the issue? The Bitnami team will be happy to review it and provide feedback. Here you can find the contributing guidelines.

@cleverhu
Copy link
Contributor

I create a request for this,PTAL.

@carrodher
Copy link
Member

Thanks for the PR! The team will take a look and provide feedback

@NickLarsenNZ
Copy link
Author

Thanks @cleverhu, I didn't manage to get to this in time :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
grafana-loki solved tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants