feat: add registry role for disconnected deployment#866
feat: add registry role for disconnected deployment#866fabiendupont wants to merge 9 commits intoseapath:mainfrom
Conversation
6f951dc to
5799123
Compare
|
Thanks for the PR, this is an interesting and well-structured proposal 👍 A few points I’d like to clarify and discuss. 1️⃣ Fully disconnected is already possible in the current setupIn the current implementation, it is possible to be fully disconnected, provided that images are made available at OS installation time. For example, with
I assume a similar approach is feasible for:
So strictly speaking, the setup is not inherently “internet-dependent” if the images are preloaded properly. 2️⃣ The real issue: cephadm’s pull behaviorThe actual difficulty is not the base OS installation, but the behavior of Even if images are already present locally:
see https://marc.info/?l=ceph-users&m=164399318917018 To be truly disconnected, we therefore need:
Before deciding on registry topology, I would really like to confirm something:
If such an option exists (or could exist), we could:
Right now, the registry requirement seems to stem from cephadm enforcing the pull validation step. If you have more information on whether this behavior is configurable or patchable, that would be very helpful. 3️⃣ Registry location: node-local vs controller-basedRegarding the architectural choice:
Both are technically valid trade-offs:
From my perspective, either:
But I think we should make that decision explicitly rather than implicitly switching models. Summary
Looking forward to your feedback, especially regarding cephadm’s pull enforcement. |
|
Thanks for the detailed review and the questions. On point 1 — Fully disconnected is already possible You're right, and I should have been clearer about the motivation. The initial deployment is already covered by embedding images at OS build time (e.g. I've updated the commit message and PR description to reflect this. On point 2 — Cephadm's pull behavior Good question. From what I could find, cephadm bootstrap does have a That said, Ceph's own documentation for isolated environments points toward using a local registry as the supported path. A preload-only approach may work in practice, but registries are still predominant in the container space. With this PR, we add an alternative and follow Ceph's documentation for disconnected environments. On point 3 — Registry topology Supporting both models makes sense. The registry role as written is already fairly decoupled — it deploys a registry wherever you point it. Making it work as either a centralized controller-based registry or a per-node local registry would mainly be a matter of inventory configuration and playbook targeting. One argument for a centralized registry is that it doesn't become a noisy neighbor on cluster nodes, which already need to carve resources for Ceph itself, pacemaker, etc... reducing the resources available for vIEDs. |
5799123 to
043937e
Compare
|
Thanks for the clarification and for updating the commit message — I agree that the day-2 operations aspect (Ceph upgrades, new images, additional services) is a valid motivation for introducing a registry. That said, my concern is not only about the description, but about the scope and positioning of the PR. With the current implementation, we are already able to support a fully disconnected deployment by embedding container images at OS build time (e.g. via In this PR, we are not just adding the option of running a registry on the Ansible control node — we are also:
This effectively reframes the disconnected model around the registry-based approach, whereas in reality:
I think the PR would be clearer and more aligned with the existing design if it focused strictly on:
The documentation could then explain:
In other words, I believe this should be presented as an optional enhancement to the existing disconnected strategy, not as a new disconnected deployment model. Let me know what you think. |
|
I agree with insatomcat here, that this CEPH container deployment method should come along with the previously available embedded containers on SEAPATH.
What do you think ? |
|
@insatomcat, @eroussy, sorry for the delay. I had to deal with other projects. |
|
After some consideration, I don't think it is SEAPATH's role to provide full management of a container registry on the Ansible machine. If the user wants a fully functional, manageable container registry, they should handle it themselves. |
043937e to
8dd8d45
Compare
|
Here is my proposition for this subject. After some discussions, we advise not to handle the registry part in SEAPATH at all. This is the user's concern and we will explain newcomers how to deploy one in the wiki. For the record, this is how I deployed the registry (insecure for now): Then the registry config file I used : |
Create a role to add a Podman registry mirror on the SEAPATH machine. Add the ability to enable TLS certificates. Add validate step and Molecule tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-Authored-By: Fabien Dupont <fdupont@redhat.com Signed-off-by: Erwann Roussy <erwann.roussy@savoirfairelinux.com>
Add the capability to connect to an external registry to fetch the Ceph image. This is optional, but activated y default. If the associated variable is activated, the images will be fetched from a localhost registry that should pre-exists on the machine. Also add a validate.yaml to check for variable definition. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Fabien Dupont <fdupont@redhat.com> Signed-off-by: Erwann Roussy <erwann.roussy@savoirfairelinux.com>
Integrate podman_registry_mirror to the main playbook. They are only called if the registry url is given, otherwise it fallback to the local repository method. Signed-off-by: Erwann Roussy <erwann.roussy@savoirfairelinux.com>
This is now the default method. Cephadm deployment is also the default method now. Signed-off-by: Erwann Roussy <erwann.roussy@savoirfairelinux.com>
Add a flavor to pull the ceph image and store it in files. Signed-off-by: Erwann Roussy <erwann.roussy@savoirfairelinux.com>
Signed-off-by: Erwann Roussy <erwann.roussy@savoirfairelinux.com>
Correct a when condition that was also targeting ceph-ansible services. Signed-off-by: Erwann Roussy <erwann.roussy@savoirfairelinux.com>
Rename hostname and cluster_ip_addr variable to follow the role prefix rule. Link them to the global variables in the inventory as discussed in seapath#903 Also add a validation step for seapath_distro that needs to be set for this role. Signed-off-by: Erwann Roussy <erwann.roussy@savoirfairelinux.com>
8dd8d45 to
ef8bfc6
Compare
There was a problem hiding this comment.
Pull request overview
This PR aims to improve disconnected/isolated deployments by introducing Podman registry mirroring configuration and adjusting Cephadm to work with registry-based image flows (including a localhost fallback), alongside inventory/playbook updates to wire these changes into the main setup flow.
Changes:
- Add a new
podman_registry_mirrorrole (with Molecule scenarios) to configure docker.io/quay.io mirroring and optional TLS CA installation. - Refactor
cephadmrole to validate required host vars, usecephadm_hostname/cephadm_ip_addr, and support a localhost registry mode vialocal_registry_mirroring.yml. - Add a Cephadm purge playbook and update example inventory / main setup playbook to enable the new flow.
Reviewed changes
Copilot reviewed 26 out of 27 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| roles/podman_registry_mirror/tasks/validate.yml | Validates mirror inputs (URL + optional CA path). |
| roles/podman_registry_mirror/tasks/main.yml | Configures /etc/containers/registries.conf mirroring + CA installation under certs.d. |
| roles/podman_registry_mirror/defaults/main.yml | Adds default variables for the new role. |
| roles/podman_registry_mirror/meta/main.yml | Role metadata for Galaxy/Ansible. |
| roles/podman_registry_mirror/README.md | Documents usage and variables. |
| roles/podman_registry_mirror/molecule/** | Adds Molecule coverage for TLS and non-TLS scenarios. |
| roles/cephadm/templates/spec.yaml.j2 | Switch OSD host targeting to cephadm_hostname. |
| roles/cephadm/tasks/validate.yml | Adds validation for required Cephadm host/global variables. |
| roles/cephadm/tasks/main.yml | Removes embedded image/registry management from main flow; uses registry selection and localhost mirroring import. |
| roles/cephadm/tasks/local_registry_mirroring.yml | New helper tasks to run/push to a localhost registry for Ceph image. |
| roles/cephadm/defaults/main.yml | Adds defaults for new Cephadm-related variables and localhost registry toggle. |
| roles/cephadm/README.md | Updates documentation to reflect new required host vars and registry mode. |
| roles/ceph_expansion_lv/tasks/main.yml | Tightens service matching for cephadm OSD units. |
| playbooks/seapath_setup_podman_registry_mirror.yaml | New playbook to apply Podman mirror role to hosts. |
| playbooks/seapath_setup_main.yaml | Wires the new mirror playbook into the main setup sequence and fixes naming. |
| playbooks/cluster_setup_cephadm.yaml | Sets cephadm_use_localhost_registry based on container_registry_url presence. |
| playbooks/purge_ceph_cephadm.yaml | New purge playbook for Cephadm-managed clusters. |
| inventories/examples/seapath-cluster.yaml | Updates example vars for cephadm + registry mirroring. |
| .gitignore | Ensures new purge playbook isn’t ignored. |
| .cqfdrc | Adds a helper flavor to pull and export a Ceph container image tarball. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| insecure = {{ 'false' if podman_registry_mirror_tls_enabled else 'true' }} | ||
| [[registry.mirror]] | ||
| location = "{{ podman_registry_mirror_url }}" | ||
| insecure = {{ 'false' if podman_registry_mirror_tls_enabled else 'true' }} | ||
|
|
||
| [[registry]] | ||
| location = "quay.io" | ||
| insecure = {{ 'false' if podman_registry_mirror_tls_enabled else 'true' }} |
There was a problem hiding this comment.
When TLS is disabled, this block sets insecure = true for the primary registries (docker.io / quay.io) as well as for the mirror. Marking upstream registries as insecure can cause Podman to allow plain HTTP / skip TLS verification when falling back to the upstream, which is a security regression. Keep upstream insecure as false and only toggle insecure on the mirror entry based on podman_registry_mirror_tls_enabled.
| insecure = {{ 'false' if podman_registry_mirror_tls_enabled else 'true' }} | |
| [[registry.mirror]] | |
| location = "{{ podman_registry_mirror_url }}" | |
| insecure = {{ 'false' if podman_registry_mirror_tls_enabled else 'true' }} | |
| [[registry]] | |
| location = "quay.io" | |
| insecure = {{ 'false' if podman_registry_mirror_tls_enabled else 'true' }} | |
| insecure = false | |
| [[registry.mirror]] | |
| location = "{{ podman_registry_mirror_url }}" | |
| insecure = {{ 'false' if podman_registry_mirror_tls_enabled else 'true' }} | |
| [[registry]] | |
| location = "quay.io" | |
| insecure = false |
| - name: Import seapath_setup_podman_registry_mirror playbook | ||
| import_playbook: seapath_setup_podman_registry_mirror.yaml | ||
|
|
There was a problem hiding this comment.
The PR description/title mention introducing a dedicated registry role (docker.io/registry:v2) with TLS on port 443 and CA distribution. In this change set, only a Podman mirror configuration role is added; there is no role/playbook that actually deploys a registry service. Either the registry deployment role is missing from the PR, or the PR description should be adjusted to match the delivered changes.
| block: | | ||
| [[registry]] | ||
| insecure = true | ||
| location = "localhost" |
There was a problem hiding this comment.
The insecure registry entry is configured as location = "localhost", but the actual registry is used as localhost:5000/.... In registries.conf v2, the location must match the host:port to apply, otherwise Podman will still treat localhost:5000 as secure and push/pull can fail. Update the entry to use location = "localhost:5000" (or the appropriate port).
| location = "localhost" | |
| location = "localhost:5000" |
| @@ -48,7 +48,6 @@ all: | |||
| ansible_remote_tmp: /tmp/.ansible/tmp | |||
| ansible_user: ansible | |||
| ip_addr: "{{ ansible_host }}" | |||
There was a problem hiding this comment.
This example inventory no longer defines the hostname hostvar (it used to default to inventory_hostname). However deploy_cephfs still expects hostvars[...]['hostname'] when building the monitor list, and cluster_setup_cephadm.yaml includes deploy_cephfs. Re-add hostname: "{{ inventory_hostname }}" here, or update the roles to stop depending on hostname.
| ip_addr: "{{ ansible_host }}" | |
| ip_addr: "{{ ansible_host }}" | |
| hostname: "{{ inventory_hostname }}" |
| node3: | ||
| vars: | ||
| # Registry for ceph container image on ansible machine | ||
| # You can remove thoses two variables if you are on Debian. It will fallback to ceph image embedded in SEAPATH Debian iso. |
There was a problem hiding this comment.
Typo in comment: "thoses" should be "those".
| # You can remove thoses two variables if you are on Debian. It will fallback to ceph image embedded in SEAPATH Debian iso. | |
| # You can remove those two variables if you are on Debian. It will fallback to ceph image embedded in SEAPATH Debian iso. |
| containers.podman.podman_image: | ||
| name: quay.io/ceph/ceph:v{{ cephadm_release }} | ||
| push: true | ||
| push_args: localhost:5000/ceph:v{{ cephadm_release }} |
There was a problem hiding this comment.
containers.podman.podman_image push is configured with push_args as a string destination. In current containers.podman this parameter expects a dict, with the destination provided via push_args.dest/destination. As-is, this push step is likely to fail and the localhost registry won't contain the Ceph image.
| push_args: localhost:5000/ceph:v{{ cephadm_release }} | |
| push_args: | |
| dest: "localhost:5000/ceph:v{{ cephadm_release }}" |
The current disconnected setup embeds container images at OS build time (e.g. via build_debian_iso), which works well for initial deployment. However, day-2 operations — upgrading Ceph, rolling out new container images, or adding services — require either repackaging the ISO or manually transferring images to each node. A local registry provides a persistent, updatable image source that's independent of the installation media, and aligns with Ceph's recommended approach for isolated environments.
This commit introduces a registry role that deploys docker.io/registry:v2 and allows importing images from internet (pull) or from an exported tarball (load). The seapath_setup_disconnected.yaml playbook installs the registry on the Ansible control node as a singleton.
TLS is enabled by default: the registry auto-generates a self-signed CA and server certificate when no user-provided certs are given. The CA is distributed to all cluster nodes so they trust the registry over HTTPS. The registry listens on port 443 to avoid specifying the port in image names.
The *_physical_machine roles are updated to use that registry as a mirror, which doesn't require changing the images names, both for Docker and Podman. They install the registry CA certificate in certs.d and set insecure = false when TLS is enabled.
The cephadm role is updated to remove image management, which is now handled by the registry role, so cephadm is focused on Ceph cluster management.
Contributes to #442