|
6 | 6 | [role="_abstract"] |
7 | 7 | To adopt the {dns_first_ref}, you patch an existing `OpenStackControlPlane` custom resource (CR) where the {dns_service} is disabled. The patch starts the service with the configuration parameters that are provided by the {rhos_prev_long} ({OpenStackShort}) environment. |
8 | 8 |
|
| 9 | +[NOTE] |
| 10 | +==== |
| 11 | +If your {rhos_prev_long} deployment uses BIND9 servers that you want to keep serving DNS during and after adoption, you can include them as external backends alongside the new operator-managed BIND9 instances. In this staged migration model, both the legacy BIND9 servers and the new cluster-hosted BIND9 StatefulSet serve the same pool concurrently. This avoids a disruptive DNS switchover and allows external DNS registries and delegations to be updated to reference the new nameservers at a later date. |
| 12 | +
|
| 13 | +After completing the standard adoption procedure, see xref:maintaining-a-migration-window-with-legacy-bind9-servers_{context}[Maintaining a migration window with legacy BIND9 servers] for the additional steps required to enable this transition window. |
| 14 | +==== |
| 15 | + |
9 | 16 | .Procedure |
10 | 17 |
|
11 | 18 | . Create an alias for the `openstack` command: |
@@ -320,3 +327,241 @@ $ oc patch openstackcontrolplane openstack --type=merge --patch-file /tmp/design |
320 | 327 | ---- |
321 | 328 | $ oc wait --for condition=Ready --timeout=600s designate.designate.openstack.org/designate |
322 | 329 | ---- |
| 330 | + |
| 331 | +[id="maintaining-a-migration-window-with-legacy-bind9-servers_{context}"] |
| 332 | +== Maintaining a migration window with legacy BIND9 servers |
| 333 | + |
| 334 | +If your {rhos_prev_long} deployment uses BIND9 servers that should continue serving DNS during adoption, follow this procedure after completing the standard {dns_service} adoption. The designate worker sends RNDC commands and DNS NOTIFY messages to the legacy servers, which pull zone data from the mDNS service through AXFR on port 5354. |
| 335 | + |
| 336 | +When external DNS registries and delegations have been updated to reference the new nameservers, follow the steps in xref:completing-the-bind9-migration_{context}[Completing the BIND9 migration] to remove the legacy servers from the pool. |
| 337 | + |
| 338 | +.Procedure |
| 339 | + |
| 340 | +. Extract RNDC credentials from each legacy {rhos_prev_long} controller that runs BIND9 and create the `designate-external-binds` secret. Run this script from the adoption host: |
| 341 | ++ |
| 342 | +---- |
| 343 | +$ binddata_file=/tmp/binddata.yaml |
| 344 | +$ rm $binddata_file |
| 345 | +$ for i in {1..3}; do |
| 346 | + SSH_CMD=CONTROLLER${i}_SSH |
| 347 | + if [ ! -z "${!SSH_CMD}" ]; then |
| 348 | + echo "Extracting RNDC credentials from controller $i" |
| 349 | + RNDC_SECRET=$(${!SSH_CMD} sudo grep secret /var/lib/config-data/ansible-generated/designate/etc/named/rndc.conf | awk '{gsub(/"/, "", $2); gsub(/;/, "", $2); print $2}') |
| 350 | + RNDC_KEYNAME=$(${!SSH_CMD} sudo grep '^key' /var/lib/config-data/ansible-generated/designate/etc/named/rndc.conf | awk '{gsub(/"/, "", $2); print $2}' | cut -f 1) |
| 351 | + RNDC_ALGORITHM=$(${!SSH_CMD} sudo grep algorithm /var/lib/config-data/ansible-generated/designate/etc/named/rndc.conf | awk '{gsub(/;/, "", $2); print $2}') |
| 352 | + CONTROLLER_IP=$(${!SSH_CMD} sudo grep 'internal_api\"' /etc/puppet/hieradata/net_ip_map.json | awk '{gsub(/"/, "", $2); gsub(/,/, "", $2); print $2}') |
| 353 | + cat << BINDATACR >> "$binddata_file" |
| 354 | + - name: controller-$i |
| 355 | + address: $CONTROLLER_IP |
| 356 | + rndcsecret: $RNDC_SECRET |
| 357 | + rndckeyname: $RNDC_KEYNAME |
| 358 | + rndcalgorithm: $RNDC_ALGORITHM |
| 359 | +BINDATACR |
| 360 | + fi |
| 361 | + done |
| 362 | +$ if [ -s "$binddata_file" ]; then |
| 363 | + external_binds_secret_file=/tmp/external_binds_secret.yaml |
| 364 | + cat << EOSECRETC > "$external_binds_secret_file" |
| 365 | +apiVersion: v1 |
| 366 | +kind: Secret |
| 367 | +metadata: |
| 368 | + name: designate-external-binds |
| 369 | + namespace: openstack |
| 370 | +type: Opaque |
| 371 | +stringData: |
| 372 | + default: | |
| 373 | +$(cat "$binddata_file") |
| 374 | +EOSECRETC |
| 375 | + oc apply -f "$external_binds_secret_file" |
| 376 | + fi |
| 377 | +---- |
| 378 | ++ |
| 379 | +where `CONTROLLER1_SSH`, `CONTROLLER2_SSH`, and `CONTROLLER3_SSH` are the SSH connection variables for each legacy controller that runs BIND9. The script extracts credentials from each available controller and automatically creates and applies the `designate-external-binds` secret in the `openstack` namespace. |
| 380 | + |
| 381 | +. Reconfigure the legacy BIND9 instances to accept RNDC connections and zone transfers from the new {rhos_long} deployment. On each legacy controller, modify the BIND9 configuration. Because the `options` and `controls` blocks cannot be reopened, use the following commands to add the required configuration in-place: |
| 382 | ++ |
| 383 | + |
| 384 | +[subs="+quotes"] |
| 385 | +---- |
| 386 | +$ INTERNALAPI_CIDR=<internalapi_subnet> |
| 387 | +$ for i in {1..3}; do |
| 388 | + SSH_CMD=CONTROLLER${i}_SSH |
| 389 | + if [ ! -z "${!SSH_CMD}" ]; then |
| 390 | + echo "Reconfiguring bind on controller $i" |
| 391 | + CONTROLLER_IP=$(${!SSH_CMD} sudo grep 'internal_api\"' /etc/puppet/hieradata/net_ip_map.json | awk '{gsub(/"/, "", $2); gsub(/,/, "", $2); print $2}') |
| 392 | + ${!SSH_CMD} cp -n /var/lib/config-data/ansible-generated/designate/etc/named/rndc.conf /var/lib/config-data/ansible-generated/designate/etc/named/rndc.conf.pre-adoption-backup |
| 393 | + ${!SSH_CMD} "sed -i 's:inet [0-9.]* allow { [0-9./]*; }:inet ${CONTROLLER_IP} allow { ${INTERNALAPI_CIDR}; }:' /var/lib/config-data/ansible-generated/designate/etc/named/rndc.conf" |
| 394 | + ${!SSH_CMD} cp -n /var/lib/config-data/ansible-generated/designate/etc/named/options.conf /var/lib/config-data/ansible-generated/designate/etc/named/options.conf.pre-adoption-backup |
| 395 | + ${!SSH_CMD} "sed -i 's:allow.notify.*};:allow-notify { $INTERNALAPI_CIDR; };:' /var/lib/config-data/ansible-generated/designate/etc/named/options.conf" |
| 396 | + ${!SSH_CMD} "sed -i '/allow.transfer:/d' /var/lib/config-data/ansible-generated/designate/etc/named/options.conf" |
| 397 | + ${!SSH_CMD} "sed -i '/^options {/,/^};/{ |
| 398 | + /^};/ i\\\tallow-transfer { '"$INTERNALAPI_CIDR"'; }; |
| 399 | + }' /var/lib/config-data/ansible-generated/designate/etc/named/options.conf" |
| 400 | + done |
| 401 | +---- |
| 402 | ++ |
| 403 | +where: |
| 404 | + |
| 405 | +`CONTROLLER_IP`:: |
| 406 | +Specifies the internalapi IP address of the legacy controller. This can be retrieved from `/etc/puppet/hieradata/net_ip_map.json` on each controller. |
| 407 | + |
| 408 | +`internalapi_subnet`:: |
| 409 | +Specifies the internalapi subnet in CIDR notation, for example `172.17.0.0/24`. |
| 410 | +This is a CIDR range representing the network from which RHOSO designate worker |
| 411 | +pods send requests, not individual IP addresses. |
| 412 | + |
| 413 | ++ |
| 414 | +[NOTE] |
| 415 | +==== |
| 416 | +
|
| 417 | +The `sed` commands in the shell script example are directed at default based deployments. If customizations have been made to the |
| 418 | +deployment, please either modify these commands or perform the modifications directly. |
| 419 | +
|
| 420 | +==== |
| 421 | + |
| 422 | ++ |
| 423 | +Reload the BIND9 configuration: |
| 424 | ++ |
| 425 | +---- |
| 426 | +$ systemctl restart desginate-designatebackendbind9 |
| 427 | +---- |
| 428 | ++ |
| 429 | +[NOTE] |
| 430 | +==== |
| 431 | +
|
| 432 | +Direct edits to the BIND9 configuration are appropriate because the legacy |
| 433 | +control plane ({OpenStackPreviousInstaller}) is being decommissioned and will |
| 434 | +no longer manage these files. |
| 435 | +
|
| 436 | +==== |
| 437 | + |
| 438 | +. Open the firewall on each legacy controller to allow RNDC and DNS traffic from the {rhos_long} pods: |
| 439 | ++ |
| 440 | +[subs="+quotes"] |
| 441 | +---- |
| 442 | +$ firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="<internalapi_subnet>" port port="953" protocol="tcp" accept' |
| 443 | +$ firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="<internalapi_subnet>" port port="53" protocol="tcp" accept' |
| 444 | +$ firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source address="<internalapi_subnet>" port port="53" protocol="udp" accept' |
| 445 | +$ firewall-cmd --reload |
| 446 | +---- |
| 447 | ++ |
| 448 | +where: |
| 449 | + |
| 450 | +`<internalapi_subnet>`:: |
| 451 | +Specifies the internalapi subnet in CIDR notation, for example `172.17.0.0/24`. |
| 452 | + |
| 453 | +. Create a LoadBalancer service to expose the mDNS service on the internalapi |
| 454 | + network so that the legacy BIND9 servers can perform AXFR zone transfers: + |
| 455 | +---- |
| 456 | +$ cat << EOF_CAT > /tmp/designate-external-mdns-svc.yaml |
| 457 | +apiVersion: v1 |
| 458 | +kind: Service |
| 459 | +metadata: |
| 460 | + namespace: openstack |
| 461 | + name: designate-external-master |
| 462 | + labels: |
| 463 | + service: designate-mdns |
| 464 | + designate.openstack.org/external_master: "true" |
| 465 | + annotations: |
| 466 | + core.openstack.org/ingress_create: "false" |
| 467 | + metallb.io/ip-allocated-from-pool: internalapi |
| 468 | + metallb.universe.tf/address-pool: internalapi |
| 469 | + metallb.universe.tf/allow-shared-ip: internalapi |
| 470 | + metallb.universe.tf/loadBalancerIPs: 172.17.0.80 |
| 471 | + designate.openstack.org/external_pool: default |
| 472 | +spec: |
| 473 | + selector: |
| 474 | + service: designate-mdns |
| 475 | + ports: |
| 476 | + - name: dns-tcp |
| 477 | + port: 5354 |
| 478 | + protocol: TCP |
| 479 | + targetPort: 5354 |
| 480 | + - name: dns |
| 481 | + port: 5354 |
| 482 | + protocol: UDP |
| 483 | + targetPort: 5354 |
| 484 | + ipFamilies: |
| 485 | + - IPv4 |
| 486 | + ipFamilyPolicy: SingleStack |
| 487 | + externalTrafficPolicy: Cluster |
| 488 | + internalTrafficPolicy: Cluster |
| 489 | + type: LoadBalancer |
| 490 | +EOF_CAT |
| 491 | +$ oc apply -f /tmp/designate-external-mdns-svc.yaml |
| 492 | +---- |
| 493 | + |
| 494 | +. Patch the {dns_service} CR to reference the external binds secret: |
| 495 | ++ |
| 496 | +---- |
| 497 | +$ oc patch openstackcontrolplane openstack --type=merge --patch ' |
| 498 | +spec: |
| 499 | + designate: |
| 500 | + template: |
| 501 | + externalBindsSecret: designate-external-binds |
| 502 | +' |
| 503 | +---- |
| 504 | + |
| 505 | +. Wait for the {dns_service} to reconcile: |
| 506 | ++ |
| 507 | +---- |
| 508 | +$ oc wait --for condition=Ready --timeout=300s designate.designate.openstack.org/designate |
| 509 | +---- |
| 510 | + |
| 511 | +. Verify that the external BIND9 targets are included in the pool configuration: |
| 512 | ++ |
| 513 | +---- |
| 514 | +$ oc get configmap designate-pools-yaml-config-map -o jsonpath='{.data.pools\.yaml}' | grep -A5 'external-bind9' |
| 515 | +---- |
| 516 | ++ |
| 517 | +The output should list the external BIND9 servers you configured in the external binds secret. |
| 518 | + |
| 519 | +. Verify RNDC connectivity from the designate worker pods to the legacy BIND9 servers: |
| 520 | ++ |
| 521 | +[subs="+quotes"] |
| 522 | +---- |
| 523 | +$ oc exec -it $(oc get pods -l service=designate-worker -o name | head -1) -- \ |
| 524 | + rndc -s <controller_internalapi_ip> -k /etc/designate/rndc-keys/default-rndc-0 status |
| 525 | +---- |
| 526 | ++ |
| 527 | +where: |
| 528 | + |
| 529 | +`<controller_internalapi_ip>`:: |
| 530 | +Specifies the internalapi IP address of a legacy BIND9 server. |
| 531 | ++ |
| 532 | +A successful response indicates that the designate worker can manage the external BIND9 server. |
| 533 | + |
| 534 | +[id="completing-the-bind9-migration_{context}"] |
| 535 | +== Completing the BIND9 migration |
| 536 | + |
| 537 | +After external DNS registries and delegations have been updated to reference |
| 538 | +the new {rhos_long} nameservers, remove the legacy BIND9 servers from the |
| 539 | +{dns_service} pool. |
| 540 | + |
| 541 | +.Procedure |
| 542 | + |
| 543 | +. Remove the external binds secret reference from the {dns_service} CR: |
| 544 | ++ |
| 545 | +---- |
| 546 | +$ oc patch openstackcontrolplane openstack --type=json --patch ' |
| 547 | +[{"op": "remove", "path": "/spec/designate/template/externalBindsSecret"}] |
| 548 | +' |
| 549 | +---- |
| 550 | + |
| 551 | +. Wait for the {dns_service} to reconcile: |
| 552 | ++ |
| 553 | +---- |
| 554 | +$ oc wait --for condition=Ready --timeout=300s designate.designate.openstack.org/designate |
| 555 | +---- |
| 556 | + |
| 557 | +. Delete the external binds secret: |
| 558 | ++ |
| 559 | +---- |
| 560 | +$ oc delete secret designate-external-binds -n openstack |
| 561 | +---- |
| 562 | + |
| 563 | +. Delete the mDNS LoadBalancer service: |
| 564 | ++ |
| 565 | +---- |
| 566 | +$ oc delete service designate-external-master -n openstack |
| 567 | +---- |
0 commit comments