-
Notifications
You must be signed in to change notification settings - Fork 48
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
Redesign classes to allow split deployments #308
Conversation
I'm trying to follow the over arching design goals of this change and I am having trouble. I think what I need to understand more is the larger goal that we're driving towards. I have for a while thought the end goals would be something akin to:
|
95171ad
to
98a3e1a
Compare
Rebased so it's easier to see. Also submitted #309 as something that can be merged beforehand. This is not final yet because I think I can rewrite init.pp to keep backwards compatible while already delivering the new split classes. That should allow experimentation with split deployments while still doing a monolithic deployment in the installer. |
This is done now. I've still added the monolithic change on top of it, but viewing the change should be easy now. It does drop some parameters, but I'd argue they didn't make sense for most users anyway. |
I think this is now ready for review. It is backwards incompatible because it drops 6 parameters from
I believe these shouldn't be configurable anyway so there's no loss of functionality here for most users. @ehelms please have a look. Ideally we'd merge this soon so it has some time to stablize. It should also |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekohl thanks for the rework of the module.
We are currently reworking our internal module to use split deployment for pulp, qpid, candlepin, etc. For that we are using the code from this PR and will test it in our release environment.
In general I like the changes but stumbled across some small things as seen by the comments. If these changes are included, I will run the code against our env and report back.
@dgoetz FYI
manifests/params.pp
Outdated
Stdlib::Httpsurl $candlepin_url = "https://${facts['fqdn']}:8443/candlepin", | ||
Stdlib::Httpsurl $pulp_url = "https://${facts['fqdn']}/pulp/api/v2/", | ||
Stdlib::Httpsurl $crane_url = "https://${facts['fqdn']}:5000", | ||
String $qpid_url = "amqp:ssl:${katello::globals::qpid_hostname}:5671", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be necessary to expose qpid_hostname
as well. This is needed if Candlepin and QPID are running on different machines. At the moment katello::candlepin
and katello::qpid
use the default from globals which is localhost
.
Given the qpid_url
is only used in one template we could remove this variable completely and construct the URL in application.pp
.
Another way would be to use the qpid_url
in the candlepin.pp / qpid.pp directly but this would require rework of the ::candlepin
class and the URL seems to be in a different format.
I think the first way would be much easier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was also considering this. Given it was a parameter in init.pp
before, it makes sense to keep it. Will have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've pushed a separate commit to make review easier but should be squashed on merge. Please have a look.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good to me.
# The Apache options to use on the `/pub` resource | ||
# | ||
# @param repo_export_dir | ||
# Create a repository export directory for Katello to use | ||
class katello::pulp ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would appreciate if we could add the following parameters to support split deployments (as mentioned in #304):
manage_httpd
(boolean)https_cert
https_key
ca_cert
These values can default to undef
/ false
but should be passed to pulp
class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My goal would for this PR is to just refactor without adding new params. Hopefully merge it quickly and then iterate on this in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. If I can support you on getting the PR ready for merge just let me know.
manifests/init.pp
Outdated
@@ -40,6 +40,10 @@ | |||
# | |||
# $qpid_wcache_page_size:: The size (in KB) of the pages in the write page cache | |||
# | |||
# $qpid_interface:: The interface qpidd listens to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: listens on
@ekohl now we have some good news for you! We have successfully upgraded our test environment as far as we can get it using the code in this PR. Next week I will configure a client to talk to the upgraded environment and test some things. In my perspective this PR is ready. |
|
||
class { 'katello::params': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Never seen calling params and configuring it as a design convention.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's unconventional and I might clean this up a bit more later as I gain more experience with splitting up into cleaner roles and profiles.
What if any effect will this have on the installer currently? Just dropping a few parameters? |
It should only drop a few parameters. Any other change would be considered a regression. |
Will need a rebase, after that I think I am good with this change. |
@ekohl I have one more thing regarding the Pulp configuration: The only reason for including this class is to be able to access What are your thoughts? |
That's the hard part about our vhost handling. I'd say we need some handling that's roughly: if $manage_vhost {
include foreman
$servername = $foreman::servername
foreman::config::apache::fragment { 'pulp':
# ...
}
} else {
$servername = undef
}
class { 'pulp':
servername => $servername,
manage_httpd => manage_vhost,
# ...
} |
Every class that provides an aspect of the deployment is now standalone. This means: * candlepin * pulp * qpid * application They can just be included and work by themselves. All class parameters are tunables that users will commonly modify. There's also shared parameters which are common among the standalone classes. These are meant to be changed via katello::params. Either via Hiera or by including them in a profile class before the instance classes themselves. The katello::globals class has globals that a user via the installer might want to change. The katello::params class is not intended to be exposed via the installer. The main katello class remains as a compatibility class. In the future this should probably be converted into a role but perhaps it is no needed at all.
Rebased to resolve the conflict. I've also moved |
Thanks for the reviews. Merged now and I'm looking forward to iterating on this. |
Thanks @ekohl ! |
Every class that provides an aspect of the deployment is now standalone. This means:
They can just be included and work by themselves. All class parameters are tunables that users will commonly modify.
There's also shared parameters which are common among the standalone classes. These are meant to be changed via katello::params. Either via Hiera or by including them in a profile class before the instance classes themselves.
The katello::globals class has globals that a user via the installer might want to change. The katello::params class is not intended to be exposed via the installer.
Currently a draft because I want to do testing with rewriting the changes in the installer. Having this in a PR makes that easier.
Includes: