Project

Profile

Help

Task #6057

closed

[EPIC] Introduce custom plugin snippets for custom apache and nginx routes

Added by bmbouter about 4 years ago. Updated over 3 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
Normal
Assignee:
Category:
Installer - Moved to GitHub issues
Sprint/Milestone:
Start date:
Due date:
% Done:

100%

Estimated time:
(Total: 0:00 h)
Platform Release:
Groomed:
Yes
Sprint Candidate:
Yes
Tags:
Sprint:
Sprint 67
Quarter:

Description

Plugins like pulp_container and pulp_ansible need custom API routes. Sometimes these are for the pulp-content-app or in other cases the pulp-api.

Background

Currently Nginx that matches /pulp/api/v3 and routes that to the pulp-api. It also matches /pulp/content/ and routes that to the pulp-content-app. If neither match it first "tries one" and if that 404's it "tries the other". This is problematic for a few reasons:

  • Apache doesn't support it. At the moment, Apache users are not receiving at all the same experience as Nginx
  • It's not working well even for nginx. In pulp_ansible recently I had to add this snippet to my dev checkout or tests wouldn't pass. It was trying one service but then not the other.
        location /pulp_ansible/galaxy/ {
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $http_host;
            # we don't want nginx trying to do something clever with
            # redirects, we set the Host: header above already.
            proxy_redirect off;
            proxy_pass http://127.0.0.1:24817;
        }

Solution

Have each plugin ship a snippet that allows them to define custom routes for both nginx and apache. Then have the installer configure these snippets when configuring nginx or apache (as it already does).

We want to keep the snippets delivered through plugin code because it needs to be versioned with the plugin code. We can use these python mechansisms to ship the configs and make them discoverable by the installer:

https://importlib-resources.readthedocs.io/en/latest/using.html

https://docs.python.org/3/library/importlib.metadata.html


Sub-issues 4 (0 open4 closed)

Ansible Plugin - Task #6188: Add nginx and apache fragmentCLOSED - CURRENTRELEASEbmbouter

Actions
Story #6206: As an installer user, the webserver configs I have will chain-load snippetsCLOSED - CURRENTRELEASEbmbouter

Actions
Task #6209: Add plugin writer docs on how to ship webserver config snippetsCLOSED - CURRENTRELEASEbmbouter

Actions
Story #6213: As an installer user, plugin snippets will by symlinkedCLOSED - CURRENTRELEASEmdepaulo@redhat.com

Actions

Related issues

Related to Pulp - Story #5657: pulp-operator should deploy nginx as the Pulp WebserverMODIFIED

Actions

Also available in: Atom PDF