|
| 1 | +:_mod-docs-content-type: PROCEDURE |
| 2 | +[id="adopting-the-dns-service_{context}"] |
| 3 | + |
| 4 | += Adopting the {dns_service} |
| 5 | + |
| 6 | +[role="_abstract"] |
| 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 | + |
| 9 | +.Procedure |
| 10 | + |
| 11 | +. Create an alias for the `openstack` command: |
| 12 | ++ |
| 13 | +---- |
| 14 | +$ alias openstack="oc exec -t openstackclient -- openstack" |
| 15 | +---- |
| 16 | + |
| 17 | +. To isolate the {dns_service} networks, add the network interfaces for the VLAN base interfaces: |
| 18 | ++ |
| 19 | +[subs="+quotes"] |
| 20 | +---- |
| 21 | +$ oc get --no-headers nncp --output=custom-columns='NAME:.metadata.name' | while read; do |
| 22 | +
|
| 23 | +interfaces=$(oc get nncp $REPLY -o jsonpath="{.spec.desiredState.interfaces[*].name}") |
| 24 | +
|
| 25 | +(echo $interfaces | grep -w -q "enp6s0.25\|enp6s0.26") || \ |
| 26 | + oc patch nncp $REPLY --type json --patch ' |
| 27 | +[{ |
| 28 | + "op": "add", |
| 29 | + "path": "/spec/desiredState/interfaces/-", |
| 30 | + "value": { |
| 31 | + "description": "Designate vlan interface", |
| 32 | + "name": "enp6s0.25", |
| 33 | + "state": "up", |
| 34 | + "type": "vlan", |
| 35 | + "vlan": { |
| 36 | + "base-iface": "<enp6s0>", |
| 37 | + "id": 25, |
| 38 | + "reorder-headers": true |
| 39 | + }, |
| 40 | + "ipv4": { |
| 41 | + "address": [{"ip": "172.28.0.5", "prefix-length": 24}], |
| 42 | + "enabled": true, |
| 43 | + "dhcp": false |
| 44 | + }, |
| 45 | + "ipv6": { |
| 46 | + "enabled": false |
| 47 | + } |
| 48 | + } |
| 49 | +}, |
| 50 | +{ |
| 51 | + "op": "add", |
| 52 | + "path": "/spec/desiredState/interfaces/-", |
| 53 | + "value": { |
| 54 | + "description": "Designate external vlan interface", |
| 55 | + "name": "enp6s0.26", |
| 56 | + "state": "up", |
| 57 | + "type": "vlan", |
| 58 | + "vlan": { |
| 59 | + "base-iface": "<enp6s0>", |
| 60 | + "id": 26, |
| 61 | + "reorder-headers": true |
| 62 | + }, |
| 63 | + "ipv4": { |
| 64 | + "address": [{"ip": "172.50.0.5", "prefix-length": 24}], |
| 65 | + "enabled": true, |
| 66 | + "dhcp": false |
| 67 | + }, |
| 68 | + "ipv6": { |
| 69 | + "enabled": false |
| 70 | + } |
| 71 | + } |
| 72 | +}]' |
| 73 | +
|
| 74 | +done |
| 75 | +---- |
| 76 | ++ |
| 77 | +where: |
| 78 | + |
| 79 | +`<enp6s0>`:: |
| 80 | +Specifies the name of the network interface in your {rhocp_long} setup. |
| 81 | + |
| 82 | +. Configure the {dns_service} internal network attachment definition: |
| 83 | ++ |
| 84 | +---- |
| 85 | +$ cat >> designate-nad.yaml << EOF_CAT |
| 86 | +apiVersion: k8s.cni.cncf.io/v1 |
| 87 | +kind: NetworkAttachmentDefinition |
| 88 | +metadata: |
| 89 | + labels: |
| 90 | + osp/net: designate |
| 91 | + name: designate |
| 92 | +spec: |
| 93 | + config: | |
| 94 | + { |
| 95 | + "cniVersion": "0.3.1", |
| 96 | + "name": "designate", |
| 97 | + "type": "macvlan", |
| 98 | + "master": "enp6s0.25", |
| 99 | + "ipam": { |
| 100 | + "type": "whereabouts", |
| 101 | + "range": "172.28.0.0/24", |
| 102 | + "range_start": "172.28.0.30", |
| 103 | + "range_end": "172.28.0.70" |
| 104 | + } |
| 105 | + } |
| 106 | +EOF_CAT |
| 107 | +---- |
| 108 | +. Apply the configuration: |
| 109 | ++ |
| 110 | +---- |
| 111 | +$ oc apply -f designate-nad.yaml |
| 112 | +---- |
| 113 | +. Configure the {dns_service} external network attachment definition: |
| 114 | ++ |
| 115 | +---- |
| 116 | +$ cat >> designateext-nad.yaml << EOF_CAT |
| 117 | +apiVersion: k8s.cni.cncf.io/v1 |
| 118 | +kind: NetworkAttachmentDefinition |
| 119 | +metadata: |
| 120 | + labels: |
| 121 | + osp/net: designateext |
| 122 | + name: designateext |
| 123 | +spec: |
| 124 | + config: | |
| 125 | + { |
| 126 | + "cniVersion": "0.3.1", |
| 127 | + "name": "designateext", |
| 128 | + "type": "macvlan", |
| 129 | + "master": "enp6s0.26", |
| 130 | + "ipam": { |
| 131 | + "type": "whereabouts", |
| 132 | + "range": "172.50.0.0/24", |
| 133 | + "range_start": "172.50.0.30", |
| 134 | + "range_end": "172.50.0.70" |
| 135 | + } |
| 136 | + } |
| 137 | +EOF_CAT |
| 138 | +---- |
| 139 | + |
| 140 | +. Apply the configuration: |
| 141 | ++ |
| 142 | +---- |
| 143 | +$ oc apply -f designateext-nad.yaml |
| 144 | +---- |
| 145 | + |
| 146 | +. Create a MetalLB IPAddressPool for the {dns_service} external network: |
| 147 | ++ |
| 148 | +---- |
| 149 | +$ oc apply -f - <<EOF |
| 150 | +apiVersion: metallb.io/v1beta1 |
| 151 | +kind: IPAddressPool |
| 152 | +metadata: |
| 153 | + name: designateext |
| 154 | + namespace: metallb-system |
| 155 | +spec: |
| 156 | + autoAssign: false |
| 157 | + addresses: |
| 158 | + - 172.50.0.80-172.50.0.90 |
| 159 | +EOF |
| 160 | +---- |
| 161 | + |
| 162 | +. Create an L2Advertisement for the {dns_service} external network: |
| 163 | ++ |
| 164 | +---- |
| 165 | +$ oc apply -f - <<EOF |
| 166 | +apiVersion: metallb.io/v1beta1 |
| 167 | +kind: L2Advertisement |
| 168 | +metadata: |
| 169 | + name: designateext |
| 170 | + namespace: metallb-system |
| 171 | +spec: |
| 172 | + ipAddressPools: |
| 173 | + - designateext |
| 174 | + interfaces: |
| 175 | + - enp6s0.26 |
| 176 | +EOF |
| 177 | +---- |
0 commit comments