Skip to content

Commit f1a9c0e

Browse files
committed
relocatable only requires RoutingViaHost for OCP 4.12
1 parent 2c1bce8 commit f1a9c0e

File tree

4 files changed

+21
-12
lines changed

4 files changed

+21
-12
lines changed

edge/docs/RELOCATABLE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This feature requires OpenShift 4.12 or higher.
44
When the ```relocatable``` option is enabled, the cluster is configured in such a way that its primary interface IP addresses can be changed without impacting the operation of the cluster.
55

66
## How it works
7-
You set the value of ```relocatable.interface``` to the name of the external facing interface. A secondary static IP address is assigned to this interface. The machineNetwork CIDR is also set to a static internal subnet. Finally, a MachineConfig is created that modifies /etc/default/nodeip-configuration to tell the cluster to use the static IP as the node IP. 'routingViaHost' is also enabled.
7+
You set the value of ```relocatable.interface``` to the name of the external facing interface. A secondary static IP address is assigned to this interface. The machineNetwork CIDR is also set to a static internal subnet. Finally, a MachineConfig is created that modifies /etc/default/nodeip-configuration to tell the cluster to use the static IP as the node IP. 'routingViaHost' is also enabled for OCP 4.12.
88

99
All of these actions together cause the server to use the static IP for everything related to OpenShift, while still allowing access to the cluster from outside via the primary interface IP address. This means that the external IP can be changed, and the cluster will continue to use the static IP internally for its operation.
1010

edge/roles/edge_install/tasks/install.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,6 @@
1313
register: k8s_result
1414
until: k8s_result is not failed
1515

16-
- name: Configure routingViaHost
17-
when: (edgeCluster.routingViaHost is defined and edgeCluster.routingViaHost) or (edgeCluster.relocatable is defined)
18-
kubernetes.core.k8s:
19-
template: RoutingViaHost.yaml.j2
20-
apply: true
21-
state: present
22-
register: k8s_result
23-
until: k8s_result is not failed
24-
2516
- name: Disable CRI-O wipe
2617
when:
2718
- edgeCluster.clearRegistryConfig is defined
@@ -111,6 +102,23 @@
111102
register: k8s_result
112103
until: k8s_result is not failed
113104

105+
- name: Get Cluster Version
106+
kubernetes.core.k8s_info:
107+
api_version: hive.openshift.io/v1
108+
kind: ClusterDeployment
109+
name: "{{ metadata.name }}"
110+
namespace: "{{ metadata.name }}"
111+
register: cluster_deployment
112+
until: cluster_deployment.resources[0].status.installVersion is defined
113+
114+
- name: Configure routingViaHost
115+
kubernetes.core.k8s:
116+
template: RoutingViaHost.yaml.j2
117+
apply: true
118+
state: present
119+
register: k8s_result
120+
until: k8s_result is not failed
121+
114122
- name: Setup InfraEnv and BMH
115123
ansible.builtin.include_tasks: setup_bmh.yaml
116124

edge/roles/edge_install/templates/AgentClusterInstall.yaml.j2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,7 @@ spec:
2424
{% if edgeCluster.reservedCpuSet is defined %}
2525
- name: "workload-partitioning"
2626
{% endif %}
27-
{% if (edgeCluster.routingViaHost is defined and edgeCluster.routingViaHost) or (edgeCluster.relocatable is defined) %}
2827
- name: "routing-via-host"
29-
{% endif %}
3028
{% if edgeCluster.clearRegistryConfig is defined and edgeCluster.clearRegistryConfig %}
3129
- name: "crio-wipe"
3230
{% endif %}

edge/roles/edge_install/templates/RoutingViaHost.yaml.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ metadata:
44
name: "routing-via-host"
55
namespace: "{{ metadata.name }}"
66
data:
7+
{% if (edgeCluster.routingViaHost is defined and edgeCluster.routingViaHost) or
8+
(edgeCluster.relocatable is defined and cluster_deployment.resources[0].status.installVersion is ansible.builtin.version("4.13.0", "lt")) %}
79
routing_via_host.yaml: |
810
apiVersion: operator.openshift.io/v1
911
kind: Network
@@ -14,3 +16,4 @@ data:
1416
ovnKubernetesConfig:
1517
gatewayConfig:
1618
routingViaHost: true
19+
{% endif %}

0 commit comments

Comments
 (0)