Skip to content

Add federation to skmo#3766

Open
vakwetu wants to merge 8 commits intoopenstack-k8s-operators:mainfrom
vakwetu:add-federation-to-skmo
Open

Add federation to skmo#3766
vakwetu wants to merge 8 commits intoopenstack-k8s-operators:mainfrom
vakwetu:add-federation-to-skmo

Conversation

@vakwetu
Copy link
Contributor

@vakwetu vakwetu commented Mar 13, 2026

This adds cinder-volume and federation support to the SKMO scenario.

vakwetu and others added 3 commits March 12, 2026 10:53
…ooks

Add support for Shared Keystone Multi-region OpenStack (SKMO)
deployments with cross-region Barbican keystone listener:

Playbooks:
- prepare-leaf.yaml: Pre-stage hook that creates a TransportURL CR
  in the central region for the leaf's barbican-keystone-listener,
  copies the generated secret to the leaf namespace, extracts
  rootca-internal CA cert from central and adds it to the leaf's
  custom-ca-certs bundle, and waits for central Keystone and
  openstackclient readiness with retry logic
- configure-leaf-listener.yaml: Post-stage hook that patches the
  leaf OpenStackControlPlane with the cross-region transport_url
  for the barbican-keystone-listener
- trust-leaf-ca.yaml: Post-stage hook that extracts the leaf
  region's rootca-public and rootca-internal CA certs and adds
  them to the central region's custom-ca-certs bundle
- ensure-central-ca-bundle.yaml: Ensures the central CA bundle
  secret exists before the leaf control plane deployment

Scenario:
- va-multi-skmo.yml reproducer scenario configuration
- multi-namespace-skmo architecture scenario symlink

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Ade Lee <alee@redhat.com>
…mespace SKMO scenario

Add a 4th extra disk to OCP VMs in the SKMO reproducer and enable the
devscripts MachineConfig-based cinder-volumes LVM VG setup:

- extra_disks_num: 3 -> 4 to provide a dedicated disk (/dev/vdd) for Cinder
- cifmw_devscripts_create_logical_volume: true to generate the MachineConfig
  that creates the cinder-volumes VG via a systemd unit at boot time
- cifmw_devscripts_cinder_volume_pvs: [/dev/vdd] to target the 4th disk
- cifmw_devscripts_enable_iscsi_on_ocp_nodes: true to enable iscsid on
  OCP nodes (required for the iSCSI target created by cinder-volume)

LVMS continues to use the original three disks (/dev/vda, /dev/vdb, /dev/vdc).

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Ade Lee <alee@redhat.com>
…ecret

Add a new variable cifmw_federation_ca_bundle_secret_name (default: "")
to the federation role.  When set, hook_controlplane_config.yml merges the
Keycloak CA certificate as a new key (keycloak-ca.crt) into the named
secret rather than creating a separate 'keycloakca' secret.  If the named
secret does not yet exist it is created automatically.

In merge mode the kustomization patch omits the spec.tls.caBundleSecretName
op-add, since the OpenStackControlPlane CR is assumed to already reference
the correct secret (e.g. custom-ca-certs in SKMO deployments).

When cifmw_federation_ca_bundle_secret_name is empty the original behaviour
is preserved for backward compatibility: a dedicated 'keycloakca' secret is
created and the kustomization patches spec.tls.caBundleSecretName to point
at it.
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 13, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign michburk for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/3f0763b046e041c18b43ec998692e6d3

openstack-k8s-operators-content-provider FAILURE in 10m 52s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal-minor-update SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ cifmw-pod-zuul-files SUCCESS in 4m 34s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 05s
✔️ cifmw-pod-k8s-snippets-source SUCCESS in 4m 53s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 55s
✔️ cifmw-architecture-validate-hci SUCCESS in 3m 46s
✔️ cifmw-molecule-ci_gen_kustomize_values SUCCESS in 5m 21s
✔️ cifmw-molecule-federation SUCCESS in 1m 59s

vakwetu added 5 commits March 13, 2026 14:10
Two bugs in run_keycloak_setup.yml:
1. The 'until' condition wrapped its expression in {{ }} delimiters,
   which Ansible forbids in conditionals (causes a parse error).
2. map(attribute='metadata.labels') returns a dict per resource;
   select('match', ...) cannot regex-match a dict, causing
   'dict object has no attribute labels' at runtime.

Fix by removing the {{ }} and using dict2items + flatten to extract
label keys before applying the regex selector.
…re writing

The ansible.builtin.copy task that writes keystone_federation.yaml fails
if the destination directory does not yet exist. Add an explicit
ansible.builtin.file task (state: directory) immediately before the two
copy tasks so the directory is created on demand.
…test

The customServiceConfig patch that adds 'openid' to Keystone's
[auth] methods is applied during the control-plane kustomize deploy
(stage 5). By the time the leaf control-plane post_stage_run hooks
execute (including federation-post-deploy.yml), Keystone may not
have finished reconciling with the new config.

Domain/IdP/mapping/protocol creation succeed because they use the
existing password auth path; only get-token.sh (which authenticates
via openid) fails with HTTP 401 'unsupported method'.

Add a wait-for-Ready loop on the KeystoneAPI CR at the start of
hook_post_deploy.yml (retries=30, delay=20s = up to 10 min) so
the auth test only runs once Keystone has restarted with federation
configuration active.
The kustomizations/controlplane/ directory is only consumed by the
edpm_prepare / ci_kustomize flow (CRC/devscripts deployments). In the
kustomize_deploy flow used by SKMO (deploy-architecture.sh), nothing
reads that directory, so the keystone_federation.yaml file was written
but never applied - leaving the OSCP unmodified.

Add Step 6 to hook_controlplane_config.yml that:
1. Checks whether the OpenStackControlPlane CR already exists.
2. If so, patches it directly via kubernetes.core.k8s (state: patched)
   with the httpdCustomization, customServiceConfig (openid methods),
   and (in dedicated-secret mode) spec.tls.caBundleSecretName.

The kustomization file is still written for backward compatibility with
deployments that use edpm_prepare (CRC/devscripts flow). The direct
patch is a no-op when the OSCP does not yet exist (fresh install with
CRC flow), making both paths safe.
When deploy-architecture.sh is re-run against an existing deployment,
the federation domain, identity provider, mapping, group, project and
protocol may already exist in Keystone. The plain 'openstack X create'
commands fail with HTTP 409 Conflict in that case.

Fix by checking for the existence of each resource with 'openstack X show'
(failed_when: false, changed_when: false) before attempting to create it.
The create task is only run when the show returned rc != 0 (i.e. the
resource was not found).

Role-add is repeated unconditionally with failed_when: false because
the Keystone API makes it idempotent already.
@softwarefactory-project-zuul
Copy link

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/735d0c0530b44e039353be5e0993611a

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 46m 16s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 21m 45s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 1h 33m 32s
cifmw-crc-podified-edpm-baremetal-minor-update RETRY_LIMIT in 24m 48s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 46s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 01s
✔️ cifmw-pod-k8s-snippets-source SUCCESS in 5m 26s
✔️ cifmw-pod-pre-commit SUCCESS in 9m 53s
✔️ cifmw-architecture-validate-hci SUCCESS in 3m 51s
✔️ cifmw-molecule-ci_gen_kustomize_values SUCCESS in 5m 19s
✔️ cifmw-molecule-federation SUCCESS in 1m 33s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant