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

fix(helm/loki): Add namespace to Loki templates for ruler and index-gateway #14838

Conversation

site0801
Copy link
Contributor

@site0801 site0801 commented Nov 8, 2024

What this PR does / why we need it:

When installing Loki in Distributed mode using the Helm chart, the ruler and index-gateway were missing a namespace.
I would like them to refer to .Release.Namespace, like the other templates, even if the namespace is not specified in the Helm CLI.
However, if someone has intentionally omitted this description for some reason, I apologize.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • If the change is deprecating or removing a configuration option, update the deprecated-config.yaml and deleted-config.yaml files respectively in the tools/deprecated-config-checker directory. Example PR

@site0801 site0801 requested a review from a team as a code owner November 8, 2024 07:23
@CLAassistant
Copy link

CLAassistant commented Nov 8, 2024

CLA assistant check
All committers have signed the CLA.

This comment has been minimized.

Copy link
Collaborator

@trevorwhitney trevorwhitney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, thanks!

This comment has been minimized.

@site0801
Copy link
Contributor Author

@trevorwhitney
Thanks for approve!
I followed the Branch of this PR to upstream as it was failing in git with the lint-check of this PR's test.
If there is anything else I could do, please let me know!

@site0801
Copy link
Contributor Author

Sorry for the repeated CI failures.
I'm looking at a few other PRs, but is it possible that the recommended way to create a PR for loki's helm is to create a Branch directly in grafana/loki, rather than folk and create a PR?

This comment has been minimized.

Copy link
Contributor

Kubernetes Manifest Diff Summary

Scenario: default-single-binary-values (Added: 0, Modified: 6, Removed: 0)

Summary:

  • Added: 0

  • Modified: 6

  • Removed: 0

Added Files

No added files

Modified Files

loki/templates/ruler/service-ruler.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/ruler/service-ruler.yaml	2024-11-19 04:39:22.692193446 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/ruler/service-ruler.yaml	2024-11-19 04:39:25.504178750 +0000
***************
*** 4,9 ****
--- 4,10 ----
 kind: Service
 metadata:
 name: loki-test-chart-name-ruler
+ namespace: default
 labels:
 app.kubernetes.io/name: loki
 app.kubernetes.io/instance: loki-test-chart-name
loki/templates/ruler/statefulset-ruler.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/ruler/statefulset-ruler.yaml	2024-11-19 04:39:22.692193446 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/ruler/statefulset-ruler.yaml	2024-11-19 04:39:25.508178733 +0000
***************
*** 4,9 ****
--- 4,10 ----
 kind: StatefulSet
 metadata:
 name: loki-test-chart-name-ruler
+ namespace: default
 labels:
 helm.sh/chart: loki-6.19.0
 app.kubernetes.io/name: loki
loki/templates/index-gateway/poddisruptionbudget-index-gateway.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/index-gateway/poddisruptionbudget-index-gateway.yaml	2024-11-19 04:39:22.688193468 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/index-gateway/poddisruptionbudget-index-gateway.yaml	2024-11-19 04:39:25.504178750 +0000
***************
*** 4,9 ****
--- 4,10 ----
 kind: PodDisruptionBudget
 metadata:
 name: loki-test-chart-name-index-gateway
+ namespace: default
 labels:
 helm.sh/chart: loki-6.19.0
 app.kubernetes.io/name: loki
loki/templates/index-gateway/service-index-gateway-headless.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/index-gateway/service-index-gateway-headless.yaml	2024-11-19 04:39:22.692193446 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/index-gateway/service-index-gateway-headless.yaml	2024-11-19 04:39:25.504178750 +0000
***************
*** 4,9 ****
--- 4,10 ----
 kind: Service
 metadata:
 name: loki-test-chart-name-index-gateway-headless
+ namespace: default
 labels:
 app.kubernetes.io/name: loki
 app.kubernetes.io/instance: loki-test-chart-name
loki/templates/index-gateway/statefulset-index-gateway.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/index-gateway/statefulset-index-gateway.yaml	2024-11-19 04:39:22.692193446 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/index-gateway/statefulset-index-gateway.yaml	2024-11-19 04:39:25.504178750 +0000
***************
*** 4,9 ****
--- 4,10 ----
 kind: StatefulSet
 metadata:
 name: loki-test-chart-name-index-gateway
+ namespace: default
 labels:
 helm.sh/chart: loki-6.19.0
 app.kubernetes.io/name: loki
loki/templates/index-gateway/service-index-gateway.yaml
*** /home/runner/work/loki/loki/output/base/default-single-binary-values/loki/templates/index-gateway/service-index-gateway.yaml	2024-11-19 04:39:22.692193446 +0000
--- /home/runner/work/loki/loki/output/pr/default-single-binary-values/loki/templates/index-gateway/service-index-gateway.yaml	2024-11-19 04:39:25.504178750 +0000
***************
*** 4,9 ****
--- 4,10 ----
 kind: Service
 metadata:
 name: loki-test-chart-name-index-gateway
+ namespace: default
 labels:
 helm.sh/chart: loki-6.19.0
 app.kubernetes.io/name: loki

Removed Files

No removed files

Scenario: default-values (Added: 0, Modified: 0, Removed: 0)

Summary:

  • Added: 0

  • Modified: 0

  • Removed: 0

Added Files

No added files

Modified Files

No modified files

Removed Files

No removed files

Scenario: ingress-values (Added: 0, Modified: 0, Removed: 0)

Summary:

  • Added: 0

  • Modified: 0

  • Removed: 0

Added Files

No added files

Modified Files

No modified files

Removed Files

No removed files

Scenario: legacy-monitoring-values (Added: 0, Modified: 0, Removed: 0)

Summary:

  • Added: 0

  • Modified: 0

  • Removed: 0

Added Files

No added files

Modified Files

No modified files

Removed Files

No removed files

Scenario: simple-scalable-aws-kube-irsa-values (Added: 0, Modified: 0, Removed: 0)

Summary:

  • Added: 0

  • Modified: 0

  • Removed: 0

Added Files

No added files

Modified Files

No modified files

Removed Files

No removed files

@site0801
Copy link
Contributor Author

I found the cause of the failure in .github/workflows/helm-ci.yml.
It seems to be failing because it is probably unable to reference the commit sha in my site0801/loki.
So, I changed it to reference ${{ github.event.pull_request.head.sha }} in #15011.

@site0801
Copy link
Contributor Author

I would like to run lint again because @trevorwhitney fixed it at #15001.
The above PR is no longer needed, so it has been closed.

@trevorwhitney trevorwhitney merged commit 733d99f into grafana:main Nov 20, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants