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

Options to only create main part of internet.nl Batch API (Django) #1588

Open
signorrayan opened this issue Dec 9, 2024 · 1 comment · May be fixed by #1589
Open

Options to only create main part of internet.nl Batch API (Django) #1588

signorrayan opened this issue Dec 9, 2024 · 1 comment · May be fixed by #1589
Assignees
Milestone

Comments

@signorrayan
Copy link

I saw the deployment part of the documentation, and I also created containers based on that, but I want to know is there any options to run the main parts (Batch API for example) without Grafana and extra containers/services? There are many containers are running after deploying it.

@bwbroersma
Copy link
Collaborator

bwbroersma commented Dec 9, 2024

Fair point, monitoring (all exporters, prometheus and grafana) should be in a monitoring profile so it can be easily disabled in favor of a lightweight API instance.

This will have some impact for:

  • the nginx config (although it's linked on a static IP address)
    # monitoring, requires authentication, override headers, since CSP is too strict
    location /grafana {
    include http.headers;
    include hsts.header;
    auth_basic "Please enter your monitoring username and password";
    auth_basic_user_file /etc/nginx/htpasswd/monitoring.htpasswd;
    proxy_pass http://${IPV4_IP_GRAFANA_INTERNAL}:3000;
    }
    location /prometheus {
    include http.headers;
    include hsts.header;
    auth_basic "Please enter your monitoring username and password";
    auth_basic_user_file /etc/nginx/htpasswd/monitoring.htpasswd;
    proxy_pass http://${IPV4_IP_PROMETHEUS_INTERNAL}:9090;
    }
    location /alertmanager {
    include http.headers;
    include hsts.header;
    auth_basic "Please enter your monitoring username and password";
    auth_basic_user_file /etc/nginx/htpasswd/monitoring.htpasswd;
    proxy_pass http://${IPV4_IP_ALERTMANAGER_INTERNAL}:9093;
    }

    Note that the presence of the authentication is tested:
    • @pytest.mark.parametrize(
      "path",
      ["/grafana", "/prometheus", "/prometheus/targets"],
      )
      def test_monitoring_auth(page, app_url, path):
      """Monitoring endpoints must be behind basic auth."""
      response = requests.get(app_url + path, verify=False)
      assert response.status_code == 401
      # MONITORING_AUTH provided in docker/test.env
      auth = ("test", "test")
      response = requests.get(app_url + path, auth=auth, verify=False)
      response.raise_for_status()
      def test_monitoring_auth_raw(page, app_url):
      """Monitoring endpoints must be behind basic auth."""
      path = "/grafana"
      response = requests.get(app_url + path, verify=False)
      assert response.status_code == 401
      # MONITORING_AUTH_RAW provided in docker/test.env
      auth = ("test_raw", "test_raw")
    • nginx >> Edge(minlen="2", label="/grafana,/prometheus", lhead="cluster_Monitoring") >> monitoring

The quick fix is just adding:

    profiles:
      - monitoring

to all monitoring services, and adding monitoring to:

COMPOSE_PROFILES=connectiontest,cron,routinator

@bwbroersma bwbroersma added this to the backlog milestone Dec 9, 2024
@bwbroersma bwbroersma added the documentation documentation label Dec 9, 2024
bwbroersma added a commit to bwbroersma/Internet.nl that referenced this issue Dec 9, 2024
@bwbroersma bwbroersma assigned bwbroersma and unassigned aequitas Dec 9, 2024
@bwbroersma bwbroersma linked a pull request Dec 9, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants