From 1a13eca0a8b35d984ecb553a1ae33061745dba32 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Mon, 9 Feb 2026 00:45:05 +0000 Subject: [PATCH 1/3] Enable designate redis and designate instance. This patch uses existing nsRecords from the designate data that should have been copied at this point. This is really the only authoritative source. Note: patch also provides a mechanism for altering the number of PVs. --- .../proc_adopting-the-dns-service.adoc | 135 ++++++++++++++++ .../tasks/designate_cr_config.yaml | 149 ++++++++++++++++++ .../roles/designate_adoption/tasks/main.yaml | 5 + tests/roles/pcp_cleanup/defaults/main.yaml | 3 + tests/roles/pcp_cleanup/tasks/main.yaml | 2 +- 5 files changed, 293 insertions(+), 1 deletion(-) create mode 100644 tests/roles/designate_adoption/tasks/designate_cr_config.yaml diff --git a/docs_user/modules/proc_adopting-the-dns-service.adoc b/docs_user/modules/proc_adopting-the-dns-service.adoc index 73d3a7058..11c15a181 100644 --- a/docs_user/modules/proc_adopting-the-dns-service.adoc +++ b/docs_user/modules/proc_adopting-the-dns-service.adoc @@ -175,3 +175,138 @@ spec: - enp6s0.26 EOF ---- + +. Retrieve the nameserver records from the {dns_service} database to preserve DNS delegation: ++ +---- +$ DB_ROOT_PASSWORD=$(oc get -o json secret/osp-secret | jq -r .data.DbRootPassword | base64 -d) +$ oc exec openstack-galera-0 -c galera -- mysql -rs -uroot -p"$DB_ROOT_PASSWORD" \ + -e "select a.hostname, a.priority from designate.pool_ns_records a;" > /tmp/designate_ns_records_raw.txt +---- + +. Parse the nameserver records into YAML format for the {dns_service} CR: ++ +---- +$ raw=/tmp/designate_ns_records_raw.txt +$ out=/tmp/designate_ns_records.yaml +$ if [ ! -s "$raw" ]; then + echo "[]" > "$out" +else + awk '{ gsub(/\.$/, "", $1); if (NF >= 2) printf "- hostname: %s.\n priority: %s\n", $1, $2 }' "$raw" > "$out" +fi +---- + +. Enable the {dns_service} Redis instance in {rhocp_short}: ++ +---- +$ oc patch openstackcontrolplane openstack --type=merge --patch ' +spec: + redis: + enabled: true + templates: + designate-redis: + replicas: 1 +' +---- + +. Wait for the {dns_service} Redis instance to become ready: ++ +---- +$ oc wait --for condition=Ready --timeout=60s redises.redis.openstack.org/designate-redis +---- + +. Create the {dns_service} CR patch file: ++ +[NOTE] +==== +Replace `` with the storage class name for persistent volumes (for example, `local-storage`). +==== ++ +[subs="+quotes"] +---- +$ cat > /tmp/designate_osp_patch.yaml << 'MAINCR' +spec: + designate: + enabled: true + template: + designateAPI: + networkAttachments: + - internalapi + designateWorker: + networkAttachments: + - designate + replicas: 3 + designateCentral: + replicas: 3 + designateProducer: + replicas: 3 + designateBackendbind9: + networkAttachments: + - designate + override: + services: + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.80 + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.81 + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.82 + replicas: 3 + storageClass: + storageRequest: 10G + designateMdns: + networkAttachments: + - designate + replicas: 3 + designateUnbound: + networkAttachments: + - designate + replicas: 2 + override: + services: + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.85 + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.86 +MAINCR +---- + +. Append the nameserver records to the patch file: ++ +---- +$ ns_yaml=/tmp/designate_ns_records.yaml +$ patch_file=/tmp/designate_osp_patch.yaml +$ echo ' nsRecords:' >> "$patch_file" +$ if [ -s "$ns_yaml" ] && [ "$(cat "$ns_yaml")" != "[]" ]; then + sed 's/^/ /' "$ns_yaml" >> "$patch_file" +else + echo ' []' >> "$patch_file" +fi +---- + +. Enable the {dns_service} in {rhocp_short}: ++ +---- +$ oc patch openstackcontrolplane openstack --type=merge --patch-file /tmp/designate_osp_patch.yaml +---- + +. Wait for the {dns_service} to become ready: ++ +---- +$ oc wait --for condition=Ready --timeout=600s designate.designate.openstack.org/designate +---- diff --git a/tests/roles/designate_adoption/tasks/designate_cr_config.yaml b/tests/roles/designate_adoption/tasks/designate_cr_config.yaml new file mode 100644 index 000000000..ee872db49 --- /dev/null +++ b/tests/roles/designate_adoption/tasks/designate_cr_config.yaml @@ -0,0 +1,149 @@ +- name: Retrieve the known ns_record values from the designate database + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + DB_ROOT_PASSWORD=$(oc get -o json secret/osp-secret | jq -r .data.DbRootPassword | base64 -d) + oc exec openstack-galera-0 -c galera -- mysql -rs -uroot -p"$DB_ROOT_PASSWORD" \ + -e "select a.hostname, a.priority from designate.pool_ns_records a;" > /tmp/designate_ns_records_raw.txt + register: records_check_results + changed_when: false + +- name: Parse ns_record values into YAML format for CR + ansible.builtin.shell: | + set -e + raw=/tmp/designate_ns_records_raw.txt + out=/tmp/designate_ns_records.yaml + if [ ! -s "$raw" ]; then + echo "[]" > "$out" + else + awk '{ gsub(/\.$/, "", $1); if (NF >= 2) printf "- hostname: %s.\n priority: %s\n", $1, $2 }' "$raw" > "$out" + fi + args: + executable: /bin/bash + +- name: Enable the designate redis instance in OpenShift + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + + oc patch openstackcontrolplane openstack --type=merge --patch ' + spec: + redis: + enabled: true + templates: + designate-redis: + replicas: 1 + ' + register: designate_redis_config_results + changed_when: true + failed_when: designate_redis_config_results.rc != 0 + +- name: Wait for the designate redis instance to become ready + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + + oc wait --for condition=Ready --timeout=60s redises.redis.openstack.org/designate-redis + register: designate_redis_ready_result + until: designate_redis_ready_result is success + retries: 60 + delay: "{{ designate_retry_delay }}" + +- name: Create designate OSP patch file (main CR) + ansible.builtin.shell: | + patch_file=/tmp/designate_osp_patch.yaml + cat << MAINCR > "$patch_file" + spec: + designate: + enabled: true + template: + designateAPI: + networkAttachments: + - internalapi + designateWorker: + networkAttachments: + - designate + replicas: 3 + designateCentral: + replicas: 3 + designateProducer: + replicas: 3 + designateBackendbind9: + networkAttachments: + - designate + override: + services: + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.80 + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.81 + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.82 + replicas: 3 + storageClass: $STORAGE_CLASS_NAME + storageRequest: 10G + designateMdns: + networkAttachments: + - designate + replicas: 3 + designateUnbound: + networkAttachments: + - designate + replicas: 2 + override: + services: + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.85 + - metadata: + annotations: + metallb.universe.tf/address-pool: designateext + metallb.universe.tf/allow-shared-ip: designateext + metallb.universe.tf/loadBalancerIPs: 172.50.0.86 + MAINCR + environment: + STORAGE_CLASS_NAME: "{{ storage_class_name }}" + +- name: Append nsRecords to designate OSP patch file + ansible.builtin.shell: | + ns_yaml=/tmp/designate_ns_records.yaml + patch_file=/tmp/designate_osp_patch.yaml + + echo ' nsRecords:' >> "$patch_file" + if [ -s "$ns_yaml" ] && [ "$(cat "$ns_yaml")" != "[]" ]; then + sed 's/^/ /' "$ns_yaml" >> "$patch_file" + else + echo ' []' >> "$patch_file" + fi + +- name: Enable designate service in OpenShift + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + + oc patch openstackcontrolplane openstack --type=merge --patch-file /tmp/designate_osp_patch.yaml + register: designate_service_config_results + changed_when: true + failed_when: designate_service_config_results.rc != 0 + +- name: Wait for the designate service to become ready + ansible.builtin.shell: | + {{ shell_header }} + {{ oc_header }} + + oc wait --for condition=Ready --timeout=60s designates.designate.openstack.org/designate + register: designate_service_ready_result + until: designate_service_ready_result is success + retries: 60 + delay: "{{ designate_retry_delay }}" diff --git a/tests/roles/designate_adoption/tasks/main.yaml b/tests/roles/designate_adoption/tasks/main.yaml index cb63a8659..2874446dc 100644 --- a/tests/roles/designate_adoption/tasks/main.yaml +++ b/tests/roles/designate_adoption/tasks/main.yaml @@ -2,3 +2,8 @@ when: designate_adoption | bool ansible.builtin.include_tasks: file: designate_network_config.yaml + +- name: Configure and enable Designate service + when: designate_adoption | bool + ansible.builtin.include_tasks: + file: designate_cr_config.yaml diff --git a/tests/roles/pcp_cleanup/defaults/main.yaml b/tests/roles/pcp_cleanup/defaults/main.yaml index be4c2abd3..1e71f3b31 100644 --- a/tests/roles/pcp_cleanup/defaults/main.yaml +++ b/tests/roles/pcp_cleanup/defaults/main.yaml @@ -8,3 +8,6 @@ reset_crc_storage: false # Whether 'make standalone_revert' should be run before # running the test suite. standalone_revert_enabled: false + +# The number of peristent volumes to create if crc is being reset. +crc_pv_num: 12 diff --git a/tests/roles/pcp_cleanup/tasks/main.yaml b/tests/roles/pcp_cleanup/tasks/main.yaml index 776202087..9b83dca63 100644 --- a/tests/roles/pcp_cleanup/tasks/main.yaml +++ b/tests/roles/pcp_cleanup/tasks/main.yaml @@ -56,7 +56,7 @@ cd {{ install_yamls_path }} # Try up to 3 times to clean up and recreate CRC storage, with a 5-second delay between attempts for i in {1..3}; do - make crc_storage_cleanup crc_storage && break || sleep 5 + make crc_storage_cleanup crc_storage PV_NUM={{ crc_pv_num }} && break || sleep 5 done {{ cells_env }} NAMESPACE={{ rhoso_namespace }} make namespace From 8f966e4278a7a51fd759cdbfd9f0317c3130e739 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Tue, 24 Mar 2026 13:04:44 -0230 Subject: [PATCH 2/3] Update docs_user/modules/proc_adopting-the-dns-service.adoc Co-authored-by: Katie Gilligan --- docs_user/modules/proc_adopting-the-dns-service.adoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs_user/modules/proc_adopting-the-dns-service.adoc b/docs_user/modules/proc_adopting-the-dns-service.adoc index 11c15a181..188b9bb75 100644 --- a/docs_user/modules/proc_adopting-the-dns-service.adoc +++ b/docs_user/modules/proc_adopting-the-dns-service.adoc @@ -285,6 +285,11 @@ spec: metallb.universe.tf/loadBalancerIPs: 172.50.0.86 MAINCR ---- ++ +where: + +``:: +Specifies the storage class name for persistent volumes (for example, `local-storage`). . Append the nameserver records to the patch file: + From c5f6deabcba2cb76ddfaa90b06a29d2e9aee7a0b Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Tue, 24 Mar 2026 13:04:53 -0230 Subject: [PATCH 3/3] Update docs_user/modules/proc_adopting-the-dns-service.adoc Co-authored-by: Katie Gilligan --- docs_user/modules/proc_adopting-the-dns-service.adoc | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs_user/modules/proc_adopting-the-dns-service.adoc b/docs_user/modules/proc_adopting-the-dns-service.adoc index 188b9bb75..c2dfa61e4 100644 --- a/docs_user/modules/proc_adopting-the-dns-service.adoc +++ b/docs_user/modules/proc_adopting-the-dns-service.adoc @@ -217,11 +217,6 @@ $ oc wait --for condition=Ready --timeout=60s redises.redis.openstack.org/design . Create the {dns_service} CR patch file: + -[NOTE] -==== -Replace `` with the storage class name for persistent volumes (for example, `local-storage`). -==== -+ [subs="+quotes"] ---- $ cat > /tmp/designate_osp_patch.yaml << 'MAINCR'