Container Gateway support - #611
Conversation
|
You can rebase this now that |
f17d982 to
fe6f89e
Compare
|
Linking up theforeman/foreman-oci-images#53 |
|
Katello doesn't support the container gateway correctly yet. In its code, it expects the Pulp smart proxy to have the container gateway feature, but instead, the container gateway feature is on the non-Pulp smart proxy (since there are two per smart proxy host). |
|
From my last comment - if this merges, containerized Katello + Container Gateway won't be any more broken than it is today, since Katello simply won't find the container gateway capsule and will skip the sync. |
fe6f89e to
96d5351
Compare
| description: iop services | ||
| dependencies: | ||
| - rh-cloud | ||
| container-gateway: |
There was a problem hiding this comment.
These feels like it should be part of the "content/container" feature or a dependency of it... but only in the proxy use case.
There was a problem hiding this comment.
Sure, that makes sense to me.
There was a problem hiding this comment.
Actually, I gave this some thought. What is the "proxy" use case we're talking about here? It's foreman-proxy-content specifically. That is the only time we want to install the container gateway. I thought about having a dependency relationship with a conditional on the use of foreman-proxy-content, but that seems like a roundabout way to achieve the same result as just having the container gateway be a part of the foreman-proxy-content flavor.
There was a problem hiding this comment.
So, while there isn't a direct relationship between the container gateway and content/container, there is a connection between them created by the foreman-proxy-content flavor.
There was a problem hiding this comment.
If there is no Pulp or there is no Pulp with container content present, does this feature work? What happens if a container-gateway is deployed without Pulp or Pulp with container content on the same server?
We can go this route for now, if we need to, to allow the feature to work, but I would ask that we track doing the dependency relationship properly across foremanctl and Katello.
There was a problem hiding this comment.
The container gateway does require Pulp, so from the standpoint of looking into deploying a smart proxy manually via features it would make sense for there to be some dependency there. I'm trying to weigh the complexity for the short term of using the foreman-proxy-content flavor as the glue between Pulp and container gateway since we seem to be putting a lot of emphasis into it being "the" smart proxy deployment at the moment.
But I totally agree that the dependency should be linked more generally for users constructing their own capsules without using the foreman proxy content flavor. I can think up an issue for that that covers what we'd need to achieve the dependency with a conditional on the foreman-proxy context.
There was a problem hiding this comment.
I'm cooking something up, I'll push a commit soon.
There was a problem hiding this comment.
Okay, so while I am going to push something that links these dependencies - I currently see no way for an admin to build a foreman-proxy-content without using the flavor, which means the dependency link is purely for sanity rather than user benefit. At least for now.
The Pulp feature and its content types (besides ostree) are all internal, so I don't see how a user can use the foreman-proxy feature to build their own foreman-proxy-content. I suppose this may get smoothed out in the future.
96d5351 to
77b9f9f
Compare
77b9f9f to
2e2f69e
Compare
2e2f69e to
f1b98dd
Compare
|
@ehelms I reorganized the DB connection string variables so an Ansible role user can set the individual components or the entire string manually if they wish. I also added an integration test along with a temporary container image to see it working while we wait for theforeman/foreman-oci-images#53. |
|
|
||
| # Container gateway settings | ||
| foreman_proxy_container_gateway_pulp_endpoint: "https://{{ ansible_facts['fqdn'] }}" | ||
| foreman_proxy_container_gateway_db_host: "{{ container_gateway_database_host }}" |
There was a problem hiding this comment.
These aren't really defaults if they are defined by variables from somewhere else. I would expect default values as strings here, and for database.yml to then define the left hand side.
| container_gateway_database_password_file: "{{ obsah_state_path }}/container-gateway-db-password" | ||
| container_gateway_database_password: "{{ lookup('ansible.builtin.password', container_gateway_database_password_file, chars=['ascii_letters', 'digits']) }}" | ||
| container_gateway_database_host: "{{ database_host }}" | ||
| container_gateway_database_port: "{{ database_port }}" |
There was a problem hiding this comment.
I would expect these to all be the foreman_proxy_ scoped variable names -- https://github.com/theforeman/foremanctl/pull/611/changes#r3639114753
|
Ran a test for enabling container_gateway with foremanctl deploy-proxy on this branch on an existing proxy deployment and it worked well for me..Was able to run a backup as a follow up test and it correctly identified container_gateway and backed up the pulp and container_gateway DBs. 👍🏼 Update: Was able to test the proxy backup/restore on top of this and it worked well. #684 (comment) |
|
@ehelms I'm wrapping my head around the proper organization of the variables your asking about, but I made a push in response to your comments. I need to look into the failing tests, probably some expectations in other tests that I did not update. |
|
I pushed a change that makes the container gateway a dependency of content/container for all cases not matching "Foreman", which I assume here would mean smart proxy. I did this because foreman-proxy can be on Foreman or not on Foreman. Thus, the only marker of a "foreman-proxy-content" machine is the "foreman-proxy-content" flavor. The flavor alone is not enough to say there is a dependency between content/container and the container gateway, so my next best idea is to use the lack of Foreman in a deployment to mean that we are talking about a "foreman proxy content". This change means that we have a new concept of "unless" for features that are incompatible with each other. To accomplish this, I turned feature dependencies into dictionaries that can have "unless" as a list of incompatible plugins. |
b59f7dc to
ce04a83
Compare
ce04a83 to
fa6d7ed
Compare
|
There are similar conversations happening in #519 (comment) CC @ekohl @jeremylenz @shubhamsg199 The tension here is we have a single definition of features and then multiple scenarios that can apply:
|
|
I had difficulty writing this new feature in a way that didn't assume "no Forman == Forman proxy content" because the only real indicator of this that I could find is the use of the flavor. On top of that, the dependency linking feels unhelpful with current foremanctl because of this huge reliance on the flavor. I think the fact that flavors include internal only features is part of the problem. If we want flavor use to be optional, then they should not include internal features that cannot be enabled outside of the flavors. If we don't want flavors to be optional, then I think it should be fine for them to be a first class part of the feature dependency chain. |
I would agree -- flavors should not specify internal features at least based on my understanding of internal features. The current design is that a flavor is required as it defines the baseline, unchangeable properties of the deployment. However, I do not see why features need to know about flavors. Should features know about "server" and "proxy" -- I think so. I still strongly contend there are two foundational entities: server and proxy. And it matters which one is the target. That's why right now we have two distinct deployment commands. So from my point of view:
|
|
I was considering if we could simply add boolean values to each feature to declare what deployment scenario(s) each support. Are there other features that can only be installed on external foreman proxies? |
fa6d7ed to
18f3b80
Compare
* Update container gateway tests to match * Update features in yaml to be dictionaries
18f3b80 to
e6cf948
Compare
templates and registration are two! I mean, I guess you could install them on your foreman server, but they're not really relevant since they just proxy api endpoints. |
|
Before I make any changes, I'd like opinions on adding the feature incompatibility feature I have here ( I like using deployment methods as an indicator since checking for the existence of |
Why are you introducing these changes? (Problem description, related links)
The smart_proxy_container_gateway plugin is required for users to consume container content from smart proxies with Pulp.
What are the changes introduced in this pull request?
foreman-proxy.How to test this pull request
Steps to reproduce:
Checklist