Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

feat: pre-pull Azure Stack's custom Hyperkube #1040

Merged
merged 15 commits into from Apr 22, 2019

Conversation

jadarsie
Copy link
Member

@jadarsie jadarsie commented Apr 12, 2019

Reason for Change:
Stores Azure Stack's custom Hyperkube build in the VHD image.

Issue Fixed:
Fixes #990

Requirements:

Notes:

  • The custom Hyperkube build are downloaded during the VHD provision process.
  • For now it is just single image, will add more entries to the array in a future PR
  • I added an extra optional parameter to all functions that deal with Hyperkube to slightly alter their behavior (extractHyperkube, installKubeletAndKubectl, cleanUpContainerImages)

@welcome
Copy link

welcome bot commented Apr 12, 2019

💖 Thanks for opening your first pull request! 💖 We use semantic commit messages to streamline the release process. Before your pull request can be merged, you should make sure your first commit and PR title start with a semantic prefix. Examples of commit messages with semantic prefixes: - fix: change azure disk cachingMode to ReadOnly - feat: make maximumLoadBalancerRuleCount configurable - docs: add note on AKS Engine and AKS relationship
Make sure to check out the developer guide for guidance on testing your change.

@acs-bot acs-bot added the size/M label Apr 12, 2019
@jadarsie
Copy link
Member Author

jadarsie commented Apr 12, 2019

I just blindly created this PR. Please let me know what validations do you usually run for this set of scripts.

@codecov
Copy link

codecov bot commented Apr 12, 2019

Codecov Report

Merging #1040 into master will increase coverage by 0.02%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #1040      +/-   ##
==========================================
+ Coverage   74.33%   74.36%   +0.02%     
==========================================
  Files         131      131              
  Lines       18259    18277      +18     
==========================================
+ Hits        13573    13591      +18     
  Misses       3905     3905              
  Partials      781      781

@acs-bot acs-bot added size/S and removed size/M labels Apr 12, 2019
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

This PR is breaking for the Ubuntu distro scenario with not-Azure-Stack env

@CecileRobertMichon
Copy link
Contributor

Before this change:

/dev/sda1 30G 18G 12G 60%

After this change:

/dev/sda1 30G 19G 11G 64%

@jackfrancis
Copy link
Member

Can't we just add 1.11.8-azs and 1.11.9-azs to the existing versions array in the VHD CI script? Then we just set the value of KUBERNETES_VERSION in pkg/engine/armvariables.go to have the proper string value if we're in an Azure Stack context.

@CecileRobertMichon
Copy link
Contributor

+1 on @jackfrancis's suggestion.

This should also work with the cleanUpContainerImages function the way you wrote it right now to clean up the Azure Stack images depending on context.

HYPERKUBE_URL="msazurestackdocker/hyperkube-amd64:v${KUBERNETES_VERSION}"
 else
HYPERKUBE_URL="k8s.gcr.io/hyperkube-amd64:v${KUBERNETES_VERSION}"
CONTAINER_IMAGE="k8s.gcr.io/cloud-controller-manager-amd64:v${KUBERNETES_VERSION}"
Copy link
Member

Choose a reason for hiding this comment

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

I think all of this should be outside of the if block, right? The only conditional change is to HYPERKUBE_URL, correct?

Copy link
Member Author

@jadarsie jadarsie Apr 19, 2019

Choose a reason for hiding this comment

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

Only the hyperkube image is different, cloud-controller-manager remains the same

Copy link
Member

Choose a reason for hiding this comment

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

The point is, this implementation doesn't actually pre-pull the image in the Azure Stack case. The if should be:

if [[ $KUBERNETES_VERSION == *"azs"* ]]; then
  HYPERKUBE_URL="msazurestackdocker/hyperkube-amd64:v${KUBERNETES_VERSION}"
else
  HYPERKUBE_URL="k8s.gcr.io/hyperkube-amd64:v${KUBERNETES_VERSION}"
fi

Unless I'm missing something.

Copy link
Member Author

Choose a reason for hiding this comment

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

Function extractHyperkube calls pullContainerImage $CLI_TOOL ${HYPERKUBE_URL}.

That clears your concern, right?

@acs-bot acs-bot added size/M and removed size/S labels Apr 19, 2019
backlog automation moved this from In progress to Under Review Apr 22, 2019
Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

lgtm

@jackfrancis
Copy link
Member

/lgtm

@acs-bot acs-bot added the lgtm label Apr 22, 2019
@acs-bot acs-bot merged commit 39182cd into Azure:master Apr 22, 2019
backlog automation moved this from Under Review to Done Apr 22, 2019
@welcome
Copy link

welcome bot commented Apr 22, 2019

Congrats on merging your first pull request! 🎉🎉🎉

@acs-bot
Copy link

acs-bot commented Apr 22, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jackfrancis, jadarsie

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

jackfrancis pushed a commit to jackfrancis/aks-engine that referenced this pull request Apr 23, 2019
* feat: pre-pull Azure Stack's custom Hyperkube

* Changed approach from optional params to global variables

* Update caller code instead of provisioning functions

* Updated AZS hyperkube repository

* Trust the pipeline

* Updated AZURE_STACK_K8S_VERSIONS

* Updated AZURE_STACK_K8S_VERSIONS

* Add AzS prefix to KUBERNETES_VERSION's ARM param

* cleanUpContainerImages

* fixed armvariables_test

* test

* fixed build

* Removed invalid chars, hopefully will get a Mac soon
@jadarsie jadarsie added this to In progress in Azure Stack via automation Apr 26, 2019
@jadarsie jadarsie moved this from In progress to Done in Azure Stack May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Azure Stack
  
Done
backlog
  
Done
Development

Successfully merging this pull request may close these issues.

Pre-pull Azure Stack's dependencies
6 participants