-
Notifications
You must be signed in to change notification settings - Fork 85
Complete role and docs for enabling designate #1295
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
Merged
openshift-merge-bot
merged 3 commits into
openstack-k8s-operators:main
from
beagles:enable-designate
Mar 31, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
149 changes: 149 additions & 0 deletions
149
tests/roles/designate_adoption/tasks/designate_cr_config.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 }}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.