Step: baremetalds-assisted-operator-ztp-before-upgrade

Using Assisted installer running on an OCP hub cluster, install a spoke OCP cluster.

Container image used for this step: assisted-service-scripts

assisted-service-scripts resolves to an image built or imported by the ci-operator configuration (documentation).

Environment

In addition to the default environment, the step exposes the following:

Variable Name Type Variable Content
ASSISTED_STOP_AFTER_AGENT_DISCOVERY Parameter[?] Determines if a full cluster deployment is needed. Before upgrading the operator, the value of this variable is "false", which preserves the existing behavior and completes cluster installation. After upgrading the operator, the value of this variable is true. When set to "true", cluster installation will stop after agents are discovered. (default: false)

Source Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/bin/bash

set -o nounset
set -o errexit
set -o pipefail

echo "************ baremetalds assisted operator ztp before upgrade command ************"

# Fetch packet basic configuration
# shellcheck source=/dev/null
source "${SHARED_DIR}/packet-conf.sh"

# # ZTP scripts have a lot of default values for the spoke cluster configuration. Adding this so that they can be changed.
# if [[ -n "${ASSISTED_ZTP_CONFIG:-}" ]]; then
#   readarray -t config <<< "${ASSISTED_ZTP_CONFIG}"
#   for var in "${config[@]}"; do
#     if [[ ! -z "${var}" ]]; then
#       echo "export ${var}" >> "${SHARED_DIR}/assisted-ztp-config"
#     fi
#   done
# fi

# # Copy configuration for ZTP vars if present
# if [[ -e "${SHARED_DIR}/assisted-ztp-config" ]]
# then
#   scp "${SSHOPTS[@]}" "${SHARED_DIR}/assisted-ztp-config" "root@${IP}:assisted-ztp-config"
# fi

tar -czf - . | ssh "${SSHOPTS[@]}" "root@${IP}" "cat > /root/assisted-service.tar.gz"

# shellcheck disable=SC2087
ssh "${SSHOPTS[@]}" "root@${IP}" bash - << EOF |& sed -e 's/.*auths\{0,1\}".*/*** PULL_SECRET ***/g'

set -xeo pipefail

cd /root/dev-scripts
source common.sh
source utils.sh
source network.sh

REPO_DIR="/home/assisted-service"
if [ ! -d "\${REPO_DIR}" ]; then
  mkdir -p "\${REPO_DIR}"

  echo "### Untar assisted-service code..."
  tar -xzvf /root/assisted-service.tar.gz -C "\${REPO_DIR}"
fi

cd "\${REPO_DIR}/deploy/operator/"

echo "### Deploying spoke cluster..."

export EXTRA_BAREMETALHOSTS_FILE="/root/dev-scripts/\${EXTRA_BAREMETALHOSTS_FILE}"
export ASSISTED_STOP_AFTER_AGENT_DISCOVERY="${ASSISTED_STOP_AFTER_AGENT_DISCOVERY}"

source /root/config

# # Inject job configuration for ZTP, if available
# if [[ -e /root/assisted-ztp-config ]]
# then
#   source /root/assisted-ztp-config
# fi

source upgrade/before_upgrade.sh

# TODO(ppinjark): Fix common.sh file to use override variables
export ASSISTED_OPENSHIFT_VERSION="openshift-v4.8.10"

./ztp/deploy_spoke_cluster.sh

EOF

Properties

Property Value Description
Step timeout[?] 1h30m0s Limits the execution time of the step.
Termination grace period[?] 5m0s Period of time until SIGKILL signal is sent to the test pod (after SIGTERM signal is sent).
Resource requests (cpu) 1000m Used in .resources.requests of the pod running this step.
Resource requests (memory) 500Mi Used in .resources.requests of the pod running this step.

GitHub Link:

https://github.com/openshift/release/blob/master/ci-operator/step-registry/baremetalds/assisted/operator/ztp/before-upgrade/baremetalds-assisted-operator-ztp-before-upgrade-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub