Update complete example to reflect recent changes
* Adds retries to parts of the teardown script. * Caches tar_urls from Promenade config. Change-Id: I009eff2479cf486d03bececc975aba6c08b9a8f6
This commit is contained in:
parent
e9f8035c60
commit
9e0ab1871a
|
@ -1127,7 +1127,10 @@ data:
|
||||||
- release_group: armada-ucp
|
- release_group: armada-ucp
|
||||||
values:
|
values:
|
||||||
labels:
|
labels:
|
||||||
jobs:
|
job:
|
||||||
|
node_selector_key: ucp-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
|
provisioner:
|
||||||
node_selector_key: ucp-control-plane
|
node_selector_key: ucp-control-plane
|
||||||
node_selector_value: enabled
|
node_selector_value: enabled
|
||||||
endpoints:
|
endpoints:
|
||||||
|
@ -1216,7 +1219,7 @@ data:
|
||||||
ks_service: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
|
ks_service: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
|
||||||
ks_user: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
|
ks_user: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
|
||||||
labels:
|
labels:
|
||||||
jobs:
|
job:
|
||||||
node_selector_key: ucp-control-plane
|
node_selector_key: ucp-control-plane
|
||||||
node_selector_value: enabled
|
node_selector_value: enabled
|
||||||
endpoints:
|
endpoints:
|
||||||
|
@ -1271,8 +1274,9 @@ data:
|
||||||
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
|
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
|
||||||
mariadb: docker.io/mariadb:10.1.23
|
mariadb: docker.io/mariadb:10.1.23
|
||||||
labels:
|
labels:
|
||||||
node_selector_key: ucp-control-plane
|
server:
|
||||||
node_selector_value: enabled
|
node_selector_key: ucp-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
pod:
|
pod:
|
||||||
replicas:
|
replicas:
|
||||||
server: 1
|
server: 1
|
||||||
|
@ -1432,6 +1436,12 @@ data:
|
||||||
upgrade:
|
upgrade:
|
||||||
no_hooks: false
|
no_hooks: false
|
||||||
values:
|
values:
|
||||||
|
endpoints:
|
||||||
|
maas_db:
|
||||||
|
auth:
|
||||||
|
admin:
|
||||||
|
username: postgres
|
||||||
|
password: sergtsop
|
||||||
images:
|
images:
|
||||||
tags:
|
tags:
|
||||||
bootstrap: sthussey/maas-region-controller:2.3
|
bootstrap: sthussey/maas-region-controller:2.3
|
||||||
|
@ -1515,8 +1525,12 @@ data:
|
||||||
replicas:
|
replicas:
|
||||||
server: 1
|
server: 1
|
||||||
labels:
|
labels:
|
||||||
node_selector_key: ucp-control-plane
|
server:
|
||||||
node_selector_value: enabled
|
node_selector_key: ucp-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
|
prometheus_rabbitmq_exporter:
|
||||||
|
node_selector_key: ucp-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
source:
|
source:
|
||||||
type: git
|
type: git
|
||||||
location: https://git.openstack.org/openstack/openstack-helm
|
location: https://git.openstack.org/openstack/openstack-helm
|
||||||
|
@ -1550,6 +1564,9 @@ data:
|
||||||
replicas:
|
replicas:
|
||||||
api: 1
|
api: 1
|
||||||
labels:
|
labels:
|
||||||
|
job:
|
||||||
|
node_selector_key: ucp-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
node_selector_key: ucp-control-plane
|
node_selector_key: ucp-control-plane
|
||||||
node_selector_value: enabled
|
node_selector_value: enabled
|
||||||
images:
|
images:
|
||||||
|
@ -1657,6 +1674,12 @@ data:
|
||||||
upgrade:
|
upgrade:
|
||||||
no_hooks: false
|
no_hooks: false
|
||||||
values:
|
values:
|
||||||
|
endpoints:
|
||||||
|
postgresql:
|
||||||
|
auth:
|
||||||
|
admin:
|
||||||
|
username: postgres
|
||||||
|
password: sergtsop
|
||||||
images:
|
images:
|
||||||
tags:
|
tags:
|
||||||
deckhand: quay.io/attcomdev/deckhand:latest
|
deckhand: quay.io/attcomdev/deckhand:latest
|
||||||
|
@ -1720,6 +1743,11 @@ data:
|
||||||
enabled: true
|
enabled: true
|
||||||
port: 31000
|
port: 31000
|
||||||
endpoints:
|
endpoints:
|
||||||
|
postgresql:
|
||||||
|
auth:
|
||||||
|
admin:
|
||||||
|
username: postgres
|
||||||
|
password: sergtsop
|
||||||
physicalprovisioner:
|
physicalprovisioner:
|
||||||
port:
|
port:
|
||||||
api:
|
api:
|
||||||
|
@ -1835,6 +1863,17 @@ data:
|
||||||
upgrade:
|
upgrade:
|
||||||
no_hooks: false
|
no_hooks: false
|
||||||
values:
|
values:
|
||||||
|
endpoints:
|
||||||
|
postgresql_airflow_db:
|
||||||
|
auth:
|
||||||
|
admin:
|
||||||
|
username: postgres
|
||||||
|
password: sergtsop
|
||||||
|
postgresql_shipyard_db:
|
||||||
|
auth:
|
||||||
|
admin:
|
||||||
|
username: postgres
|
||||||
|
password: sergtsop
|
||||||
prod_environment: true
|
prod_environment: true
|
||||||
images:
|
images:
|
||||||
tags:
|
tags:
|
||||||
|
@ -1842,7 +1881,7 @@ data:
|
||||||
shipyard: quay.io/attcomdev/shipyard:latest
|
shipyard: quay.io/attcomdev/shipyard:latest
|
||||||
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
|
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
|
||||||
shipyard_db_init: docker.io/postgres:9.5
|
shipyard_db_init: docker.io/postgres:9.5
|
||||||
shipyard_db_sync: docker.io/postgres:9.5
|
shipyard_db_sync: quay.io/attcomdev/shipyard:latest
|
||||||
airflow_db_init: docker.io/postgres:9.5
|
airflow_db_init: docker.io/postgres:9.5
|
||||||
airflow_db_sync: quay.io/attcomdev/airflow:latest
|
airflow_db_sync: quay.io/attcomdev/airflow:latest
|
||||||
ks_user: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
|
ks_user: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env bash
|
{% include "header.sh" with context %}
|
||||||
|
|
||||||
{% set hostname = config.get_first('Genesis:hostname', 'KubernetesNode:hostname') -%}
|
{% set hostname = config.get_first('Genesis:hostname', 'KubernetesNode:hostname') -%}
|
||||||
|
|
||||||
|
@ -12,7 +12,29 @@ fi
|
||||||
# Evict pods
|
# Evict pods
|
||||||
kubectl drain --force --timeout 3600s --grace-period 1800 --ignore-daemonsets --delete-local-data {{ hostname }} || true
|
kubectl drain --force --timeout 3600s --grace-period 1800 --ignore-daemonsets --delete-local-data {{ hostname }} || true
|
||||||
|
|
||||||
kubectl label node {{ hostname }} $(kubectl get node {{ hostname }} -o 'jsonpath={.metadata.labels}' | sed 's/map\[//' | sed 's/\]//' | tr ' ' '\n' | sed 's/:.*/-/g' | grep -v 'kubernetes.io')
|
LABELS=()
|
||||||
|
for attempt in $(seq 5); do
|
||||||
|
LABELS=($(kubectl get node {{ hostname }} -o 'jsonpath={.metadata.labels}' | sed 's/map\[//' | sed 's/\]//' | tr ' ' '\n' | sed 's/:.*/-/g' | grep -v 'kubernetes.io'))
|
||||||
|
if [[ ! -z "${LABELS[@]}" ]]; then
|
||||||
|
log "Got labels for host."
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
log "Didn't get labels for host, retrying.."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
|
if [[ -z "${LABELS[@]}" ]]; then
|
||||||
|
log "Failed to get labels for host. Aborting teardown."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
for attempt in $(seq 5); do
|
||||||
|
if kubectl label node {{ hostname }} "${LABELS[@]}"; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
log "Failed to remove labels from node, retrying.."
|
||||||
|
sleep 5
|
||||||
|
done
|
||||||
|
|
||||||
sleep 30
|
sleep 30
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
|
export TEMP_DIR=${TEMP_DIR:-$(mktemp -d)}
|
||||||
export BASE_IMAGE_SIZE=${BASE_IMAGE_SIZE:-68719476736}
|
export BASE_IMAGE_SIZE=${BASE_IMAGE_SIZE:-68719476736}
|
||||||
export BASE_IMAGE_URL=${BASE_IMAGE_URL:-https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img}
|
export BASE_IMAGE_URL=${BASE_IMAGE_URL:-https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img}
|
||||||
export IMAGE_PROMENADE=${IMAGE_PROMENADE:-quay.io/attcomdev/promenade:latest}
|
export IMAGE_PROMENADE=${IMAGE_PROMENADE:-quay.io/attcomdev/promenade:latest}
|
||||||
|
export NGINX_DIR="${TEMP_DIR}/nginx"
|
||||||
|
export NGINX_URL="http://192.168.77.1:7777"
|
||||||
export PROMENADE_DEBUG=${PROMENADE_DEBUG:-0}
|
export PROMENADE_DEBUG=${PROMENADE_DEBUG:-0}
|
||||||
export REGISTRY_DATA_DIR=${REGISTRY_DATA_DIR:-/mnt/registry}
|
export REGISTRY_DATA_DIR=${REGISTRY_DATA_DIR:-/mnt/registry}
|
||||||
export VIRSH_POOL=${VIRSH_POOL:-promenade}
|
export VIRSH_POOL=${VIRSH_POOL:-promenade}
|
||||||
|
|
|
@ -8,7 +8,7 @@ nginx_down() {
|
||||||
|
|
||||||
nginx_up() {
|
nginx_up() {
|
||||||
log Starting nginx server to serve configuration files
|
log Starting nginx server to serve configuration files
|
||||||
mkdir -p "${TEMP_DIR}/nginx"
|
mkdir -p "${NGINX_DIR}"
|
||||||
docker run -d \
|
docker run -d \
|
||||||
-p 7777:80 \
|
-p 7777:80 \
|
||||||
--restart=always \
|
--restart=always \
|
||||||
|
@ -16,3 +16,19 @@ nginx_up() {
|
||||||
-v "${TEMP_DIR}/nginx:/usr/share/nginx/html:ro" \
|
-v "${TEMP_DIR}/nginx:/usr/share/nginx/html:ro" \
|
||||||
nginx:stable &>> "${LOG_FILE}"
|
nginx:stable &>> "${LOG_FILE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nginx_cache_and_replace_tar_urls() {
|
||||||
|
log "Finding tar_url options to cache.."
|
||||||
|
TAR_NUM=0
|
||||||
|
for file in "$@"; do
|
||||||
|
grep -Po "^ +tar_url: \K.+$" "${file}" | while read tar_url ; do
|
||||||
|
# NOTE(mark-burnet): Does not yet ignore repeated files.
|
||||||
|
log "Caching ${tar_url} in file: ${file}"
|
||||||
|
DEST_PATH="${NGINX_DIR}/cached-tar-${TAR_NUM}.tgz"
|
||||||
|
REPLACEMENT_URL="${NGINX_URL}/cached-tar-${TAR_NUM}.tgz"
|
||||||
|
curl -Lo "${DEST_PATH}" "${tar_url}"
|
||||||
|
sed -i "s;${tar_url};${REPLACEMENT_URL};" "${file}"
|
||||||
|
TAR_NUM=$((TAR_NUM + 1))
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
|
@ -20,5 +20,5 @@ docker run --rm -t \
|
||||||
-o scripts \
|
-o scripts \
|
||||||
config/*.yaml
|
config/*.yaml
|
||||||
|
|
||||||
mkdir -p "${TEMP_DIR}/nginx/"
|
mkdir -p "${NGINX_DIR}"
|
||||||
cat "${TEMP_DIR}"/config/*.yaml > "${TEMP_DIR}/nginx/promenade.yaml"
|
cat "${TEMP_DIR}"/config/*.yaml > "${TEMP_DIR}/nginx/promenade.yaml"
|
||||||
|
|
|
@ -14,6 +14,8 @@ for source_dir in $(config_configuration); do
|
||||||
cat "${WORKSPACE}/${source_dir}"/*.yaml >> "${OUTPUT_FILE}"
|
cat "${WORKSPACE}/${source_dir}"/*.yaml >> "${OUTPUT_FILE}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
log "Setting up local caches.."
|
||||||
|
nginx_cache_and_replace_tar_urls "${OUTPUT_DIR}"/*.yaml
|
||||||
registry_replace_references "${OUTPUT_DIR}"/*.yaml
|
registry_replace_references "${OUTPUT_DIR}"/*.yaml
|
||||||
|
|
||||||
FILES=($(ls "${OUTPUT_DIR}"))
|
FILES=($(ls "${OUTPUT_DIR}"))
|
||||||
|
|
|
@ -66,7 +66,7 @@ render_curl_url() {
|
||||||
if [[ ${USE_DECKHAND} == 1 ]]; then
|
if [[ ${USE_DECKHAND} == 1 ]]; then
|
||||||
DESIGN_REF="design_ref=deckhand%2Bhttp://deckhand-int.ucp.svc.cluster.local:9000/api/v1.0/revisions/${DECKHAND_REVISION}/rendered-documents"
|
DESIGN_REF="design_ref=deckhand%2Bhttp://deckhand-int.ucp.svc.cluster.local:9000/api/v1.0/revisions/${DECKHAND_REVISION}/rendered-documents"
|
||||||
else
|
else
|
||||||
DESIGN_REF="design_ref=http://192.168.77.1:7777/promenade.yaml"
|
DESIGN_REF="design_ref=${NGINX_URL}/promenade.yaml"
|
||||||
fi
|
fi
|
||||||
HOST_PARAMS="hostname=${NAME}&ip=$(config_vm_ip "${NAME}")"
|
HOST_PARAMS="hostname=${NAME}&ip=$(config_vm_ip "${NAME}")"
|
||||||
|
|
||||||
|
|
|
@ -5,8 +5,6 @@ set -e
|
||||||
SCRIPT_DIR=$(realpath "$(dirname "${0}")")
|
SCRIPT_DIR=$(realpath "$(dirname "${0}")")
|
||||||
WORKSPACE=$(realpath "${SCRIPT_DIR}/..")
|
WORKSPACE=$(realpath "${SCRIPT_DIR}/..")
|
||||||
GATE_UTILS=${WORKSPACE}/tools/g2/lib/all.sh
|
GATE_UTILS=${WORKSPACE}/tools/g2/lib/all.sh
|
||||||
TEMP_DIR=${TEMP_DIR:-$(mktemp -d)}
|
|
||||||
chmod -R 755 "${TEMP_DIR}"
|
|
||||||
|
|
||||||
GATE_COLOR=${GATE_COLOR:-1}
|
GATE_COLOR=${GATE_COLOR:-1}
|
||||||
|
|
||||||
|
@ -16,11 +14,12 @@ GATE_MANIFEST=${WORKSPACE}/tools/g2/manifests/${MANIFEST_ARG}.json
|
||||||
export GATE_COLOR
|
export GATE_COLOR
|
||||||
export GATE_MANIFEST
|
export GATE_MANIFEST
|
||||||
export GATE_UTILS
|
export GATE_UTILS
|
||||||
export TEMP_DIR
|
|
||||||
export WORKSPACE
|
export WORKSPACE
|
||||||
|
|
||||||
source "${GATE_UTILS}"
|
source "${GATE_UTILS}"
|
||||||
|
|
||||||
|
chmod -R 755 "${TEMP_DIR}"
|
||||||
|
|
||||||
STAGES_DIR=${WORKSPACE}/tools/g2/stages
|
STAGES_DIR=${WORKSPACE}/tools/g2/stages
|
||||||
|
|
||||||
log_temp_dir "${TEMP_DIR}"
|
log_temp_dir "${TEMP_DIR}"
|
||||||
|
|
Loading…
Reference in New Issue