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

feat: install Windows csi proxy during cluster creation#2854

Merged
acs-bot merged 17 commits intoAzure:masterfrom
marosset:windows-csi-proxy
Mar 19, 2020
Merged

feat: install Windows csi proxy during cluster creation#2854
acs-bot merged 17 commits intoAzure:masterfrom
marosset:windows-csi-proxy

Conversation

@marosset
Copy link
Contributor

@marosset marosset commented Mar 6, 2020

Reason for Change:

Issue Fixed:

Requirements:

Notes:

@marosset
Copy link
Contributor Author

marosset commented Mar 6, 2020

/cc @kkmsft @andyzhangx

@marosset
Copy link
Contributor Author

marosset commented Mar 6, 2020

To test this add the following to WindowsProfile:
"enableCsiProxy": true,
"csiProxyUrl": "https://marosseteastus2.blob.core.windows.net/pub/csi-proxy.tar"

(I'm updating clusterdefintion.md to document these fields right now)

@marosset marosset requested a review from kkmsft March 6, 2020 21:45
@codecov
Copy link

codecov bot commented Mar 6, 2020

Codecov Report

Merging #2854 into master will increase coverage by 0.02%.
The diff coverage is 81.69%.

@@            Coverage Diff             @@
##           master    #2854      +/-   ##
==========================================
+ Coverage   72.47%   72.49%   +0.02%     
==========================================
  Files         140      141       +1     
  Lines       25612    25912     +300     
==========================================
+ Hits        18562    18785     +223     
- Misses       5981     6034      +53     
- Partials     1069     1093      +24

if e := validate.Var(w.AdminPassword, "required"); e != nil {
return errors.New("WindowsProfile.AdminPassword is required, when agent pool specifies Windows")
}
if !validatePasswordComplexity(w.AdminUsername, w.AdminPassword) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these related changes ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not related - I did some cleanup for how validation is performed for WindowsProfile here.

Copy link
Contributor

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

do have a default csiProxyUrl now?

| ----------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| adminUsername | yes | Username for the Windows adminstrator account created on each Windows node |
| adminPassword | yes | Password for the Windows adminstrator account created on each Windows node |
| csiProxyUrl | no | Path to a package containing csi proxy binaries for Windows. |
Copy link
Contributor

Choose a reason for hiding this comment

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

this is optional finally, we would have a default value for csiProxyUrl, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Once we have stable builds we'll default this URL.
We'll also want to add the csi proxy and related container images to the Windows VHD.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added the URl of a package we can use for testing to the csi-proxy doc/markdown until we have official releases for the package.

@andyzhangx
Copy link
Contributor

@marosset any progress on this? does this PR work now?

@marosset
Copy link
Contributor Author

@andyzhangx - I'm going to pick this up again and try and get this merged today
This should work as is.

@marosset
Copy link
Contributor Author

With the latest commit please use this package for testing https://kubernetesartifacts.azureedge.net/csi-proxy/master/binaries/csi-proxy.tar.gz

@marosset marosset changed the title [WIP] - install Windows csi proxy during cluster creation feat: install Windows csi proxy during cluster creation Mar 18, 2020
}

// IsCsiProxyEnabled returns true if csi proxy service should be enable for Windows nodes
func (w *WindowsProfile) IsCsiProxyEnabled() bool {
Copy link
Member

Choose a reason for hiding this comment

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

ditto ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updating everywhere (except in the powershell code :))

@marosset
Copy link
Contributor Author

I'll update casing everywhere...

if w.EnableCSIProxy != nil {
return *w.EnableCSIProxy
}
return false // DO NOT HARDCODE
Copy link
Member

Choose a reason for hiding this comment

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

should this be here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

probably not :P

pkg/api/const.go Outdated
// DefaultEnableAutomaticUpdates determines the aks-engine provided default for enabling automatic updates
DefaultEnableAutomaticUpdates = true
// DefaultEnableCSIProxyWindows determines if CSI proxy should be enabled by default for Windows nodes
DefaultEnableCSIProxyWindows = false
Copy link
Member

Choose a reason for hiding this comment

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

you can move this to api/common/const.go if it'll be shared by api/vlabs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh that works - let me do that instead of what I just did

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it to api/common/const.go

if w.EnableCSIProxy != nil {
return *w.EnableCSIProxy
}
return DefaultEnableCSIProxyWindows
Copy link
Member

Choose a reason for hiding this comment

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

this needs to be common.DefaultEnableCSIProxyWindows (assuming common is a reference to the api/common package)

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

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

added a final comment, lgtm


if ($global:EnableCsiProxy) {
New-CsiProxyService -CsiProxyPackageUrl $global:CsiProxyUrl -KubeDir $global:KubeDir
# TODO: make kubelet depeond on csi-server-proxy service if enabled
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: depend

-UseContainerD $useContainerD

if ($global:EnableCsiProxy) {
New-CsiProxyService -CsiProxyPackageUrl $global:CsiProxyUrl -KubeDir $global:KubeDir
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we please add a note in the README on where the csi proxy logs can be found in default setup.

tar -xzf $binaryPackage -C $tempdir
cp "$tempdir\build\server.exe" "$KubeDir\csi-proxy-server.exe"

del $tempdir -Recurse
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this happen whenever a new node is installed ?

#

if ($global:CsiProxyEnabled) {
Write-Log "Starting csi-proxy-server service"
Copy link
Contributor

Choose a reason for hiding this comment

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

I was thinking we would also be introducing service dependancy ? Would the start-service do sync start or would it do a start asynchronously potentially causing race scenarios with start of kubelet ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yea - forgot we had discussed this.
I will add one.


## Requirements

- CSI Proxy for Windows requires Kubernetes version 1.18.0 or greater.
Copy link
Contributor

@kkmsft kkmsft Mar 19, 2020

Choose a reason for hiding this comment

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

Can we specify beta here ? If this is a regular practice we can leave it as is...

Copy link
Contributor

@kkmsft kkmsft left a comment

Choose a reason for hiding this comment

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

Few nits there are here, but looks good overall. Thank you, @marosset
/lgtm

@acs-bot acs-bot added the lgtm label Mar 19, 2020
@acs-bot acs-bot merged commit 3e6b593 into Azure:master Mar 19, 2020
@acs-bot
Copy link

acs-bot commented Mar 19, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kkmsft, marosset

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

The pull request process is described here

Details 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

mboersma added a commit to mboersma/aks-engine that referenced this pull request Mar 19, 2020
@mboersma
Copy link
Member

@marosset our friendly acs-bot does not seem to have its tide config correct, so it merged this prematurely. I reverted the squashed commit in master and those responsible have been sacked.

@andyzhangx
Copy link
Contributor

this PR could fix that issue: #2928
would you use that in the new PR? thanks. @marosset

@marosset
Copy link
Contributor Author

whoops - i create a new PR this morning.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants