Commit graph

217 commits

Author SHA1 Message Date
Kevin Fenzi
531eee95d3 proxies / reverseproxy: try and fix template to be correct.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-12-03 20:39:13 -08:00
Kevin Fenzi
3c5ae163f9 proxy: simplify reverseproxy template
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-12-03 20:29:36 -08:00
Kevin Fenzi
b1b0923af0 openshift 3.11: raise a glass!
Our openshift 3.11 cluster(s) served us long and well.

Now we have everything finally moved to the openshift 4 clusters (fas2
was the last holdout). We can finally retire this. :)

🎉🥂

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-11-28 13:08:01 -08:00
Kevin Fenzi
91ccdea73f proxies: Reach ocp4 cluster in prod over vpn instead of sending 421
I think I handled all the special cases here already.
We want to switch non iad2 proxies to reach the oco4 cluster over it's
vpn now that it has one. This should allow us to still keep ipv6
available for applications and not have to change dns for moving from
ocp3 cluster anymore. Will roll this out slowly to one proxy then
another, then the rest if it all looks ok.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-13 10:08:48 -07:00
Kevin Fenzi
80ef5e47df proxies / reverseproxypass: try and only 421 ocp4 non iad2 proxies
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-05 13:44:02 -07:00
Kevin Fenzi
42bc4ea41a proxies / reverseproxy: try just always setting balancer_members and dropping the set facts
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-05 11:47:17 -07:00
Kevin Fenzi
7e90378b30 proxies / reverseproxy: Try and clean up logic and whitespace.
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-05 11:24:24 -07:00
Kevin Fenzi
0e1d9f6ea7 proxies / reverseproxy: try some different logic
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-05 09:30:58 -07:00
Kevin Fenzi
dc6b7697c1 proxies / reverseproxy: unset balancer_members after each template so it can get set right for the next one
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-04 21:05:37 -07:00
Kevin Fenzi
e2deffab4e proxies / reverseproxy: consolidate non openshift-iad2 case
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-04 14:51:33 -07:00
Kevin Fenzi
03fe998142 proxies / reverseproxy: also special case the old resultsdbapi
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-04 14:25:32 -07:00
Kevin Fenzi
77bdc05883 proxies / reverseproxy: work around taskotron with its own config
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-04 14:04:07 -07:00
Kevin Fenzi
6d99b43608 proxies / reverspassproxy: fix loop
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-03 20:51:46 -07:00
Kevin Fenzi
6a0727c9e6 proxies / openqa: rework conf file to avoid issue with openqa and its websockets
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-03 20:15:36 -07:00
Kevin Fenzi
7455b3fdb1 proxies / reverseproxy: fix missing )
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-03 14:22:13 -07:00
Kevin Fenzi
52a8936914 proxies: rework reversepassproxy and mark all ocp4 / ocp3 apps
The ocp3 cluster is reachable/available via the vpn, so any proxy can
reach it.

The ocp4 cluster is (at least for now) only reachable/available from the
iad2 proxies (proxy01/proxy10).

There's a firefox bug that causes it to reuse h2 connections, and in
some cases try and request something of a non iad2 proxy that it can't
reach. To work around this in those cases we need to send a 421 back to
the client so it doesn't do that.

This moves that logic into the template so all ocp4: true hosts do this
by default. Also, we default the balancer nodes so we only have to
change them in one place if we remove/add a compute node.

Finally, we mark all the ocp3 apps with 'ocp4: false' so we know what
they are and can move them more easily.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-06-03 13:14:28 -07:00
Kevin Fenzi
0302040f3c proxies / reverseproxy / blockerbugs: have proxies return 421 for non iad2 access.
This is the fun firefox h2 connection reuse bug. blockerbugs is only in
iad2, so if firefox tries to reuse a connection to another proxy for it,
just send it a 421 so it knows thats bad on it.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-05-25 17:29:37 -07:00
Kevin Fenzi
6d1e07d599 proxies / reverseproxy / openqa: do this in a more sustainable way
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-05-11 15:45:14 -07:00
Kevin Fenzi
8d38f818e7 proxies / reverseproxy / openqa: drop unneeded conditional that is causing a syntax error
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-05-11 15:31:26 -07:00
Kevin Fenzi
63adb316a7 proxies / reverseproxy / openqa: make openqa on non iad2 proxies send a 421
Due to http/2 connection reuse bugs, sometimes firefox will decide to
'reuse' a connection to fedoraproject.org for openqa.fedoraproject.org
(since they both have the same tls cert), but openqa is only available
from the 2 iad2 proxies, not all of them. This results in a 503 timeout
and it just not loading. This should make those reused connections get a
421 from proxies and reconnect to the proper ips. (we hope)

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2022-05-11 13:10:43 -07:00
Jakub Kadlcik
cc920ed019 httpd: redirect copr /api/ URLs to fedorainfracloud.org
See https://pagure.io/copr/copr/issue/1935

Prevent only /api_2, /api_3, etc from redirectring from
fedoraproject.org to fedorainfracloud.org

I am not entirely sure why do we need these special-cases for API but
you guys are taking care of it and keeping it updated, so it must be
important. If anyone can explain some context, it would be
appreciated. The config is older than my involvement in the Copr
project :-)

Anyway, there is only one /api/ page - https://copr.fedorainfracloud.org/api
and that is not an API endpoint that is programmatically accessed and
that preserves backwards compatibility. It is a page that one opens
in the web browser to find information about API, such as where the
documentation is, and how to obtain an API token.

We would like to apply the redirect from fedoraproject.org to
fedorainfracloud.org even for this page.
2022-01-25 21:43:54 +00:00
Kevin Fenzi
ddfac2e066 proxies: work around reg path issue
reg is putting a /static/ into asset path since it's upgrade.
Just alias it to / here to avoid the problem for now.
Hopefully we are going to be moving to quay.io and can stop caring about
it.

Fixes infra 10673

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-12-02 15:42:37 -08:00
Frank Ch. Eigler
d835aba567 debuginfod proxies: preserve & pass %2F etc.
Apache httpd by default blocks URL-encoded / (%2F) characters in the
URL path, even though these are RFC-compliant.  Enable them and permit
their safe passage to the debuginfod servers.

See also https://stackoverflow.com/a/9933890/661150

Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
2021-08-23 11:39:36 +00:00
David Kirwan
55185861c8 metrics-for-apps:
- Updating apache proxy config to handle ocp4 CA cert
- place ocp4 CA cert on proxies
- add ocp4 stg ca cert to haproxy/files

Signed-off-by: David Kirwan <dkirwan@redhat.com>
2021-08-13 20:02:38 +00:00
Frank Ch. Eigler
7185d7774e debuginfod redirect+proxy: combine into handcrafted httpd conf file 2021-05-20 00:42:32 +00:00
Kevin Fenzi
e4a36758f5 debuginfod: add in another slash to make apache happy
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-11 09:19:26 -07:00
Kevin Fenzi
c66dedd18a debuginfod: add in a slash to make apache happy
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-05-11 09:03:54 -07:00
Frank Ch. Eigler
42c7db164c debuginfod: tweak comment for redirect sample target 2021-05-11 10:25:52 -04:00
Frank Ch. Eigler
a0a484245d debuginfod template: add quick testing remarks 2021-05-11 09:15:22 -04:00
Frank Ch. Eigler
ab51e82014 debuginfod: balance redirect & reverse-proxy better
Our ansible default ansible scripts don't like multiple /suburls being
individually proxied, so we ended up losing /buildid/* and keeping
/metrics.

Switch to using single /-level reverse-proxying AND wiki-redirection
clauses, and use a new template .conf file to break the tie with a
"ProxyPass / !"  directive.
2021-05-11 09:10:34 -04:00
Frank Ch. Eigler
77d79cfe8a debuginfod proxy: fix ProxyPassReverse typo (no proxyopts there) 2021-04-08 21:53:30 +00:00
Frank Ch. Eigler
c37d51d236 proxies/debuginfod: allow proxyopts
debuginfod can take O(60s) to run certain webapi queries, so the httpd
mod_proxy default timeouts are too short.  Introduce an ansible
variable "proxyopts", expanded into the httpd ProxyPass and
ProxyPassReverse configuration lines.  Default to "", but set it
with pretty generous limits for debuginfod only.
2021-04-08 20:58:52 +00:00
Owen W. Taylor
75e81cbccd Move fedora-indexer to production and remove regindexer
* Update rsync configuration for production to sync the flatpak-indexer
  output directories into the right place, in the same way as was done
  for staging. The regindexer rsync module is renamed to flatpak-index
  for clarity.
* Update the registry.fedoraproject.org to use the flatpak-indexer
  rules for production.
* Remove the regindexer role

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
2021-03-26 20:39:43 +00:00
Owen W. Taylor
239525d161 reversepassproxy.registry-generic.conf: sync staging Flatpak index names
In the regindexer => flatpak-indexer move, the index names for the 'latest'
tag were renamed from flatpak.json to flatpak-latest.json (and so forth.)
2021-03-11 07:57:11 -05:00
Owen W. Taylor
32a3c0c43f reversepassproxy.registry-generic.conf: Set up for flatpak-indexer for staging
Add changes required for flatpak-indexer, conditionalized for staging:

 * Reverse which of "index with labels" or "index with annotations" is the
   default (make labels the default, since annotations are only used by
   old versions of Flatpak)
 * Add the deltas/ directory which holds deltas between Flatpak versions.

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
2021-03-09 21:02:28 +00:00
Owen W. Taylor
67224d3b02 Add back regindexer and revert httpd config until flatpak-indexer is ready
While we're getting flatpak-indexer tested and working in staging, we still
need regindexer, and we don't want the httpd config changes that are
part of the regindexer => flatpak-indexer change.

Fixes: https://pagure.io/fedora-infrastructure/issue/9631
Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
2021-02-06 14:21:27 -05:00
Owen W. Taylor
69e318a10a Add a flatpak-indexer openshift service
flatpak-indexer replaces regindexer for creating an index of Fedora
Flatpaks. It adds an additional capability - creating "diffs" between image versions
allowing for incremental updates.

Add a new openshift namespace: flatpak-indexer, with three deploymentconfigs
in it:

 - flatpak-indexer: generates the index
 - flatpak-indexer-differ: worker(s) to run the expensive tardiff operation
 - redis: used for cache and communication between indexer and differ

The staging version of the indexer targets the *production* bodhi/koji/registry,
since we don't have useful Flatpak content in staging. This could be changed.

The registry reverse proxy configuration is updated to a slightly different
set of generated indexes (the 'annotations' indexes for F31 and older are
now suffixed with -annotations, and the 'labels' indexes unsuffixed.)

Signed-off-by: Owen W. Taylor <otaylor@fishsoup.net>
2021-02-05 21:19:30 +00:00
Kevin Fenzi
765e526a83 proxies / mirrormanager / download redirect: fix https/http mixing
Fixes https://pagure.io/fedora-infrastructure/issue/9564

download.fedoraproject.org queries mirrormanager for a redirect to a
mirror for the path/request. Before we were just taking any mirror that
mirrormanager had, if it was http or https. This caused requests that
were sent in as https to get a http mirror and error out. So, now we
just redirect http ones to http mirrors and https requests to https
mirrors.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2021-01-06 15:51:08 -08:00
Kevin Fenzi
0a44cc4628 proxies / candidate registry: use Rewrite instead of Redirect
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-10-02 14:42:19 -07:00
Kevin Fenzi
40ecb25e75 proxies / reverseproxy / candidate-registery: redirect top level to catalog
See: https://pagure.io/fedora-infrastructure/issue/8507
Currently https://candidate-registry.fedoraproject.org/ just gives you a
blank page. So instead lets redirect to the catalog to at least show
something to people.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-10-02 13:42:36 -07:00
Kevin Fenzi
d6cf496c56 proxies / registry: Adjust rewrite for flatpak builders
Looks like matching the host wasn't working due to the proxying, but we
can match on the builder subnet.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-08-24 09:10:34 -07:00
Kevin Fenzi
c263fa74c5 proxies / registry: document redirect to cdn and add build* for flatpak
This rewrite section is confusing, so document it more and add a rule to
make builders go direct to the regesty instead of using the cdn, this
should hopefully fix flatpak building.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-08-24 07:58:31 -07:00
Kevin Fenzi
e03a7c35bd registry: try fixing osbs rule and try bypassing varnish
I think the lack of ! on the osbs rule meant that nothing ever went to
the cdn. This increases load on the real registry a lot.

Also, we are using varnish here, but lets try and just go via haproxy.
varnish might be having problems keeping all the 404s in memory/cache.
The cdn thing should help that, but since we have cloudfront I don't
think we also need to use varnish here.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-08-07 15:40:30 -07:00
Clement Verna
5c5ee0776e osbs: OSBS does not use the cdn to pull images
Signed-off-by: Clement Verna <cverna@tutanota.com>
2020-07-15 20:37:39 +02:00
Clement Verna
3e742b9734 osbs: fix the authentication of the candidate-registry
Signed-off-by: Clement Verna <cverna@tutanota.com>
2020-06-25 15:06:10 +02:00
Kevin Fenzi
7984b46eb7 The great phx2 pruning run (1st cut).
Since we no longer have any machines in phx2, I have tried to remove
them from ansible. Note that there are still some places where we need
to remove them still: nagios, dhcp, named were not touched, and in cases
where it wasn't pretty clear what a conditional was doing I left it to
be cleaned up later.

Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-14 14:14:31 -07:00
Kevin Fenzi
b873aa0e47 oci-registry: also allow cloudfront to access the registry directly
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-06-03 14:24:47 -07:00
Kevin Fenzi
51a68ea0ae iad2: simplify proxy logic for multiple datacenters and make it one that works
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-05-28 10:12:58 -07:00
Kevin Fenzi
7f6cdda0b2 iad2: adjust more proxy things for iad2: kojipkgs, nagios and certbot for pkgs
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-05-27 21:13:55 -07:00
Kevin Fenzi
8b89317429 iad2: tweak proxy config to try and get koji working via /etc/hosts
Signed-off-by: Kevin Fenzi <kevin@scrye.com>
2020-05-26 15:50:54 -07:00