Skip to content

Commit

Permalink
specify correct hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
karmab committed Oct 14, 2024
1 parent a211bb9 commit 4f1f4f5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 3 additions & 1 deletion agent-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
{% endfor %}
{% endif %}
{% set hosts = baremetal_ctlplanes + virtual_ctlplanes_nodes + baremetal_workers + virtual_workers_nodes %}
{% set total_ctlplanes = (baremetal_ctlplanes + virtual_ctlplanes_nodes)|length %}

apiVersion: v1alpha1
kind: AgentConfig
Expand All @@ -30,7 +31,8 @@ metadata:
rendezvousIP: {{ rendezvous_ip or static_ips[0] }}
hosts:
{% for host in hosts %}
- hostname: {{ host['name']|default(cluster + "-" + loop.index0|string) }}.{{ domain }}
{% set role = 'ctlplane' if loop.index0 < total_ctlplanes else 'worker' %}
- hostname: {{ host['name']|default("%s-%s-%s" % (cluster, role, loop.index0|string)) }}.{{ domain }}
{% if 'disk' in host %}
rootDeviceHints:
deviceName: "/dev/{{ host['disk'] | basename }}"
Expand Down
11 changes: 7 additions & 4 deletions install-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
{% endfor %}
{% endif %}
{% set hosts = baremetal_ctlplanes + virtual_ctlplanes_nodes + baremetal_workers + virtual_workers_nodes %}
{% set total_ctlplanes = (baremetal_ctlplanes + virtual_ctlplanes_nodes)|length %}
{% set total_workers = (baremetal_workers + virtual_workers_nodes)|length %}

apiVersion: v1
{% if cpu_partitioning %}
Expand All @@ -34,12 +36,12 @@ compute:
- architecture: amd64
hyperthreading: Enabled
name: worker
replicas: {{ (baremetal_workers + virtual_workers_nodes)|length }}
replicas: {{ total_workers }}
controlPlane:
architecture: amd64
hyperthreading: Enabled
name: master
replicas: {{ (baremetal_ctlplanes + virtual_ctlplanes_nodes)|length }}
replicas: {{ total_ctlplanes }}
metadata:
name: {{ cluster }}
networking:
Expand All @@ -66,11 +68,12 @@ platform:
- {{ api_ip }}
hosts:
{% for host in hosts %}
- name: {{ host['name']|default(cluster + "-" + loop.index0|string) }}
{% set role = 'ctlplane' if loop.index0 < total_ctlplanes else 'worker' %}
- name: {{ host['name']|default("%s-%s-%s" % (cluster, role, loop.index0|string)) }}
{% if 'mac' in host %}
bootMACAddress: {{ host['mac'] }}
{% endif %}
role: {{ host['role']|default('master' if loop.index0 < 3 else 'worker') }}
role: {{ 'master' if role == 'ctlplane' else 'worker' }}
{% endfor %}
ingressVips:
- {{ ingress_ip }}
Expand Down

0 comments on commit 4f1f4f5

Please sign in to comment.