-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
395 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
Support/Multitenancy/Multiple-Ironic-conductors/bmo-config/ironic-password
This file was deleted.
Oops, something went wrong.
1 change: 0 additions & 1 deletion
1
Support/Multitenancy/Multiple-Ironic-conductors/bmo-config/ironic-username
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#!/bin/bash | ||
# | ||
export N_NODES=10 | ||
export N_SUSHY=2 | ||
export N_FAKE_IPA=2 | ||
export N_IRONICS=4 | ||
export N_NODES=1000 | ||
export N_SUSHY=60 | ||
export N_FAKE_IPA=40 | ||
export N_IRONICS=50 | ||
export N_APISERVER_PODS=5 | ||
# export N_NODES=50 | ||
# export N_SUSHY=2 | ||
# export N_FAKE_IPA=2 | ||
# export N_IRONICS=3 | ||
|
||
# Translating N_IRONICS to IRONIC_ENDPOINTS. Don't change this part | ||
IRONIC_ENDPOINTS="172.22.0.2" | ||
IRONIC_ENDPOINTS="192.168.222.100" | ||
for i in $(seq 2 $N_IRONICS); do | ||
IRONIC_ENDPOINTS="${IRONIC_ENDPOINTS} 172.22.0.$(( i + 1 ))" | ||
IRONIC_ENDPOINTS="${IRONIC_ENDPOINTS} 192.168.222.$(( 100+i ))" | ||
done | ||
export IRONIC_ENDPOINTS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
Support/Multitenancy/Multiple-Ironic-conductors/create-ironic-client.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
ironic_client="ironicclient.sh" | ||
openstack_dir="${PWD}/_clouds_yaml" | ||
rm -rf "${openstack_dir}" | ||
mkdir -p "${openstack_dir}" | ||
__dir__=$(realpath "$(dirname "$0")") | ||
cp ${__dir__}/opt/metal3-dev-env/ironic/certs/ironic-ca.pem "${openstack_dir}/ironic-ca.crt" | ||
cat << EOT >"${openstack_dir}/clouds.yaml" | ||
clouds: | ||
metal3: | ||
auth_type: none | ||
baremetal_endpoint_override: https://172.22.0.2:6385 | ||
baremetal_introspection_endpoint_override: https://172.22.0.2:5050 | ||
verify: false | ||
EOT | ||
|
||
docker run --net=host \ | ||
--name openstack-client \ | ||
--detach \ | ||
--entrypoint=/bin/sleep \ | ||
-v "${openstack_dir}:/etc/openstack" \ | ||
-e OS_CLOUD="${OS_CLOUD:-metal3}" \ | ||
"172.22.0.1:5000/localimages/ironic-client" \ | ||
"inf" | ||
|
||
|
||
cat << EOT >"${ironic_client}" | ||
#!/bin/bash | ||
DIR="$(dirname "$(readlink -f "$0")")" | ||
if [ -d $openstack_dir ]; then | ||
MOUNTDIR=$openstack_dir | ||
else | ||
echo 'cannot find $openstack_dir' | ||
exit 1 | ||
fi | ||
if [ \$1 == "baremetal" ] ; then | ||
shift 1 | ||
fi | ||
# shellcheck disable=SC2086 | ||
docker exec openstack-client /usr/bin/baremetal "\$@" | ||
EOT | ||
|
||
sudo chmod a+x "${ironic_client}" | ||
sudo ln -sf "$PWD/${ironic_client}" "/usr/local/bin/baremetal" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
Support/Multitenancy/Multiple-Ironic-conductors/dev-clean.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env bash | ||
|
||
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | ||
cd "${REPO_ROOT}" || exit 1 | ||
|
||
NUM_BMH=${NUM_BMH:-"5"} | ||
|
||
minikube delete | ||
docker rm -f vbmc | ||
docker rm -f image-server-e2e | ||
docker rm -f sushy-tools | ||
|
||
for ((i=0; i<NUM_BMH; i++)) | ||
do | ||
virsh -c qemu:///system destroy --domain "bmo-e2e-${i}" | ||
virsh -c qemu:///system undefine --domain "bmo-e2e-${i}" --remove-all-storage | ||
done | ||
|
||
virsh -c qemu:///system net-destroy baremetal-e2e | ||
virsh -c qemu:///system net-undefine baremetal-e2e | ||
|
||
# rm -rfv "${REPO_ROOT}/Metal3/images" |
57 changes: 57 additions & 0 deletions
57
Support/Multitenancy/Multiple-Ironic-conductors/dev-setup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eux | ||
|
||
REPO_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")") | ||
cd "${REPO_ROOT}" || exit 1 | ||
|
||
# Set up minikube | ||
minikube start --driver=kvm2 | ||
|
||
virsh -c qemu:///system net-define "${REPO_ROOT}/nets/baremetal.xml" | ||
virsh -c qemu:///system net-start baremetal | ||
# Attach baremetal-e2e interface to minikube with specific mac. | ||
# This will give minikube a known reserved IP address that we can use for Ironic | ||
virsh -c qemu:///system attach-interface --domain minikube --mac="52:54:00:6c:3c:01" \ | ||
--model virtio --source baremetal --type network --config | ||
|
||
# Restart minikube to apply the changes | ||
minikube stop | ||
minikube start | ||
|
||
# Image server variables | ||
IMAGE_DIR="${REPO_ROOT}/Metal3/images" | ||
|
||
## Run the image server | ||
# mkdir -p "${IMAGE_DIR}" | ||
# docker run --name image-server -d \ | ||
# -p 80:8080 \ | ||
# -v "${IMAGE_DIR}:/usr/share/nginx/html" nginxinc/nginx-unprivileged | ||
|
||
kubectl create namespace baremetal-operator-system | ||
|
||
export IRONIC_USERNAME="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)" | ||
export IRONIC_PASSWORD="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)" | ||
export IRONIC_INSPECTOR_USERNAME="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)" | ||
export IRONIC_INSPECTOR_PASSWORD="$(tr -dc 'a-zA-Z0-9' < /dev/urandom | fold -w 12 | head -n 1)" | ||
|
||
BMO_OVERLAY=${REPO_ROOT}/bmo-config | ||
IRONIC_OVERLAY=${REPO_ROOT}/ironic | ||
|
||
echo "${IRONIC_USERNAME}" > "${BMO_OVERLAY}/ironic-username" | ||
echo "${IRONIC_PASSWORD}" > "${BMO_OVERLAY}/ironic-password" | ||
echo "${IRONIC_INSPECTOR_USERNAME}" > "${BMO_OVERLAY}/ironic-inspector-username" | ||
echo "${IRONIC_INSPECTOR_PASSWORD}" > "${BMO_OVERLAY}/ironic-inspector-password" | ||
|
||
curl -O https://raw.githubusercontent.com/metal3-io/baremetal-operator/main/ironic-deployment/components/basic-auth/ironic-auth-config-tpl | ||
curl -O https://raw.githubusercontent.com/metal3-io/baremetal-operator/main/ironic-deployment/components/basic-auth/ironic-inspector-auth-config-tpl | ||
|
||
envsubst < "${REPO_ROOT}/ironic-auth-config-tpl" > \ | ||
"${IRONIC_OVERLAY}/ironic-auth-config" | ||
envsubst < "${REPO_ROOT}/ironic-inspector-auth-config-tpl" > \ | ||
"${IRONIC_OVERLAY}/ironic-inspector-auth-config" | ||
|
||
echo "IRONIC_HTPASSWD=$(htpasswd -n -b -B "${IRONIC_USERNAME}" "${IRONIC_PASSWORD}")" > \ | ||
"${IRONIC_OVERLAY}/ironic-htpasswd" | ||
echo "INSPECTOR_HTPASSWD=$(htpasswd -n -b -B "${IRONIC_INSPECTOR_USERNAME}" \ | ||
"${IRONIC_INSPECTOR_PASSWORD}")" > "${IRONIC_OVERLAY}/ironic-inspector-htpasswd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.