Skip to content

Commit 52eae0c

Browse files
committed
feat: create a multi-path hyperconverged lab deployment
This change implements a code path for both Kubespray and Talos as a deployment target, building upon the test framework that we're creating. Signed-off-by: Kevin Carter <[email protected]>
1 parent 3ec5c18 commit 52eae0c

14 files changed

+3804
-1431
lines changed

.github/workflows/smoke-deploy-lab.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
run: |
9999
eval "$(ssh-agent -s)"
100100
export TEST_LEVEL="${{ github.event.inputs.test_level }}"
101-
scripts/hyperconverged-lab.sh
101+
scripts/hyperconverged-lab.sh kubespray
102102
103103
- name: Retrieve Keys
104104
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.mode == 'deploy' }}
@@ -190,4 +190,4 @@ jobs:
190190
191191
- name: Cleanup the lab
192192
if: ${{ always() && (github.event_name == 'pull_request' || contains(fromJSON('["cleanup", "test"]'), github.event.inputs.mode)) }}
193-
run: scripts/hyperconverged-lab-uninstall.sh
193+
run: scripts/hyperconverged-lab-uninstall.sh kubespray

bin/install-neutron.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,9 @@ fi
125125
echo
126126

127127
# Set connection string based on whether we use Kube-OVN TLS
128-
# Hyperconverged build tries to execute the install script without yq in the
129-
# path
130-
function installYq() {
131-
export VERSION=v4.47.2
132-
export BINARY=yq_linux_amd64
133-
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -q -O - | tar xz && mv ${BINARY} /usr/local/bin/yq
134-
}
135-
136-
if ! yq --version 2> /dev/null; then
137-
echo "yq is not installed. Attempting to install yq"
138-
installYq
139-
fi
128+
# Source functions library for ensureYq
129+
source "${GENESTACK_BASE_DIR}/scripts/lib/functions.sh"
130+
ensureYq
140131

141132
if helm -n kube-system get values kube-ovn \
142133
| yq -e '.networking.ENABLE_SSL == true' >/dev/null 2>&1

bin/install-octavia.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,18 +124,9 @@ fi
124124
echo
125125

126126
# Set connection string based on whether we use Kube-OVN TLS
127-
# Hyperconverged build tries to execute the install script without yq in the
128-
# path
129-
function installYq() {
130-
export VERSION=v4.47.2
131-
export BINARY=yq_linux_amd64
132-
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -q -O - | tar xz && mv ${BINARY} /usr/local/bin/yq
133-
}
134-
135-
if ! yq --version 2> /dev/null; then
136-
echo "yq is not installed. Attempting to install yq"
137-
installYq
138-
fi
127+
# Source functions library for ensureYq
128+
source "${GENESTACK_BASE_DIR}/scripts/lib/functions.sh"
129+
ensureYq
139130

140131
if helm -n kube-system get values kube-ovn \
141132
| yq -e '.networking.ENABLE_SSL == true' >/dev/null 2>&1

bin/setup-openstack-rc.sh

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
function installYq() {
5-
export VERSION=v4.47.2
6-
export BINARY=yq_linux_amd64
7-
wget https://github.com/mikefarah/yq/releases/download/${VERSION}/${BINARY}.tar.gz -q -O - | tar xz && mv ${BINARY} /usr/local/bin/yq
8-
}
9-
10-
if ! yq --version 2> /dev/null; then
11-
echo "yq is not installed. Attempting to install yq"
12-
installYq
13-
fi
4+
# Base directories provided by the environment
5+
GENESTACK_BASE_DIR="${GENESTACK_BASE_DIR:-/opt/genestack}"
6+
7+
# Source functions library for ensureYq
8+
source "${GENESTACK_BASE_DIR}/scripts/lib/functions.sh"
9+
ensureYq
1410

1511
USER_NAME="$(whoami)"
1612
USER_PATH="$(getent passwd ${USER_NAME} | awk -F':' '{print $6}')"
@@ -19,6 +15,8 @@ CONFIG_FILE="${CONFIG_PATH}/genestack-clouds.yaml"
1915

2016
mkdir -p "${CONFIG_PATH}"
2117

18+
echo "Generating OpenStack RC file at: ${CONFIG_FILE}"
19+
2220
cat > "${CONFIG_FILE}" <<EOF
2321
cache:
2422
auth: true

openstack-components.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
22
components:
33
keystone: true
44
glance: true
@@ -19,3 +19,4 @@ components:
1919
gnocchi: false
2020
skyline: true
2121
zaqar: false
22+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
# shellcheck disable=SC2124,SC2145,SC2294,SC2086,SC2087,SC2155
3+
#
4+
# Hyperconverged Lab Uninstall Script for Kubespray (Ubuntu)
5+
#
6+
# This script removes all resources created by the Kubespray hyperconverged lab script.
7+
#
8+
9+
set -o pipefail
10+
set -e
11+
SECONDS=0
12+
13+
# Source common uninstall library
14+
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
15+
source "${SCRIPT_DIR}/lib/hyperconverged-uninstall-common.sh"
16+
17+
#############################################################################
18+
# Initialize
19+
#############################################################################
20+
21+
promptForCloudConfig
22+
23+
export LAB_NAME_PREFIX="${LAB_NAME_PREFIX:-hyperconverged}"
24+
25+
#############################################################################
26+
# Run Common Uninstall
27+
#############################################################################
28+
29+
runCommonUninstall "${LAB_NAME_PREFIX}"
30+
31+
#############################################################################
32+
# Kubespray-Specific: Delete SSH Keypair and Security Group
33+
#############################################################################
34+
35+
echo "Deleting Kubespray-specific resources..."
36+
keypairDelete ${LAB_NAME_PREFIX}-key
37+
securityGroupDelete ${LAB_NAME_PREFIX}-jump-secgroup
38+
39+
#############################################################################
40+
# Cleanup Complete
41+
#############################################################################
42+
43+
echo "Cleanup complete"
44+
echo "The Kubespray lab uninstall took ${SECONDS} seconds to complete."
45+
echo ""
46+
echo "Note: Local SSH key files (~/.ssh/${LAB_NAME_PREFIX}-key.pem, ~/.ssh/${LAB_NAME_PREFIX}-key.pub)"
47+
echo "were NOT removed. Delete them manually if no longer needed."

0 commit comments

Comments
 (0)