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

Add environment variables configuring setting dashboard namespaces #579

Merged
merged 2 commits into from
Oct 27, 2021

Conversation

fpetkovski
Copy link
Contributor

@fpetkovski fpetkovski commented Oct 22, 2021

Description

Currently it's only possible to configure dashboard namespaces through
command line args. This makes it difficult to fine-tune the operator
when installing it declaratively through an OLM subscription.

This commit adds the DASHBOARD_NAMESPACES and DASHBOARD_NAMESPACES_ALL
environment variables which serve as fallback for the namespaces and
scan-all flags.

Relevant issues/tickets

Fixes #363

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • This change requires a documentation update
  • I have added tests that prove my fix is effective or that my feature works
  • I have added a test case that will be used to verify my changes
  • Verified independently on a cluster by reviewer

Verification steps

Run the operator with the following commands to verify the functionality:

  • POD_NAME="grafana-operator" WATCH_NAMESPACE="default" go run main.go uses current namespace for dashboards
  • POD_NAME="grafana-operator" WATCH_NAMESPACE="default" DASHBOARD_NAMESPACES_ALL="true" go run main.go: uses all namespaces for dashboards
  • POD_NAME="grafana-operator" WATCH_NAMESPACE="default" DASHBOARD_NAMESPACES="kube-system" go run main.go: uses kube-system namespace for dashboards
  • POD_NAME="grafana-operator" WATCH_NAMESPACE="default" DASHBOARD_NAMESPACES="kube-system" go run main.go --namespaces default: uses default namespace for dasbhoards

Currently it's only possible to configure dashboard namespaces through
command line args. This makes it difficult to fine-tune the operator
when installing it declaratively through an OLM subscription.

This commit adds the DASHBOARD_NAMESPACES and DASHBOARD_NAMESPACES_ALL
environment variables which serve as fallback for the namespaces and
scan-all flags.
@pb82
Copy link
Collaborator

pb82 commented Oct 25, 2021

@fpetkovski thank's for the contribution. I think this makes sense.

Copy link
Collaborator

@hubeadmin hubeadmin left a comment

Choose a reason for hiding this comment

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

Great, Thanks @fpetkovski, nice addition, verified and tested locally on minikube, works as intended 👍

@hubeadmin hubeadmin merged commit 0382738 into grafana:master Oct 27, 2021
fpetkovski added a commit to fpetkovski/monitoring-stack-operator that referenced this pull request Dec 13, 2021
This commit upgrades the Grafana Operator to 4.1.0 and configures the
operator to scan dashboards from all namespace. This change was
introduced in 4.0.2 [1].

grafana/grafana-operator#579
fpetkovski added a commit to fpetkovski/monitoring-stack-operator that referenced this pull request Dec 13, 2021
This commit upgrades the Grafana Operator to 4.1.0 and configures the
operator to scan dashboards from all namespace. This change was
introduced in 4.0.2 [1].

grafana/grafana-operator#579
fpetkovski added a commit to rhobs/observability-operator that referenced this pull request Dec 14, 2021
This commit upgrades the Grafana Operator to 4.1.0 and configures the
operator to scan dashboards from all namespace. This change was
introduced in 4.0.2 [1].

grafana/grafana-operator#579
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grafana-operator multi-namespace support from OLM via ENV VAR instead of container args
3 participants