Skip to content

Commit 03b01c1

Browse files
authored
Merge branch 'main' into confirmkcli
2 parents ae1f274 + aae03ac commit 03b01c1

16 files changed

Lines changed: 110 additions & 132 deletions

File tree

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
# [1.7.0](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/compare/1.6.0...1.7.0) (2022-05-28)
2+
3+
### Bug Fixes
4+
5+
- **deploy-acm:** Check correct type ([039a957](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/039a9579284524622d8aef0692f6727a5a0d4ff1))
6+
- **deploy-worker:** field grabbing was not done properly ([f86393b](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/f86393b1bff60d0811f73175147e69a798f0cc03))
7+
- **detach:** Add missing kubeconfig to the calls for check_resource ([0fa510b](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/0fa510bc26536c3fe19d033e5f9b471dec1d9747))
8+
- **render_worker:** Give some time for worker to be created after applying manifests ([fbab8f5](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/fbab8f59aa7fd9abe6909e6ee19c5670e969b508))
9+
10+
### Features
11+
12+
- Add debug.. ([921dc9d](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/921dc9d762c24e36fe3e5c6b7dfe37bf3aaae8e3))
13+
14+
# [1.6.0](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/compare/1.5.1...1.6.0) (2022-05-28)
15+
16+
### Bug Fixes
17+
18+
- Apply certificate from registry also on workers ([6223089](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/6223089117344af05ba9678e16d40a286f94e6e4))
19+
- **deploy-acm:** Check correct type ([2890ba1](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/2890ba128f98a7d154807c55cda6d1314837977c))
20+
- **deploy-worker:** field grabbing was not done properly ([9497782](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/94977825df6c6e50c84467abd5cc941383d3cfd1))
21+
- **detach:** Add missing kubeconfig to the calls for check_resource ([15351a1](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/15351a1a8eca24a212fed93520bc245c4f567ead))
22+
- **Makefile:** do not ask for confirmation for deleting vms ([9b5a62b](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/9b5a62b62404262275abfc8c2d123c0d623596e9))
23+
- **ODF:** Set back replicas to 3 because of lack of stability ([0f1b78f](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/0f1b78ff23e2b25990c93ac36e81f187ebce26ba))
24+
- **render_edgeclusters.sh:** Fix interface iteration for creating ignored entries ([6db7348](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/6db73483af229e904264f2d8bb4e9e7bcf42d1a7))
25+
- **render_worker:** Give some time for worker to be created after applying manifests ([fefbc74](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/fefbc7438c0001e0e756e263efbb888dacf1801c))
26+
27+
### Features
28+
29+
- Add debug.. ([7441d38](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/commit/7441d38bf614a250c5466d869cf0686bf8c3adf0))
30+
131
## [1.5.1](https://github.com/rh-ecosystem-edge/ztp-pipeline-relocatable/compare/1.5.0...1.5.1) (2022-05-24)
232

333
### Bug Fixes

deploy-acm/deploy.sh

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,38 +21,30 @@ if ./verify.sh; then
2121

2222
echo ">>>> Deploy manifests to install ACM ${OC_ACM_VERSION}"
2323
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
24-
oc apply -f 01-namespace.yml -o yaml --dry-run=client | oc apply -f -
24+
oc apply -f 01-namespace.yml
2525
sleep 2
2626
oc apply -f 02-operatorgroup.yml
2727
sleep 2
2828
oc apply -f 03-subscription.yml
29-
sleep 240
30-
31-
echo ">>>> Deploy ACM cr manifest"
32-
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>"
29+
sleep 40
30+
InstallPlan=$(oc --kubeconfig=${KUBECONFIG_HUB} get installplan -n open-cluster-management -o name)
31+
RESOURCE_KIND=${InstallPlan%%/*}
32+
RESOURCE_NAME=${InstallPlan##*/}
33+
check_resource "${RESOURCE_KIND}" "${RESOURCE_NAME}" "Installed" "open-cluster-management" "${KUBECONFIG_HUB}"
34+
35+
echo ">>>> Deploy RHACM cr manifest"
36+
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
3337
oc apply -f 04-acm-cr.yml
38+
# We need to give some time to ACM Operator to create the proper helmcharts
3439
sleep 60
3540

36-
echo ">>>> Wait until acm ready"
37-
echo ">>>>>>>>>>>>>>>>>>>>>>>>>"
38-
timeout=0
39-
ready=false
40-
sleep 240
41-
while [ "${timeout}" -lt "120" ]; do
42-
if [[ $(oc get pod -n open-cluster-management | grep -i running | wc -l) -eq $(oc get pod -n open-cluster-management | grep -v NAME | wc -l) ]]; then
43-
ready=true
44-
break
45-
fi
46-
sleep 5
47-
timeout=$((timeout + 1))
41+
echo ">>>> Wait until RHACM ready"
42+
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>"
43+
for helmchart in $(oc --kubeconfig=${KUBECONFIG_HUB} get helmreleases -o name); do
44+
RESOURCE_KIND=${helmchart%%/*}
45+
RESOURCE_NAME=${helmchart##*/}
46+
check_resource "${RESOURCE_KIND}" "${RESOURCE_NAME}" "Deployed" "open-cluster-management" "${KUBECONFIG_HUB}"
4847
done
49-
if [ "$ready" == "false" ]; then
50-
echo "timeout waiting for ACM pods "
51-
exit 1
52-
fi
53-
elif [[ $? -eq 50 ]]; then
54-
echo ">>>> Verify failed...Some pods are failing..." #TODO change to remove and launch again
55-
exit 50
5648
else
5749
echo ">>>> This step is not neccesary, everything looks ready"
5850
fi

deploy-disconnected-registry/deploy.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,10 @@ if [[ ${1} == 'hub' ]]; then
244244
deploy_registry 'hub'
245245
trust_internal_registry 'hub'
246246
check_resource "deployment" "${REGISTRY}" "Available" "${REGISTRY}" "${KUBECONFIG_HUB}"
247-
render_file manifests/machine-config-certs.yaml 'hub'
248247
check_mcp 'hub'
248+
render_file manifests/machine-config-certs-master.yaml 'hub'
249+
render_file manifests/machine-config-certs-worker.yaml 'hub'
250+
check_resource "mcp" "master" "Updated" "default" "${KUBECONFIG_HUB}"
249251
check_resource "deployment" "${REGISTRY}" "Available" "${REGISTRY}" "${KUBECONFIG_HUB}"
250252
else
251253
echo ">>>> This step to deploy registry on Hub is not neccesary, everything looks ready"

deploy-disconnected-registry/manifests/machine-config-certs.yaml renamed to deploy-disconnected-registry/manifests/machine-config-certs-master.yaml

File renamed without changes.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: machineconfiguration.openshift.io/v1
2+
kind: MachineConfig
3+
metadata:
4+
labels:
5+
machineconfiguration.openshift.io/role: worker
6+
name: update-localregistry-ca-certs
7+
spec:
8+
config:
9+
ignition:
10+
version: 3.1.0
11+
storage:
12+
files:
13+
- contents:
14+
source: data:text/plain;charset=us-ascii;base64,$CA_CERT_DATA
15+
filesystem: root
16+
mode: 493
17+
path: $PATH_CA_CERT

deploy-edgecluster/render_edgeclusters.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,10 @@ EOF
308308
echo ">> Checking Ignored Interfaces"
309309
echo "Edge-cluster: ${cluster}"
310310
echo "Master: ${master}"
311-
IGN_IFACES=$(yq eval ".edgeclusters[${edgeclusternumber}].${cluster}.master${master}.ignore_ifaces" ${EDGECLUSTERS_FILE})
311+
IGN_IFACES=$(yq eval ".edgeclusters[${edgeclusternumber}].[].master${master}.ignore_ifaces" ${EDGECLUSTERS_FILE})
312312
if [[ ${IGN_IFACES} != "null" ]]; then
313-
yq eval -ojson ".edgeclusters[${edgeclusternumber}].${cluster}.master${master}.ignore_ifaces" ${EDGECLUSTERS_FILE} | jq -c '.[]' | while read IFACE; do
313+
for IFACE in $(echo ${IGN_IFACES}); do
314+
314315
echo "Ignoring Interface: ${IFACE}"
315316
echo " - name: ${IFACE}" >>${OUTPUT}
316317

@@ -325,7 +326,7 @@ EOF
325326
next-hop-interface: $CHANGE_EDGE_MASTER_PUB_INT
326327
EOF
327328
if [[ ${IGN_IFACES} != "null" ]]; then
328-
yq eval -ojson ".edgeclusters[${edgeclusternumber}].${cluster}.master${master}.ignore_ifaces" ${EDGECLUSTERS_FILE} | jq -c '.[]' | while read IFACE; do
329+
for IFACE in $(echo ${IGN_IFACES}); do
329330
echo "Ignoring route for: ${IFACE}"
330331
echo " - next-hop-interface: ${IFACE}" >>${OUTPUT}
331332
echo " state: absent" >>${OUTPUT}

deploy-edgecluster/verify.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function check_aci() {
2121
break
2222
fi
2323
echo ">> Waiting for ACI"
24-
echo "Edge-cluster: ${cluster}"
24+
echo "Edgecluster: ${cluster}"
2525
echo "Current: $(oc --kubeconfig=${KUBECONFIG_HUB} get aci -n ${cluster} ${cluster} -o jsonpath='{.status.debugInfo.stateInfo}')"
2626
echo "Desired State: Cluster is Installed"
2727
echo

deploy-odf/deploy.sh

Lines changed: 10 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -m
77

88
function render_file() {
99
SOURCE_FILE=${1}
10-
if [[ $# -lt 1 ]]; then
10+
if [[ ${#} -lt 1 ]]; then
1111
echo "Usage :"
1212
echo " $0 <SOURCE FILE> <(optional) DESTINATION_FILE>"
1313
exit 1
@@ -25,10 +25,10 @@ function extract_vars() {
2525
# Extract variables from config file
2626
DISKS_PATH=${1}
2727
raw_disks=$(yq eval "${DISKS_PATH}" "${EDGECLUSTERS_FILE}" | sed s/null//)
28-
disks=$(echo ${raw_disks} | tr -d '\ ' | sed s#-#,#g | sed 's/,*//' | sed 's/,*//')
28+
disks=$(echo ${raw_disks} | tr -d '\ ' | sed 's/-/,/g' | sed 's/,*//' | sed 's/,*//')
2929
disks_count=$(echo ${disks} | sed 's/,/\n/g' | wc -l)
3030

31-
for node in $(oc --kubeconfig=${EDGE_KUBECONFIG} get nodes -o name | sed s#node\/##); do
31+
for node in $(oc --kubeconfig=${EDGE_KUBECONFIG} get nodes -o name | cut -f2 -d/); do
3232
nodes+="${node},"
3333
done
3434

@@ -102,49 +102,24 @@ if ! ./verify.sh; then
102102
oc --kubeconfig=${EDGE_KUBECONFIG} apply -f manifests/02-LSO-OperatorGroup.yaml
103103
sleep 2
104104
oc --kubeconfig=${EDGE_KUBECONFIG} apply -f manifests/03-LSO-Subscription.yaml
105-
sleep 2
105+
sleep 5
106106

107107
echo ">>>> Waiting for subscription and crd on: ${edgecluster}"
108108
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
109-
timeout=0
110-
ready=false
111-
while [ "$timeout" -lt "1000" ]; do
112-
echo KUBEEDGE=${EDGE_KUBECONFIG}
113-
if [[ $(oc --kubeconfig=${EDGE_KUBECONFIG} get crd | grep localvolumes.local.storage.openshift.io | wc -l) -eq 1 ]]; then
114-
ready=true
115-
break
116-
fi
117-
echo "Waiting for CRD localvolumes.local.storage.openshift.io to be created"
118-
sleep 5
119-
timeout=$((timeout + 5))
109+
declare -a LSOCRDS=("localvolumediscoveries.local.storage.openshift.io" "localvolumediscoveryresults.local.storage.openshift.io" "localvolumes.local.storage.openshift.io" "localvolumesets.local.storage.openshift.io")
110+
for crd in ${LSOCRDS[@]}
111+
do
112+
check_resource "crd" "${crd}" "Established" "openshift-local-storage" "${EDGE_KUBECONFIG}"
120113
done
121-
if [ "$ready" == "false" ]; then
122-
echo timeout waiting for CRD localvolumes.local.storage.openshift.io
123-
exit 1
124-
fi
125114

126115
echo ">>>> Render and apply manifests for LocalVolume on: ${edgecluster}"
127116
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
128117
render_file manifests/04-LSO-LocalVolume.yaml
129118
sleep 20
130119

131-
echo ">>>> Waiting for: LSO PVs on ${edgecluster}"
120+
echo ">>>> Waiting for: LSO LocalVolume on ${edgecluster}"
132121
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
133-
timeout=0
134-
ready=false
135-
while [ "$timeout" -lt "1000" ]; do
136-
if [[ $(oc --kubeconfig=${EDGE_KUBECONFIG} get pv -o name | wc -l) -ge 3 ]]; then
137-
ready=true
138-
break
139-
fi
140-
sleep 5
141-
timeout=$((timeout + 5))
142-
done
143-
144-
if [ "$ready" == "false" ]; then
145-
echo "timeout waiting for LSO PVs..."
146-
exit 1
147-
fi
122+
check_resource "localvolume" "localstorage-disks-block" "Available" "openshift-local-storage" "${EDGE_KUBECONFIG}"
148123

149124
echo ">>>> Deploy manifests to install ODF $OC_ODF_VERSION"
150125
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"

deploy-odf/manifests/04-ODF-StorageCluster.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ spec:
2525
name: ocs-deviceset
2626
placement: {}
2727
portable: False
28-
replica: 1
28+
replica: 3
2929
resources: {}

deploy-worker/render_worker.sh

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -132,35 +132,11 @@ EOF
132132

133133
echo ">>>> Deploying BMH Worker ${worker} for ${1}"
134134
oc --kubeconfig=${KUBECONFIG_HUB} apply -f ${OUTPUT}
135+
# Give some time for the agent to be created
136+
sleep 60
135137
done
136138
}
137139

138-
function verify_worker() {
139-
140-
cluster=${1}
141-
timeout=0
142-
ready=false
143-
144-
echo ">>>> Waiting for Worker Agent: ${cluster}"
145-
echo ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
146-
while [ "$timeout" -lt "1000" ]; do
147-
WORKER_AGENT=$(oc --kubeconfig=${KUBECONFIG_HUB} get agent -n ${cluster} --no-headers | grep worker | cut -f1 -d\ )
148-
echo "Waiting for Worker's agent installation for edgecluster: ${cluster} - Agent: ${WORKER_AGENT}"
149-
if [[ $(oc --kubeconfig=${KUBECONFIG_HUB} get agent -n ${cluster} ${WORKER_AGENT} -o jsonpath='{.status.conditions[?(@.reason=="InstallationCompleted")].status}') == True ]]; then
150-
ready=true
151-
break
152-
fi
153-
sleep 5
154-
timeout=$((timeout + 1))
155-
done
156-
157-
if [ "$ready" == "false" ]; then
158-
echo "Timeout waiting for Worker's agent installation for edgecluster: ${cluster}"
159-
exit 1
160-
fi
161-
162-
}
163-
164140
# Load common vars
165141
source ${WORKDIR}/shared-utils/common.sh
166142

@@ -180,6 +156,13 @@ index=0
180156

181157
for EDGE in ${ALLEDGECLUSTERS}; do
182158
create_worker_definitions ${EDGE} ${index}
183-
verify_worker ${EDGE}
159+
WORKER_AGENT=$(oc --kubeconfig=${KUBECONFIG_HUB} get agent -n ${EDGE} --no-headers | grep worker | awk '{print $1}')
160+
if [ "x${WORKER_AGENT}" == "x" ]; then
161+
echo "Worker agent is empty for ${EDGE}, sleeping a bit more... 120 secs"
162+
sleep 120
163+
WORKER_AGENT=$(oc --kubeconfig=${KUBECONFIG_HUB} get agent -n ${EDGE} --no-headers | grep worker | awk '{print $1}')
164+
echo "Now worker agent is ${WORKER_AGENT}"
165+
fi
166+
check_resource "agent" "${WORKER_AGENT}" "Installed" "${EDGE}" "${KUBECONFIG_HUB}"
184167
index=$((index + 1))
185168
done

0 commit comments

Comments
 (0)