Skip to content

Commit c2b00a8

Browse files
Merge pull request openshift#7061 from zaneb/rendezvous-host-env
AGENT-555: Move Rendezvous Host config to separate file
2 parents dee2eea + 4107e2b commit c2b00a8

16 files changed

+63
-72
lines changed
Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1 @@
1-
# If NODE_ZERO_IP is changed, additional files need to be updated
2-
# before starting up the agent-based installer services:
3-
#
4-
# In /usr/local/share/assisted-service/assisted-service.env,
5-
# IMAGE_SERVICE_BASE_URL and SERVICE_BASE_URL must be updated.
6-
#
7-
# In /usr/local/share/assisted-service/images.env,
8-
# ASSISTED_SERVICE_HOST must be updated.
9-
#
10-
NODE_ZERO_IP={{.NodeZeroIP}}
11-
LD_LIBRARY_PATH=/usr/local/bin/
121
RELEASE_IMAGE={{.ReleaseImage}}
13-
AGENT_TUI_LOG_PATH=/var/log/agent/agent-tui.log

data/data/agent/files/usr/local/bin/common.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

data/data/agent/files/usr/local/bin/set-node-zero.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,19 @@
33
set -e
44

55
# shellcheck disable=SC1091
6-
source common.sh
6+
source /etc/assisted/rendezvous-host.env
77
echo "NODE_ZERO_IP: $NODE_ZERO_IP"
88

9+
is_node_zero() {
10+
local is_rendezvous_host
11+
is_rendezvous_host=$(ip -j address | jq "[.[].addr_info] | flatten | map(.local==\"$NODE_ZERO_IP\") | any")
12+
if [[ "${is_rendezvous_host}" == "true" ]]; then
13+
echo 1
14+
else
15+
echo 0
16+
fi
17+
}
18+
919
timeout=$((SECONDS + 30))
1020

1121
while [[ $SECONDS -lt $timeout ]]
@@ -29,7 +39,7 @@ if [ "${IS_NODE_ZERO}" = "true" ]; then
2939
cat >"${NODE0_PATH}" <<EOF
3040
# This file exists if the agent-based installer has determined the host is node 0.
3141
# The host is determined to be node 0 when one of its network interfaces has an
32-
# IP address matching NODE_ZERO_IP in /etc/assisted/agent-installer.env.
42+
# IP address matching NODE_ZERO_IP in /etc/assisted/rendezvous-host.env.
3343
# The MAC address of the network interface matching NODE_ZERO_IP is noted below
3444
# as BOOTSTRAP_HOST_MAC.
3545
#

data/data/agent/files/usr/local/bin/start-agent.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/bin/bash
22

3-
# shellcheck disable=SC1091
4-
source common.sh
5-
63
>&2 echo "Waiting for infra-env-id to be available"
74
INFRA_ENV_ID=""
85
until [[ $INFRA_ENV_ID != "" && $INFRA_ENV_ID != "null" ]]; do

data/data/agent/files/usr/local/bin/start-cluster-installation.sh.template

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#!/bin/bash
22
set -e
33

4-
source common.sh
54
source issue_status.sh
65

7-
wait_for_assisted_service
8-
96
BASE_URL="${SERVICE_BASE_URL}api/assisted-install/v2"
107

118
cluster_id=""
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/bin/bash
22
set -e
33

4-
# shellcheck disable=SC1091
5-
source common.sh
6-
7-
wait_for_assisted_service
4+
echo "Waiting for assisted-service to be ready"
5+
until curl --output /dev/null --silent --fail "${SERVICE_BASE_URL}/api/assisted-install/v2/infra-envs"; do
6+
printf '.'
7+
sleep 5
8+
done

data/data/agent/files/usr/local/share/assisted-service/assisted-service.env.template

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ DUMMY_IGNITION=false
1010
ENABLE_SINGLE_NODE_DNSMASQ=true
1111
EPHEMERAL_INSTALLER_CLUSTER_TLS_CERTS_OVERRIDE_DIR=/opt/agent/tls
1212
HW_VALIDATOR_REQUIREMENTS=[{"version":"default","master":{"cpu_cores":4,"ram_mib":16384,"disk_size_gb":100,"installation_disk_speed_threshold_ms":10,"network_latency_threshold_ms":100,"packet_loss_percentage":0},"worker":{"cpu_cores":2,"ram_mib":8192,"disk_size_gb":100,"installation_disk_speed_threshold_ms":10,"network_latency_threshold_ms":1000,"packet_loss_percentage":10},"sno":{"cpu_cores":8,"ram_mib":16384,"disk_size_gb":100,"installation_disk_speed_threshold_ms":10}}]
13-
IMAGE_SERVICE_BASE_URL=http://{{.NodeZeroIP}}:8888
1413
INSTALL_INVOKER=agent-installer
1514
IPV6_SUPPORT=true
1615
NTP_DEFAULT_SERVER=
1716
PUBLIC_CONTAINER_REGISTRIES={{.PublicContainerRegistries}}
1817
RELEASE_IMAGES={{.ReleaseImages}}
1918
OPENSHIFT_INSTALL_RELEASE_IMAGE_MIRROR={{.ReleaseImageMirror}}
20-
SERVICE_BASE_URL={{.ServiceBaseURL}}
2119
STORAGE=filesystem
2220
INFRA_ENV_ID={{.InfraEnvID}}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ASSISTED_SERVICE_HOST={{.AssistedServiceHost}}
1+
ASSISTED_SERVICE_HOST=localhost:8090
22
ASSISTED_SERVICE_SCHEME={{.ServiceProtocol}}
33
OS_IMAGES=[{"openshift_version":"{{.OSImage.OpenshiftVersion}}","cpu_architecture":"{{.OSImage.CPUArchitecture}}","url":"{{.OSImage.URL}}","version":"{{.OSImage.Version}}"}]

data/data/agent/systemd/units/agent-interactive-console.service

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Type=oneshot
1010
RemainAfterExit=true
1111
TTYPath=/dev/tty15
1212
EnvironmentFile=/etc/assisted/agent-installer.env
13+
Environment=LD_LIBRARY_PATH=/usr/local/bin/
14+
Environment=AGENT_TUI_LOG_PATH=/var/log/agent/agent-tui.log
1315
ExecStartPre=/usr/bin/kill -s SIGRTMIN+21 1
1416
ExecStartPre=/usr/bin/chvt 15
1517
ExecStartPre=mkdir -p /var/log/agent

data/data/agent/systemd/units/agent.service.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Restart=always
44
RestartSec=3
55
StartLimitInterval=0
66
TimeoutStartSec=3000
7+
EnvironmentFile=/etc/assisted/rendezvous-host.env
78
ExecStartPre=/usr/local/bin/extract-agent.sh
89
ExecStart=/usr/local/bin/start-agent.sh
910

0 commit comments

Comments
 (0)