-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support multisite in ceph2 setup #84
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
readonly RGW_REALM_USER_ACCESS_KEY_FILE="/tmp/rgw-user-access-key.txt" | ||
readonly RGW_REALM_USER_SECRET_KEY=('xSZUdYky0bTctAdCEEW8ikhfBVKsBV5LFYL82vvh' 'GsOwxjOfxAwM2It2mBiB5A5CJFxu73GjpNjCROvx') | ||
readonly RGW_REALM_USER_SECRET_KEY_FILE="/tmp/rgw-user-secret-key.txt" | ||
readonly RGW_REALM_USER_NUM=1 | ||
Check warning on line 11 in docker/ceph/set-rgw.sh GitHub Actions / runner / shellcheck
|
||
RGW_DAEMON_PORT=8000 | ||
|
||
truncate -s0 ${RGW_REALM_USER_ACCESS_KEY_FILE} | ||
|
@@ -30,11 +30,11 @@ | |
"$CEPH_BIN"/radosgw-admin user create --uid "${USER_UID}" \ | ||
--display-name "${RGW_REALM_USER_NAME}${USER_NUM}" \ | ||
--access-key "${RGW_REALM_USER_ACCESS_KEY[${SECRET_INDEX}]}" --secret "${RGW_REALM_USER_SECRET_KEY[${SECRET_INDEX}]}" \ | ||
${NAMESPACE_OPTIONS} --system | ||
Check warning on line 33 in docker/ceph/set-rgw.sh GitHub Actions / runner / shellcheck
|
||
|
||
# Create MFA TOTP token. | ||
"$CEPH_BIN"/radosgw-admin mfa create --uid="${USER_UID}" --totp-serial=1 --totp-seed=23456723 --totp-seed-type=base32 \ | ||
${NAMESPACE_OPTIONS} | ||
Check warning on line 37 in docker/ceph/set-rgw.sh GitHub Actions / runner / shellcheck
|
||
} | ||
|
||
add_placement_targets_and_storage_classes() { | ||
|
@@ -74,7 +74,7 @@ | |
|
||
rm -f "$RGW_DAEMON_PID_FILE" | ||
|
||
if [[ $(grep "\[$RGW_DAEMON_NAME\]" "$CEPH_CONF" | grep -v grep | wc -l) == 0 ]]; then | ||
Check warning on line 77 in docker/ceph/set-rgw.sh GitHub Actions / runner / shellcheck
|
||
"$CEPH_BIN"/ceph -c "$CEPH_CONF" auth get-or-create "$RGW_DAEMON_NAME" \ | ||
mon 'allow rw' osd 'allow rwx' mgr 'allow rw' \ | ||
>> "$CEPH_CONF_PATH"/keyring | ||
|
@@ -146,7 +146,7 @@ | |
echo -n "{$(cat ${RGW_REALM_USER_ACCESS_KEY_FILE} | sed 's/,$//')}" > "${RGW_REALM_USER_ACCESS_KEY_FILE}" | ||
echo -n "{$(cat ${RGW_REALM_USER_SECRET_KEY_FILE} | sed 's/,$//')}" > "${RGW_REALM_USER_SECRET_KEY_FILE}" | ||
else | ||
readonly FIRST_CLUSTER_HOSTNAME=$(hostname | sed -e 's/-cluster.//') | ||
readonly FIRST_CLUSTER_HOSTNAME=$(hostname | sed -e 's/2//g') | ||
readonly CLUSTER2_PULL_REALM="${REALM_NAME_PREFIX}1" | ||
readonly CLUSTER2_ZONEGROUP="${ZONEGROUP_NAME_PREFIX}1-${CLUSTER2_PULL_REALM}" | ||
readonly CLUSTER2_ZONE="${ZONE_NAME_PREFIX}3-${CLUSTER2_ZONEGROUP}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,21 +7,14 @@ | |
[[ -d "$MGR_PYTHON_PATH"/dashboard/frontend ]] && export IS_UPSTREAM_LUMINOUS=0 | ||
[[ -z "$RGW" ]] && export RGW=1 | ||
|
||
export IS_FIRST_CLUSTER=$(hostname | grep -v cluster | wc -l) | ||
export IS_FIRST_CLUSTER=$(hostname | grep -v ceph2 | wc -l) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
[[ ("$IS_CEPH_RPM" == 0 || -n "$CEPH_REPO_DIR") && "$IS_UPSTREAM_LUMINOUS" == 0 && "$IS_FIRST_CLUSTER" == 1 ]] \ | ||
[[ ("$IS_CEPH_RPM" == 0 || -n "$CEPH_REPO_DIR") && "$IS_UPSTREAM_LUMINOUS" == 0 ]] \ | ||
&& export FRONTEND_BUILD_REQUIRED=1 | ||
FRONTEND_BUILD_OPTIONS=${FRONTEND_BUILD_OPTIONS:-"--deleteOutputPath=false"} | ||
|
||
if [[ "$RGW_MULTISITE" == 1 ]]; then | ||
export RGW=0 # Required to prevent vstart from starting any rgw daemon. | ||
|
||
if [[ "$IS_FIRST_CLUSTER" == 0 ]]; then | ||
export FS=0 | ||
export MDS=0 | ||
export MGR=0 | ||
export MON=1 | ||
fi | ||
fi | ||
|
||
RGW_DEBUG='' | ||
|
@@ -38,4 +31,4 @@ | |
HTTP_PROTO='https' | ||
fi | ||
export HTTP_PROTO | ||
export CEPH_MGR_DASHBOARD_PORT=$(($CEPH_PORT + 1000)) | ||
Check warning on line 34 in docker/ceph/set-start-env.sh GitHub Actions / runner / shellcheck
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
set -e | ||
|
||
source /docker/set-start-env.sh | ||
Check warning on line 5 in docker/ceph/start-ceph.sh GitHub Actions / runner / shellcheck
|
||
|
||
# Build frontend: | ||
if [[ "$FRONTEND_BUILD_REQUIRED" == 1 ]]; then | ||
|
@@ -11,7 +11,7 @@ | |
# Set dev server proxy: | ||
TARGET_URL="${HTTP_PROTO}://${HOSTNAME}:${CEPH_MGR_DASHBOARD_PORT}" | ||
[[ -n "${DASHBOARD_URL}" ]] && TARGET_URL=${DASHBOARD_URL} | ||
jq "(.[] | .target)=\""${TARGET_URL}"\"" proxy.conf.json.sample > proxy.conf.json | ||
Check warning on line 14 in docker/ceph/start-ceph.sh GitHub Actions / runner / shellcheck
Check warning on line 14 in docker/ceph/start-ceph.sh GitHub Actions / runner / shellcheck
|
||
|
||
if [[ "$CEPH_VERSION" == '13' ]]; then | ||
rm -rf package-lock.json node_modules/@angular/cli | ||
|
@@ -45,10 +45,10 @@ | |
exit 0 | ||
fi | ||
|
||
rm -rf "$CEPH_CONF_PATH"/* | ||
Check warning on line 48 in docker/ceph/start-ceph.sh GitHub Actions / runner / shellcheck
|
||
|
||
cd /ceph/build | ||
../src/vstart.sh ${VSTART_OPTIONS} | ||
Check warning on line 51 in docker/ceph/start-ceph.sh GitHub Actions / runner / shellcheck
|
||
|
||
echo 'vstart.sh completed!' | ||
|
||
|
@@ -58,10 +58,8 @@ | |
fi | ||
|
||
# Enable prometheus module | ||
if [[ "$IS_FIRST_CLUSTER" == 1 ]]; then | ||
"$CEPH_BIN"/ceph mgr module enable prometheus | ||
echo 'Prometheus mgr module enabled.' | ||
fi | ||
"$CEPH_BIN"/ceph mgr module enable prometheus | ||
echo 'Prometheus mgr module enabled.' | ||
|
||
#Enable and set test_orchestrator module | ||
if [[ "$TEST_ORCHESTRATOR" == 1 ]]; then | ||
|
@@ -75,7 +73,7 @@ | |
|
||
# Disable ssl (if selected) | ||
readonly VSTART_HAS_SSL_FLAG=$(cat /ceph/src/vstart.sh | grep DASHBOARD_SSL | wc -l) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
if [[ "$DASHBOARD_SSL" == 0 && "$VSTART_HAS_SSL_FLAG" == 0 && "$IS_FIRST_CLUSTER" == 1 ]]; then | ||
if [[ "$DASHBOARD_SSL" == 0 && "$VSTART_HAS_SSL_FLAG" == 0 ]]; then | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
echo "Disabling SSL..." | ||
|
||
SSL_OPTIONS='--force' | ||
|
@@ -91,7 +89,7 @@ | |
fi | ||
|
||
# Secondary cluster start (or upstream mimic start) ends here. | ||
[[ "$IS_FIRST_CLUSTER" == 0 || "$CEPH_VERSION" -le '13' ]] && exit 0 | ||
[[ "$CEPH_VERSION" -le '13' ]] && exit 0 | ||
|
||
# Create dashboard "test" user: | ||
[[ "$CEPH_VERSION" -gt '14' ]] && DASHBOARD_USER_CREATE_OPTIONS='--force-password' | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Declare and assign separately to avoid masking return values. SC2155