-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathhyperconverged-lab.sh
More file actions
executable file
·241 lines (215 loc) · 9.28 KB
/
Copy pathhyperconverged-lab.sh
File metadata and controls
executable file
·241 lines (215 loc) · 9.28 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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
#!/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.
Component names install their control-plane chart. Data-plane
pseudo services install the named data-plane component AND
imply their control plane:
cinder-volume full cinder stack: single late chart install
+ volume/VG prep, cinder volumes playbook,
volume type/QoS
manila-share full manila stack: chart + enablement
(secrets, service image build, share type)
Add the plain component name only when you want the chart
without the data plane.
-e <list> Comma-separated list of OpenStack services to exclude.
Excluded components also skip their component-specific
extras steps run by -x (e.g. -x -e octavia runs the extras
but skips the Octavia preconf/install; -e k9s skips k9s,
-e cinder-volume skips the cinder data-plane enablement).
-x Run extra operations (k9s install, Octavia preconf, etc.)
--envoy-gateway-config
Deploy Envoy using the internal/external gateway config file
instead of the legacy flex-gateway.
--envoy-gateway-acme
Deploy Envoy config mode with Let's Encrypt HTTP01 issuer
config and per-service external HTTPS listeners.
--no-envoy-gateway-acme
Disable Let's Encrypt config generation for Envoy config mode.
--internal-metallb-ip <ip>
Use a fixed IP for the internal Envoy MetalLB pool. If unset
with --envoy-gateway-config, the lab creates a second VIP port.
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.
Equivalent to including the 'cinder-volume' pseudo
service via -i; '-e cinder-volume' overrides both.
CINDER_STORAGE_INTERFACE
Ansible fact name of the storage network interface
used by the cinder volumes playbook
(default: ansible_enp3s0).
CINDER_STORAGE_INTERFACE_SECONDARY
Secondary storage interface fact name (defaults to
CINDER_STORAGE_INTERFACE).
CINDER_BACKEND_NAME Cinder backend name for the volumes playbook
(default: lvmdriver-1).
CINDER_WORKER_NAME Cinder worker type for the volumes playbook
(default: lvm). The cinder release branch is no longer
configurable here: it is derived from the cinder chart
version in helm-chart-versions.yaml so the data plane
always matches the control plane.
HYPERCONVERGED_MANILA_SHARE
If set to "true", runs the full Manila enablement
(secrets, service image build, share type) with a
single manila chart install performed by the
enablement step. Equivalent to including the
'manila-share' pseudo service via -i; '-e manila-share'
overrides both. Default "false" installs no manila.
HYPERCONVERGED_ENVOY_GATEWAY_CONFIG
If set to "true", deploys Envoy using the internal/external
gateway config file path instead of the legacy flex-gateway.
HYPERCONVERGED_ENVOY_GATEWAY_ACME
If set to "true", enables Let's Encrypt issuer config for
the external Envoy gateway config-mode lab path.
HYPERCONVERGED_INTERNAL_METALLB_IP
Optional fixed IP for the internal Envoy MetalLB pool. If
unset, the lab creates a second internal VIP port.
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 Kubespray with internal/external Envoy gateways
$(basename "$0") kubespray --envoy-gateway-config
# 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