Step: baremetalds-assisted-operator-ztp-after-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_UPGRADE_OPERATOR_OVERRIDE Parameter[?] (default: false)
ASSISTED_STOP_AFTER_AGENT_DISCOVERY_OVERRIDE Parameter[?] (default: true)
ASSISTED_CLUSTER_NAME Parameter[?] (default: assisted-test-cluster-upgraded)
ASSISTED_CLUSTER_DEPLOYMENT_NAME Parameter[?] (default: assisted-test-cluster-upgraded)
ASSISTED_INFRAENV_NAME Parameter[?] (default: assisted-infra-env-upgraded)
ASSISTED_AGENT_CLUSTER_INSTALL_NAME Parameter[?] (default: assisted-agent-cluster-install-upgraded)

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
72
73
74
75
76
77
78
79
#!/bin/bash

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

echo "************ baremetalds assisted operator ztp 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}"

source /root/config

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

# TODO(ppinjark): Fix after_upgrade.sh file to use override variables
# source upgrade/after_upgrade.sh

export ASSISTED_UPGRADE_OPERATOR="${ASSISTED_UPGRADE_OPERATOR_OVERRIDE}"
export ASSISTED_STOP_AFTER_AGENT_DISCOVERY="${ASSISTED_STOP_AFTER_AGENT_DISCOVERY_OVERRIDE}"
export ASSISTED_CLUSTER_NAME="${ASSISTED_CLUSTER_NAME}"
export ASSISTED_CLUSTER_DEPLOYMENT_NAME="${ASSISTED_CLUSTER_DEPLOYMENT_NAME}"
export ASSISTED_AGENT_CLUSTER_INSTALL_NAME="${ASSISTED_AGENT_CLUSTER_INSTALL_NAME}"
export ASSISTED_INFRAENV_NAME="${ASSISTED_INFRAENV_NAME}"

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

./ztp/deploy_spoke_cluster.sh

EOF

Properties

Property Value Description
Step timeout[?] 1h0m0s 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/after-upgrade/baremetalds-assisted-operator-ztp-after-upgrade-ref.yaml

Owners:

Approvers:

Source code for this page located on GitHub