Project

General

Profile

InterServerSync » History » Version 34

Chris Duryee, 11/23/2015 05:46 PM

1 1 Chris Duryee
h1. InterServerSync
2
3 2 Chris Duryee
h3. What is ISS?
4
5
Inter-Server Sync is a feature designed to help users in two scenarios:
6
7
 * users who have a connected Foreman/Katello instance and disconnected Foreman/Katello, who want to propogate data from the connected side of their network to the disconnected side.
8
 * users who have a "main" Foreman/Katello and want to propogate some data (but not all data) to other instances. One example is for users who have "blessed" content views that are validated by the IT department, and want to propogate those down elsewhere.
9
10 30 Chris Duryee
More info on the original ISS is available at https://fedorahosted.org/spacewalk/wiki/InterSpacewalkServerSync.
11 5 Chris Duryee
12 1 Chris Duryee
h3. Goals
13
14 30 Chris Duryee
For Katello 2.5 we want to be able to export a group of repos in a given CV or Environment in tgz, chunked iso, or as a set of directories, and import said export to another Katello/Foreman instance.
15 1 Chris Duryee
16 30 Chris Duryee
Later iterations will allow for additional types of data besides yum repos or disk usage enhancements.
17 1 Chris Duryee
18 30 Chris Duryee
h4. Katello 2.5
19 1 Chris Duryee
20 30 Chris Duryee
This goal replaces the katello-disconnected script, and solves the same problem that Spacewalk solves with Inter-Spacewalk Sync in a minimal fashion. Users will be able to export yum repos associated with an environment or CV to disk and import them on another server. We will optionally recreate any custom products during the import, but RH products will not be re-created since they must be created via manifest.
21 28 Chris Duryee
22 30 Chris Duryee
We will support date-based incremental exports as well, via a ISO6601 "since" field on the export call.
23 16 Chris Duryee
24 30 Chris Duryee
h3. Katello 2.5 design and stories
25 1 Chris Duryee
26 3 Chris Duryee
Development steps
27
# Step 1 - export
28 26 Thomas McKay
> # As a user, I would like an API to export specific repositories.
29 27 Thomas McKay
> > * "Feature #12446":http://projects.theforeman.org/issues/12446 : Add ability to export yum repositories (both custom and RH) to disk
30
> > * Specify lifecycle environment and content view.
31 28 Chris Duryee
> # As a user, I would like an API to export specific products.
32 27 Thomas McKay
> # As an admin, I would like a role to limit which users may export.
33
> > * Based on product read, repository read, export true?
34
> # "Feature #12446" As an admin, I would like a setting to specify where exported files are stored on the server.
35 1 Chris Duryee
> > * How are the files organized (per org, per user, per cv, per env)?
36 32 Thomas McKay
> > * How are files cleaned up since they take significant space?
37 27 Thomas McKay
> # As a user, I want to choose export format of iso, tgz, or dir
38
# Step 2 - import
39 29 Chris Duryee
> # "Feature #12459": http://projects.theforeman.org/issues/12459 : As a user, I want to temporarily set where to sync a repository from.
40 27 Thomas McKay
> # As a user, I want to permanently set where to sync a repository from.
41
> # As a user, I want to temporarily/permanently set sync location for a product.
42
> # As a katello, I want to prevent import of Red Hat products into custom products.
43
> > * If the Red Hat product already exists, it may sync from the location. A custom product may not sync Red Hat content.
44
# Step 3 - repository enable
45 1 Chris Duryee
> # As a user, I want to change the CDN to point to an export location.
46 27 Thomas McKay
> # As a katello, I want the repository choices shown on the Red Hat Repositories page to be limited to what is in the export.
47
> > * Only the Red Hat repos that were exported should be displayed as available for enable.
48
> > * If a product was enabled previously, it should be shown as already enabled.
49 26 Thomas McKay
50
51 30 Chris Duryee
h4. Katello 2.5 hammer design
52 1 Chris Duryee
53 30 Chris Duryee
this section is getting reworked:)
54 1 Chris Duryee
55 15 Chris Duryee
<pre>
56
57 28 Chris Duryee
# export a repository to disk on the Katello server (need to do this for each repo but can be a repo in a CV)
58 15 Chris Duryee
hammer repository export --id <id>
59 11 Chris Duryee
60 15 Chris Duryee
# export products to CSV
61 21 Chris Duryee
hammer csv products --csv-export --csv-file products.csv 
62
63 15 Chris Duryee
# replace URL with on-disk location for place to sync from on destination katello
64 11 Chris Duryee
sed -i 's#https://repos.fedorapeople.org/#file:///mnt/imports/#g' /tmp/foo.csv
65 1 Chris Duryee
66
# import steps
67
68
# ensure export is available, then run
69
hammer csv products --csv-import --csv-file products.csv 
70
71
# kick off syncs for imported products
72
hammer repository synchronize --id <id>
73
</pre>
74 31 Chris Duryee
75
76 33 Chris Duryee
h4. Katello to Katello syncing
77
78
This is useful for when you have a Katello instance that cannot connect to the Internet, but it can connect to another Katello with Internet access.
79
80 34 Chris Duryee
For this scenario, the players will be Katello A which has Internet access, and Katello B which only has access to A. We will want Katello B to honor Katello A's SSL server certificate, and we want Katello A to honor Katello B's entitlement client certificate, even though Katello B got it from a manifest from access.redhat.com.
81 33 Chris Duryee
82
At a high level, we need to make the following changes:
83
84 34 Chris Duryee
 * Katello A needs to include the Red Hat Entitlement CA when determining if a client cert is valid
85
 * Katello B needs to include Katello A's server CA when determining if the server is legitimate
86
 * Users will need to update the CDN location on Katello B to be Katello A instead of https://cdn.redhat.com.
87 33 Chris Duryee
88
The first change requires a few user stories:
89
90
 * as a Katello packager, I would like a copy of the Red Hat Entitlement CA installed.
91
92
 * as a Katello admin, I would like to optionally enable the Red Hat Entitlement CA as a valid CA when performing client certificate validation. This should not be enabled by default but should be set/updated via katello-installer. The easiest way to do this is to append both redhat-uep.pem and the RH Entitlement CA into "/etc/pki/katello/certs/katello-default-ca.crt". There may be a more elegant option though. Note that this is done via httpd settings and cannot be enabled on a per-org basis.
93
94
 * as a Katello administrator, I would like all instances of "SSLVerifyDepth" in my httpd configs to be at least 3.
95
96 34 Chris Duryee
 * As an org admin, I would like to allow an environment to be used as an ersatz CDN. In Pulp 2.7, this can be done by adding the org/env portion of the path on Katello B's CDN url, and then adding this same string into repo_auth.conf on Katello A. This lets Katello A "chop off" the org/env portion of the path before checking the entitlement certificate. Note that Pulp 2.6 does not have this functionality. There is a way around it but it's per-katello and not per-org.
97 33 Chris Duryee
98
99
The second change requires one additional story:
100
101
 * as a user, I would like to select a CA certficate to use when validating the upstream content source. Right now this is hardcoded to redhat-uep.pem. This change may need to be made in the Katello code that reads listing files as well as the Pulp repo setup code.
102
103
Finally, https://bugzilla.redhat.com/show_bug.cgi?id=1284683 will need to be addressed before this will work (aside from simple curl tests).
104
105
106 31 Chris Duryee
h4. Katello 2.6+
107
108
These features require additional thought, or possibly upstream RFEs for Pulp.
109
110
 * Push repo contents from one Katello/Foreman to another (if X can initiate connections to Y but not vice versa).
111
 * Allow exporting to local disk where hammer is being run
112
 * Allow exports/imports to occur without writing entire export to disk
113
 * Support for additional types of data (docker, ostree, puppet)
114
 * Support for additional types of metadata (users, etc?)