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

Azure alternative boot image and some other things (1) #383

Merged
merged 7 commits into from
May 14, 2018

Conversation

andersla
Copy link
Member

@andersla andersla commented May 3, 2018

Change content and motivation

Allows for alternative boot image for Azure (not only KubeNow image)
Fixes download status message in Azure image import script
Changes KubeNow_ env prefix to KN_
Adds hcl2json (HashicorpConfigLanguage2json) to Dockerimage and changes reading of parameters in config file from sed with grep to hcl2json tool

Fixes #316
Fixes #327

andersla added 7 commits May 3, 2018 14:57
Allows for alternative boot image for Azure (not only KubeNow image)
Fixes download status message in Azure image import script
Changes KubeNow_ env prefix to KN_
Adds hcl2json (HashicorpConfigLanguage) to Dockerimage and changes reading of parameters in config file from sed with grep to hcl2json tool
Adds private_ip variable to inventory
Allows for alternative boot image for Azure (not only KubeNow image)
Fixes download status message in Azure image import script
Changes KubeNow_ env prefix to KN_
Adds hcl2json (HashicorpConfigLanguage) to Dockerimage and changes reading of parameters in config file from sed with grep to hcl2json tool
Adds private_ip variable to inventory
…now/KubeNow into feature/azure-alternative-bootimage
@andersla andersla changed the title Azure alternative boot image and some other things Azure alternative boot image and some other things (1) May 4, 2018
Copy link
Member

@mcapuccini mcapuccini left a comment

Choose a reason for hiding this comment

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

Looks good, and it is much more neat with json2hcl! Could you use it for every image parsing? Apart from this I have some minor questions, just to keep up with your development.

@@ -28,19 +28,19 @@ if [ -z "${TF_VARS_FILE}" ]; then
fi

# Get vars from tfvars-file
arm_client_id=$(grep "client_id" "$TF_VARS_FILE" |
arm_client_id=$(grep "^client_id" "$TF_VARS_FILE" |
Copy link
Member

@mcapuccini mcapuccini May 7, 2018

Choose a reason for hiding this comment

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

Isn't it possible to parse with the json2hcl tool?

Copy link
Member Author

Choose a reason for hiding this comment

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

I left it as it is because I wanted it to work without Docker image somehow, but I think I changed my mind as well. I will change it for images in a later pull request.


# Break when finished
if [[ "$done_bytes" == "$total_bytes" ]]; then
printf '\rDone copy image \n'
printf '\rDone copy image \n'
Copy link
Member

Choose a reason for hiding this comment

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

Why so many spaces? Can't we have \n straight away?

Copy link
Member Author

Choose a reason for hiding this comment

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

It has to overwrite the previous text "Image copy progress: 99% of xxx"

# Set variables from json-config
host_cloud=$(jq -r '.provider' <<<"$kn_config")
image_name=$(jq -r '.boot_image' <<<"$kn_config")
skip_image_import=$(jq -r '.skip_image_import' <<<"$kn_config")
Copy link
Member

Choose a reason for hiding this comment

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

Where do you set this var?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should be in the docs as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Skip image import is not set yet, but it is used in a plugin config, where only Terraform part of KubeNow is used and a vanilla image is used.

Copy link
Member Author

@andersla andersla May 8, 2018

Choose a reason for hiding this comment

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

The other providers can use an alternative image just specifying the name (together with skip_image_import=true), Only Azure need alternative method in Terraform scripts.

Copy link
Member

@mcapuccini mcapuccini left a comment

Choose a reason for hiding this comment

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

Also could you add some documentation on how/why using alternate Azure image? You can add a page in the advanced topics. Also, do we allow alternate images for the other providers?

@mcapuccini
Copy link
Member

Good! Then I think this PR is good to be merged, please add a little bit of documentation on "alternate azure image" and "skip image import" and we are ready to go!

@andersla andersla merged commit 52a5d6e into master May 14, 2018
@andersla andersla deleted the feature/azure-alternative-bootimage branch June 11, 2018 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants