Skip to content
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

add microstack as provider #11

Merged
merged 4 commits into from
Jun 9, 2021

Conversation

rgildein
Copy link
Contributor

@rgildein rgildein commented Jun 4, 2021

Adding microstack as provider. This will help to run action related to deployment on top of OpenStack cloud.

Copy link
Contributor

@johnsca johnsca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great so far! Thanks for this!

Comment on lines 57 to 63
await exec.exec(`curl http://cloud-images.ubuntu.com/${os_series}/current/${os_series}-server-cloudimg-amd64.img | openstack image create --public --container-format=bare --disk-format=qcow2 ${os_series}`);
await exec.exec("mkdir /tmp/simplestreams");
await exec.exec(`IMAGE_ID=$(openstack image show ${os_series} -f value -c id) && juju metadata generate-image -d /tmp/simplestreams -s ${os_series} -i $IMAGE_ID -r ${os_region} -u http://10.20.20.1:5000/v3`);
await exec.exec("echo '{clouds: {microstack: {type: openstack, auth-types: [access-key,userpass], regions: {microstack: {endpoint: http://10.20.20.1:5000/v3}}}}}' > /tmp/clouds.json");
await exec.exec("juju add-cloud --client microstack -f /tmp/clouds.json");
await exec.exec('source /var/snap/microstack/common/etc/microstack.rc && echo "{credentials: {microstack: {$OS_USERNAME: {auth-type: userpass, username: $OS_USERNAME, password: $OS_PASSWORD, project-domain-name: $OS_PROJECT_DOMAIN_NAME, tenant-name: $OS_PROJECT_NAME, user-domain-name: $OS_USER_DOMAIN_NAME, version: \'$OS_IDENTITY_API_VERSION\'}}}}" > /tmp/credentials.json');
await exec.exec("juju add-credential microstack -f /tmp/credentials.json --client");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to encapsulate these steps into a Juju plugin akin to juju-crashdump or juju-wait, say juju-add-microstack to make it easier for a user to use microstack with Juju locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I like this idea and I reported a bug in the microstack.

@rgildein rgildein marked this pull request as ready for review June 7, 2021 12:56
@rgildein rgildein force-pushed the provider/microstack branch 14 times, most recently from 7f99d0a to a97a477 Compare June 9, 2021 12:42
@rgildein rgildein force-pushed the provider/microstack branch from a97a477 to bd800b4 Compare June 9, 2021 12:51
Copy link
Contributor

@johnsca johnsca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and the passing run looks good as well.

@johnsca johnsca merged commit c791c56 into charmed-kubernetes:master Jun 9, 2021
@rgildein rgildein deleted the provider/microstack branch September 1, 2024 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants