Skip to content

Commit

Permalink
WIP - Remove public_vlan vars from SNO deployments, closes redhat-per…
Browse files Browse the repository at this point in the history
  • Loading branch information
akrzos committed May 7, 2024
1 parent 226d86e commit 547f4ba
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 73 deletions.
3 changes: 0 additions & 3 deletions ansible/roles/bastion-coredns/templates/resolv.conf.j2
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Deployed by Jetlag automation
search {{ base_dns_name }}
{% if public_vlan | default(false) %}
nameserver {{ ansible_default_ipv4.address }}
{% endif %}
nameserver {{ bastion_controlplane_ip }}
{% if lab in rh_labs %}
{% for dns in labs[lab]['dns'] %}
Expand Down
3 changes: 0 additions & 3 deletions ansible/roles/bastion-dnsmasq/templates/resolv.conf.j2
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Deployed by Jetlag automation
search {{ base_dns_name }}
{% if public_vlan | default(false) %}
nameserver {{ ansible_default_ipv4.address }}
{% endif %}
nameserver {{ bastion_controlplane_ip }}
{% if lab in rh_labs %}
{% for dns in labs[lab]['dns'] %}
Expand Down
10 changes: 2 additions & 8 deletions ansible/roles/create-inventory/templates/inventory-sno.j2
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ bmc_password={{ bmc_password }}
{% for sno in ocpinventory_sno_nodes %}
{%- if use_bastion_registry -%}
{%- set ip_address=controlplane_network | ansible.utils.nthhost(loop.index0 + 5) -%}
{%- elif public_vlan | bool -%}
{%- set ip_address=controlplane_pub_network_cidr | ansible.utils.nthhost(loop.index0 + 1) -%}
{%- else -%}
{%- set ip_address=(sno_foreman_data.results|selectattr('json.name', 'eq', sno.pm_addr | replace('mgmt-',''))|first).json.ip -%}
{%- endif -%}
Expand All @@ -43,15 +41,11 @@ bmc_password={{ bmc_password }}
[sno:vars]
bmc_user={{ bmc_user }}
bmc_password={{ bmc_password }}
{% if public_vlan or use_bastion_registry %}
{% if use_bastion_registry %}
lab_interface={{ controlplane_lab_interface }}
network_interface={{ controlplane_network_interface }}
gateway={{ controlplane_network_gateway }}
{% endif %}
{% if public_vlan %}
network_prefix={{ controlplane_pub_network_cidr | ipaddr('prefix') }}
{% elif use_bastion_registry %}
network_prefix={{ controlplane_network | ipaddr('prefix') }}
gateway={{ controlplane_network_gateway }}
{% endif %}
{% if controlplane_bastion_as_dns %}
dns1={{ bastion_controlplane_ip }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
with_items:
- file_name: 50-controlplane-disable-lab-dhcp-interface.yaml
template_name: "50-controlplane-disable-lab-dhcp-interface.yml.j2"
enabled: "{{ public_vlan | bool }}"
- file_name: kubeletconfig-max-pods.yml
template_name: kubeletconfig-max-pods.yml
enabled: "{{ kubelet_config }}"
Expand All @@ -25,7 +24,7 @@
- include_role:
name: create-ai-cluster
tasks_from: 01_manifest_update.yml
when: openshift_version is version('4.13', "<=")
when: openshift_version is version('4.13', "<=")
with_items:
- file_name: 99-master-workload-partitioning.yml
template_name: 99-master-workload-partitioning.yml
Expand Down Expand Up @@ -55,7 +54,7 @@
- include_role:
name: create-ai-cluster
tasks_from: 01_manifest_update.yml
when: openshift_version is version('4.13', ">=")
when: openshift_version is version('4.13', ">=")
with_items:
- file_name: enable-crun-master.yaml
template_name: enable-crun-master.yaml
Expand Down
9 changes: 0 additions & 9 deletions ansible/roles/sno-create-ai-cluster/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@
# - debug:
# msg: "{{ ai_cluster_ids }}"

- name: set machine network cidr for public vlan
set_fact:
machine_network_cidr: "{{ controlplane_pub_network_cidr }}"
when:
- public_vlan | bool

- name: set machine network cidr when using bastion registry
set_fact:
machine_network_cidr: "{{ controlplane_network | ipaddr('network/prefix') }}"
Expand Down Expand Up @@ -70,9 +64,6 @@
{% for route in etc_hosts_ingress_routes %}
{{ hostvars[item].ip_address }} {{ route }}.apps.{{ hostvars[item].inventory_hostname }}.{{ base_dns_name }}
{% endfor %}
{% if public_vlan %}
{{ hostvars[item].ip_address }} {{ hostvars[item].inventory_hostname }} # SNO node
{%- endif %}
insertafter: "EOF"
marker: "# {mark} {{ hostvars[item].inventory_hostname }} OCP CLUSTER MANAGED BLOCK"
loop: "{{ groups['sno'][:sno_node_count|int] }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ interfaces:
- name: {{ hostvars[item]['network_interface'] }}
type: ethernet
state: up
mtu: {{ 9000 if jumbo_mtu is defined and jumbo_mtu else 1500 }}
{% if bastion_controlplane_ip | ansible.utils.ipv4 %}
ipv4:
{% else %}
Expand Down
11 changes: 0 additions & 11 deletions ansible/vars/all.sample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@ worker_node_count:
# Applies to sno clusters
sno_node_count:

# Lab Network type, applies to sno cluster_type only
# Set this variable if you want to host your SNO cluster on lab public routable
# VLAN network, set this ONLY if you have public routable VLAN enabled in your
# scalelab cloud
public_vlan: false

# Versions are controlled by this release image. If you want to change images
# you must stop and rm all assisted-installer containers on the bastion and rerun
# the setup-bastion step in order to setup your bastion's assisted-installer to
Expand Down Expand Up @@ -72,11 +66,6 @@ use_bastion_registry: false
# Network configuration for all bm cluster and rwn control-plane nodes
controlplane_lab_interface: eno1np0

# Network configuration for public VLAN based sno cluster_type deployment
controlplane_pub_network_cidr:
controlplane_pub_network_gateway:
jumbo_mtu: false

# Network only for remote worker nodes
# Note: these cannot be commented out or bm-deploy will fail
# You will need to knowledge of actual interface names.
Expand Down
11 changes: 0 additions & 11 deletions docs/bastion-deploy-bm-byol.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,6 @@ worker_node_count: 2
# Applies to sno clusters
sno_node_count: 0
# Lab Network type, applies to sno cluster_type only
# Set this variable if you want to host your SNO cluster on lab public routable
# VLAN network, set this ONLY if you have public routable VLAN enabled in your
# scalelab cloud
public_vlan: false
# Versions are controlled by this release image. If you want to change images
# you must stop and rm all assisted-installer containers on the bastion and rerun
# the setup-bastion step in order to setup your bastion's assisted-installer to
Expand Down Expand Up @@ -246,11 +240,6 @@ use_bastion_registry: false
# Network configuration for all bm cluster and rwn control-plane nodes
controlplane_lab_interface: eno8303
# Network configuration for public VLAN based sno cluster_type deployment
controlplane_pub_network_cidr:
controlplane_pub_network_gateway:
jumbo_mtu: false
# Network only for remote worker nodes
# Note: these cannot be commented out or bm-deploy will fail
# You will need to knowledge of actual interface names.
Expand Down
15 changes: 2 additions & 13 deletions docs/bastion-deploy-bm.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ controlplane_lab_interface: eno12399np0

### Extra vars

For bare-metal deployment of OCP 4.13 or later, it's advisable to configure the following extra variables.
For bare-metal deployment of OCP 4.13 or later, it's advisable to configure the following extra variables.
- control_plane_install_disk
- worker_install_disk

Expand Down Expand Up @@ -261,12 +261,6 @@ worker_node_count: 0
# Applies to sno clusters
sno_node_count:
# Lab Network type, applies to sno cluster_type only
# Set this variable if you want to host your SNO cluster on lab public routable
# VLAN network, set this ONLY if you have public routable VLAN enabled in your
# scalelab cloud
public_vlan: false
# Versions are controlled by this release image. If you want to change images
# you must stop and rm all assisted-installer containers on the bastion and rerun
# the setup-bastion step in order to setup your bastion's assisted-installer to
Expand Down Expand Up @@ -313,11 +307,6 @@ use_bastion_registry: false
# Network configuration for all bm cluster and rwn control-plane nodes
controlplane_lab_interface: eno12399np0
# Network configuration for public VLAN based sno cluster_type deployment
controlplane_pub_network_cidr:
controlplane_pub_network_gateway:
jumbo_mtu: false
# Network only for remote worker nodes
rwn_lab_interface: eno1np0
rwn_network_interface: ens1f1
Expand All @@ -326,7 +315,7 @@ rwn_network_interface: ens1f1
# Extra vars
################################################################################
# Append override vars below
control_plane_install_disk: /dev/disk/by-path/pci-0000:67:00.0-scsi-0:2:0:0
control_plane_install_disk: /dev/disk/by-path/pci-0000:67:00.0-scsi-0:2:0:0
worker_install_disk: /dev/disk/by-path/pci-0000:67:00.0-scsi-0:2:0:0
```

Expand Down
11 changes: 0 additions & 11 deletions docs/deploy-sno-quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,6 @@ worker_node_count:
# Applies to sno clusters
sno_node_count: 1
# Lab Network type, applies to sno cluster_type only
# Set this variable if you want to host your SNO cluster on lab public routable
# VLAN network, set this ONLY if you have public routable VLAN enabled in your
# scalelab cloud
public_vlan: false
# Versions are controlled by this release image. If you want to change images
# you must stop and rm all assisted-installer containers on the bastion and rerun
# the setup-bastion step in order to setup your bastion's assisted-installer to
Expand Down Expand Up @@ -282,11 +276,6 @@ use_bastion_registry: false
# Network configuration for all bm cluster and rwn control-plane nodes
controlplane_lab_interface: eno1
# Network configuration for public VLAN based sno cluster_type deployment
controlplane_pub_network_cidr:
controlplane_pub_network_gateway:
jumbo_mtu: false
# Network only for remote worker nodes
rwn_lab_interface: eno1np0
rwn_network_interface: ens1f1
Expand Down

0 comments on commit 547f4ba

Please sign in to comment.