-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathhyperconverged-lab.sh
More file actions
executable file
·181 lines (156 loc) · 5.58 KB
/
hyperconverged-lab.sh
File metadata and controls
executable file
·181 lines (156 loc) · 5.58 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
#!/usr/bin/env bash
# shellcheck disable=SC2124,SC2145,SC2294,SC2086,SC2087,SC2155
#
# Hyperconverged Lab Deployment Selector
#
# This script provides a simple interface to deploy Genestack (OpenStack on Kubernetes)
# in a hyperconverged configuration using either:
#
# 1. Kubespray - Traditional approach using Ubuntu VMs and Kubespray/Ansible
# 2. Talos Linux - Modern approach using Talos Linux immutable OS
#
# Usage:
# ./hyperconverged-lab.sh # Interactive mode - prompts for platform
# ./hyperconverged-lab.sh kubespray [args] # Deploy using Kubespray
# ./hyperconverged-lab.sh talos [args] # Deploy using Talos Linux
#
# For uninstall, use the corresponding uninstall scripts:
# ./hyperconverged-lab-kubespray-uninstall.sh
# ./hyperconverged-lab-talos-uninstall.sh
#
set -o pipefail
set -e
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
function show_usage() {
cat <<EOF
Hyperconverged Lab Deployment Script
This script deploys Genestack (OpenStack on Kubernetes) in a hyperconverged
configuration on OpenStack infrastructure.
USAGE:
$(basename "$0") [PLATFORM] [OPTIONS]
PLATFORMS:
kubespray Deploy using Kubespray on Ubuntu (traditional approach)
- Uses Ubuntu VMs with SSH access
- Kubernetes deployed via Kubespray/Ansible
- Requires SSH keypair for node access
talos Deploy using Talos Linux (modern approach)
- Uses Talos Linux immutable OS
- Kubernetes deployed via talosctl
- No SSH - managed via Talos API
- Includes Talos-specific configs for Longhorn, Kube-OVN, Ceph
help Show this help message
OPTIONS:
-i <list> Comma-separated list of OpenStack services to include
-e <list> Comma-separated list of OpenStack services to exclude
-x Run extra operations (k9s install, Octavia preconf, etc.)
ENVIRONMENT VARIABLES:
ACME_EMAIL Email for ACME/Let's Encrypt certificates
GATEWAY_DOMAIN Domain name for the gateway (default: cluster.local)
OS_CLOUD OpenStack cloud configuration name (default: default)
OS_FLAVOR Flavor to use for instances
OS_IMAGE Image to use (platform-specific defaults apply)
LAB_NAME_PREFIX Prefix for all created resources
LAB_NETWORK_MTU MTU for lab networks (default: 1500)
HYPERCONVERGED_DEV If set to "true", enables development mode which transports
the local environment checkout into the hyperconverged lab
for easier testing and debugging.
HYPERCONVERGED_CINDER_VOLUME
If set to "true", enables iSCSI cinder volume support.
DISABLE_OPENSTACK
if set to "true", no openstack services will be deployed.
EXAMPLES:
# Interactive mode - will prompt for platform choice
$(basename "$0")
# Deploy using Kubespray
$(basename "$0") kubespray
# Deploy using Talos Linux
$(basename "$0") talos
# Deploy Kubespray with extra services and extras enabled
$(basename "$0") kubespray -i heat,octavia -x
# Deploy Talos with specific services excluded
$(basename "$0") talos -e skyline
UNINSTALL:
Use the platform-specific uninstall scripts:
# Uninstall Kubespray deployment
./hyperconverged-lab-kubespray-uninstall.sh
# Uninstall Talos deployment
./hyperconverged-lab-talos-uninstall.sh
For more information, see the Genestack documentation.
EOF
}
function prompt_for_platform() {
echo ""
echo "Hyperconverged Lab Deployment"
echo "============================="
echo ""
echo "Select your deployment platform:"
echo ""
echo " 1) Kubespray"
echo " - Traditional approach using Ubuntu VMs"
echo " - Kubernetes deployed via Kubespray/Ansible"
echo " - SSH-based node management"
echo ""
echo " 2) Talos Linux"
echo " - Modern immutable Linux OS designed for Kubernetes"
echo " - API-based management (no SSH)"
echo " - Includes Talos-specific configurations for Longhorn, Kube-OVN, Ceph"
echo ""
read -rp "Enter your choice [1/2]: " choice
case "$choice" in
1|kubespray|Kubespray|KUBESPRAY)
echo ""
echo "Selected: Kubespray"
PLATFORM="kubespray"
;;
2|talos|Talos|TALOS)
echo ""
echo "Selected: Talos Linux"
PLATFORM="talos"
;;
*)
echo "Invalid choice. Please enter 1 or 2."
exit 1
;;
esac
}
# Check for help flag first
if [[ "$1" == "help" || "$1" == "--help" || "$1" == "-h" ]]; then
show_usage
exit 0
fi
# Determine platform from first argument or prompt
if [[ -n "$1" && "$1" != -* ]]; then
case "$1" in
kubespray|Kubespray|KUBESPRAY)
PLATFORM="kubespray"
shift
;;
talos|Talos|TALOS)
PLATFORM="talos"
shift
;;
*)
echo "Unknown platform: $1"
echo ""
show_usage
exit 1
;;
esac
else
prompt_for_platform
fi
# Execute the appropriate platform-specific script
case "$PLATFORM" in
kubespray)
echo ""
echo "Launching Kubespray deployment..."
echo ""
exec "${SCRIPT_DIR}/hyperconverged-lab-kubespray.sh" "$@"
;;
talos)
echo ""
echo "Launching Talos Linux deployment..."
echo ""
exec "${SCRIPT_DIR}/hyperconverged-lab-talos.sh" "$@"
;;
esac