-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request juju#17103 from jack-w-shaw/JUJU-5381_back_enable_…
…ha_with_microceph juju#17103 Use a (currently edge) microceph charm, integrated with the ceph-radosgw charm to provide an s3 endpoint the controller can use for distrbuted block storage ## Checklist - [x] Code style: imports ordered, good names, simple structure, etc - [x] Comments saying why design decisions were made - ~[ ] Go unit tests, with comments saying what you're testing~ - [x] [Integration tests](https://github.com/juju/juju/tree/main/tests), with comments saying what you're testing - ~[ ] [doc.go](https://discourse.charmhub.io/t/readme-in-packages/451) added or updated in changed packages~ ## QA steps NOTE: These integration tests currently fail. This is expected #### lxd ``` ./main.sh -v controller test_enable_ha ``` #### aws ``` ./main.sh -v -c aws -p ec2 controller test_enable_ha ``` Both of these runs should successfully go into HA. They will fail exiting HA, however
- Loading branch information
Showing
2 changed files
with
42 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
enable_microceph_backed_storage() { | ||
juju switch controller | ||
|
||
if [[ $BOOTSTRAP_PROVIDER == "lxd" || $BOOTSTRAP_PROVIDER == "localhost" ]]; then | ||
# Deploy to a virtual machine so loopback devices work out of the box | ||
juju deploy microceph --channel="latest/edge" --config "snap-channel=reef/stable" --constraints "root-disk=16G cores=4 virt-type=virtual-machine" | ||
else | ||
juju deploy microceph --channel="latest/edge" --config "snap-channel=reef/stable" --constraints "root-disk=16G cores=4" | ||
fi | ||
|
||
# microceph is currently not a stable charm, so remove with force. Drop this when we use a stable release | ||
add_clean_func "juju remove-application -m controller microceph --force" | ||
|
||
juju deploy ceph-radosgw --channel "reef/stable" | ||
|
||
wait_for "microceph" "$(idle_condition "microceph" 2)" | ||
|
||
juju add-storage microceph/0 osd-standalone="loop,2G,3" | ||
juju integrate microceph ceph-radosgw | ||
juju expose ceph-radosgw | ||
|
||
# NOTE: This can sometimes take surprisigly long | ||
wait_for "ceph-radosgw" "$(active_idle_condition "ceph-radosgw")" | ||
|
||
gw_ip=$(juju status --format json | jq -r '.applications["ceph-radosgw"].units["ceph-radosgw/0"]["public-address"]') | ||
key=$(juju ssh microceph/0 "sudo radosgw-admin user create --uid juju --display-name Juju" | jq -r ".keys[0]") | ||
juju controller-config \ | ||
"object-store-type=s3" \ | ||
"object-store-s3-endpoint=http://${gw_ip}:80" \ | ||
"object-store-s3-static-key=$(echo "$key" | jq -r ".access_key")" \ | ||
"object-store-s3-static-secret=$(echo "$key" | jq -r ".secret_key")" | ||
} |
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