Skip to content

Commit

Permalink
remove baremetal_macs use
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Oct 12, 2024
1 parent 546b454 commit 1d5a914
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 33 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ Note that you can use the baseplan `kcli_plan_infra.yml` to deploy the infrastru
|apps |[] |
|apps_install_cr |False |
|baremetal_cidr |None |
|baremetal_macs |[] |
|baseplan |kcli_plan_infra.yml |
|bmc_password |calvin |
|bmc_reset |False |
Expand Down
4 changes: 2 additions & 2 deletions agent-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ apiVersion: v1alpha1
kind: AgentConfig
metadata:
name: {{ cluster }}
rendezvousIP: {{ rendezvous_ip|default(static_ips[0]) }}
rendezvousIP: {{ rendezvous_ip or static_ips[0] }}
hosts:
{% for host in hosts %}
- hostname: {{ host['name']|default(cluster + "-" + loop.index0|string) }}.{{ domain }}
Expand All @@ -48,7 +48,7 @@ hosts:
deviceName: "/dev/{{ default_disk|basename }}"
{% endif %}
interfaces:
- macAddress: {{ host['mac']|default(baremetal_macs[loop.index]) }}
- macAddress: {{ host['mac']|default("%s:%0.2d" % (virtual_mac_prefix, loop.index)) }}
name: {{ host['nic']|default('ens3') }}
{% if 'ip' in host %}
networkConfig:
Expand Down
2 changes: 1 addition & 1 deletion envfiles/bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export PATH=/usr/local/bin:/root/bin:$PATH
export REGISTRY_PASSWORD={{ disconnected_password }}
export REGISTRY_USER={{ disconnected_user }}
export PYTHONUNBUFFERED=true
export AI_URL={{ rendezvous_ip|default(static_ips[0])|ipv6_wrap }}:8090
export AI_URL={{ (rendezvous_ip or static_ips[0])|ipv6_wrap }}:8090
5 changes: 0 additions & 5 deletions kcli_pre.sh
Original file line number Diff line number Diff line change
Expand Up @@ -218,11 +218,6 @@ exit 1
{% endif %}
{% endfor %}

{% if baremetal_macs|length + baremetal_nodes_macs|length < total_hub_nodes_number + total_spoke_nodes_number.value %}
echo You need to populate baremetal_macs with the complete list of mac addresses including your spokes or put that info in baremetal_nodes arrays
exit 1
{% endif %}

{% if prega %}
if [ "$(grep quay.io/prega {{ pull_secret }})" == "" ] ; then
echo prega requires a valid pull secret entry
Expand Down
5 changes: 0 additions & 5 deletions paramfiles/lab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,6 @@ static_ips:
- 192.168.130.21
- 192.168.130.22
- 192.168.130.23
baremetal_macs:
- aa:aa:aa:aa:bb:01
- aa:aa:aa:aa:bb:02
- aa:aa:aa:aa:bb:03
- aa:aa:aa:aa:bb:04

disconnected: true
spoke_wait: true
Expand Down
5 changes: 0 additions & 5 deletions paramfiles/lab_ipv6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ static_ips:
- 2620:52:0:1302::21
- 2620:52:0:1302::22
- 2620:52:0:1302::23
baremetal_macs:
- aa:aa:aa:aa:bb:01
- aa:aa:aa:aa:bb:02
- aa:aa:aa:aa:bb:03
- aa:aa:aa:aa:bb:04

spokes:
- name: mgmt-spoke1
Expand Down
5 changes: 1 addition & 4 deletions plans/kcli_plan_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ info: |
default network type is OVNKubernetes but you can also specify OpenShiftSDN
You can also use ca and imagecontentsources to customize your environments or drop specific manifests in the manifests directory
If using virtual ctlplanes, the ctlplanes array can be omitted.
For virtual ctlplanes, You can
- force the baremetal macs of your ctlplanes using baremetal_macs variable. If you put more entries than your ctlplanes number, they will be used for virtual workers.
- set a pattern for their provisioning macs when you plan to host several cluster with virtual ctlplanes on the same hypervisor
For virtual hub, You can force the mac of your ctlplanes and workers
version can be set to stable, nightly, dev-preview or ci , along with tag, to gather the binary from public sources.
The ci registry is targetted with the openshift_image variable.
To skip the hub installation, KUBECONFIG variable can be pointed to an existing kubeconfig file
Expand Down Expand Up @@ -40,7 +38,6 @@ bmc_user: root
bmc_password: calvin
bmc_reset: false
baremetal_cidr:
baremetal_macs: []
static_ips: []
pull_secret: openshift_pull.json
notifyscript: scripts/notify.sh
Expand Down
6 changes: 3 additions & 3 deletions plans/kcli_plan_infra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
memory: {{ ctlplane_memory or memory }}
nets:
- name: {{ baremetal_net }}
mac: {{ baremetal_macs[num] }}
mac: {{ "%s:%0.2d" % (virtual_mac_prefix, num + 1) }}
disks: {{ virtual_disks }}
{% endfor %}
{% endif %}
Expand All @@ -46,7 +46,7 @@
memory: {{ worker_memory or memory }}
nets:
- name: {{ baremetal_net }}
mac: {{ baremetal_macs[ctlplanes + num] }}
mac: {{ "%s:%0.2d" % (virtual_mac_prefix, ctlplanes + num + 1) }}
disks: {{ virtual_disks }}
{% endfor %}
{% endif %}
Expand Down Expand Up @@ -80,7 +80,7 @@
memory: {{ spoke_memory }}
nets:
- name: {{ baremetal_net }}
mac: {{ baremetal_macs[ctlplanes + workers + total_number.value + num] }}
mac: {{ "%s:%0.2d" % (virtual_mac_prefix, ctlplanes + workers + total_number.value + num + 1) }}
disks:
- size: {{ spoke_disk_size }}
interface: {{ spoke_disk_interface }}
Expand Down
2 changes: 1 addition & 1 deletion plans/kcli_plan_infra_default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ disk_interface: scsi
extra_disks: []
baremetal_net: baremetal
baremetal_cidr:
baremetal_macs: []
virtual_mac_prefix: aa:aa:aa:aa:bb
static_ips: []
baremetal_ctlplanes: []
baremetal_workers: []
Expand Down
4 changes: 0 additions & 4 deletions samples/parameters_virtual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,3 @@ bmc_password: mcfly
baremetal_cidr: 11.0.0.0/24
api_ip: 11.0.0.2
ingress_ip: 11.0.0.4
baremetal_macs:
- aa:bb:cc:dd:ab:01
- aa:bb:cc:dd:ab:02
- aa:bb:cc:dd:ab:03
2 changes: 1 addition & 1 deletion scripts/07_deploy_hub.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ kcli start baremetal-host -P url={{ url }} -P user={{ user }} -P password={{ pas
{% endfor %}

{% if hosts|length == 1 %}
SNO_IP={{ rendezvous_ip|default(static_ips[0]) }}
SNO_IP={{ rendezvous_ip or static_ips[0] }}
sed -i /api.{{ cluster }}.{{ domain }}/d /etc/hosts
echo $SNO_IP api.{{ cluster }}.{{ domain }} >> /etc/hosts
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion ztp/scripts/siteconfig.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ spec:
{% if 'mac' in node %}
{% set mac = node['mac'] %}
{% else %}
{% set mac = baremetal_macs[ctlplanes + workers + total_number.value + num] %}
{% set mac = "%s:%0.2d" % (virtual_mac_prefix, ctlplanes + workers + total_number.value + num + 1) %}
{% endif %}
- hostName: {{ cluster }}-{{ spoke_name }}-node-{{ num }}
role: {{ "master" if num < max_ctlplanes else "worker" }}
Expand Down

0 comments on commit 1d5a914

Please sign in to comment.