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

Commit

Permalink
feat: installing csi-proxy for windows at node deployment time (#2930)
Browse files Browse the repository at this point in the history
  • Loading branch information
marosset committed Mar 19, 2020
1 parent 581acdf commit 13e72f2
Show file tree
Hide file tree
Showing 22 changed files with 459 additions and 24 deletions.
2 changes: 2 additions & 0 deletions docs/topics/clusterdefinitions.md
Expand Up @@ -813,6 +813,8 @@ https://{keyvaultname}.vault.azure.net:443/secrets/{secretName}/{version}
| ----------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 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. |
| enableCSIProxy | no | If set to `true` the csi-proxy specified by `windowsProfile.csiProxyURL` will get installed during node provisioning. See [Windows Csi Proxy](csi-proxy-windows.md) for more details. |
| windowsPublisher | no | Publisher used to find Windows VM to deploy from marketplace. Default: `microsoft-aks` |
| windowsOffer | no | Offer used to find Windows VM to deploy from marketplace. Default: `aks-windows` |
| windowsSku | no | SKU usedto find Windows VM to deploy from marketplace. Default: `2019-datacenter-core-smalldisk` |
Expand Down
31 changes: 31 additions & 0 deletions docs/topics/csi-proxy-windows.md
@@ -0,0 +1,31 @@
# CSI Proxy for Windows

CSI Proxy for Windows enables support for CSI Plugins on Kubernetes nodes running Windows.

More info can be found in the following places:

- <https://github.com/kubernetes/enhancements/blob/master/keps/sig-windows/20190714-windows-csi-support.md>
- <https://github.com/kubernetes-csi/csi-proxy>

## Requirements

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

## Usage

### Enable in aks-engine

Add the following fields to `windowsProfile`:

```json
"windowsProfile": {
...
"enableCSIProxy": true,
"csiProxyURL": "<Path to a package containing Windows csi proxy binaries>"
...
}
```

For testing purposes the following csi-proxy binary may be used:

- https://kubernetesartifacts.azureedge.net/csi-proxy/master/binaries/csi-proxy.tar.gz
3 changes: 2 additions & 1 deletion go.mod
Expand Up @@ -3,6 +3,7 @@ module github.com/Azure/aks-engine
go 1.14

require (
github.com/Azure/aks-engine/test/e2e v0.0.0-20200318043210-65f753070203 // indirect
github.com/Azure/azure-sdk-for-go v36.2.0+incompatible
github.com/Azure/go-autorest/autorest v0.9.2
github.com/Azure/go-autorest/autorest/adal v0.8.0
Expand Down Expand Up @@ -47,7 +48,7 @@ require (
github.com/spf13/cobra v0.0.3
github.com/spf13/pflag v1.0.3
github.com/x-cray/logrus-prefixed-formatter v0.5.2
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2
golang.org/x/crypto v0.0.0-20191105034135-c7e5f84aec59
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 // indirect
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6 // indirect
Expand Down
10 changes: 10 additions & 0 deletions go.sum
@@ -1,4 +1,7 @@
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/Azure/aks-engine v0.43.0/go.mod h1:p5hWLR68415U2Qa8B+72KkNxTVTMUW4OXgao3tNnyeM=
github.com/Azure/aks-engine/test/e2e v0.0.0-20200318043210-65f753070203 h1:1W9nSVgKaEQuHnWgjXMclWrzpOoWr+P81ENpsVVefMg=
github.com/Azure/aks-engine/test/e2e v0.0.0-20200318043210-65f753070203/go.mod h1:l2ouajPEF2NOAKpMaTgxYsf5+1mhbcHgXyuV4vVOBzs=
github.com/Azure/azure-sdk-for-go v36.2.0+incompatible h1:09cv2WoH0g6jl6m2iT+R9qcIPZKhXEL0sbmLhxP895s=
github.com/Azure/azure-sdk-for-go v36.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI=
Expand Down Expand Up @@ -75,12 +78,14 @@ github.com/imdario/mergo v0.3.6 h1:xTNEAn+kxVO7dTZGu0CegyqKZmoWFI0rF8UxjlB2d28=
github.com/imdario/mergo v0.3.6/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA=
github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
github.com/influxdata/influxdb v1.7.9/go.mod h1:qZna6X/4elxqT3yI9iZYdZrWWdeFOOprn86kgg4+IzY=
github.com/jarcoal/httpmock v1.0.1 h1:OXIOrglWeSllwHQGJ5X4PX4hFZK1DPCXSJVhMSJacg8=
github.com/jarcoal/httpmock v1.0.1/go.mod h1:ATjnClrvW/3tijVmpL/va5Z3aAyGvqU3gCT8nX0Txik=
github.com/json-iterator/go v1.1.7 h1:KfgG9LzI+pYjr4xvmz/5H4FXjokeP+rlHLhv3iH62Fo=
github.com/json-iterator/go v1.1.7/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/kelseyhightower/envconfig v1.4.0/go.mod h1:cccZRl6mQpaq41TPp5QxidR+Sa3axMbJDNb//FQX6Gg=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
Expand Down Expand Up @@ -137,11 +142,15 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJ
github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191105034135-c7e5f84aec59 h1:PyXRxSVbvzDGuqYXjHndV7xDzJ7w2K8KD9Ef8GB7KOE=
golang.org/x/crypto v0.0.0-20191105034135-c7e5f84aec59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand All @@ -150,6 +159,7 @@ golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191104094858-e8c54fb511f6 h1:ZJUmhYTp8GbGC0ViZRc2U+MIYQ8xx9MscsdXnclfIhw=
Expand Down
4 changes: 3 additions & 1 deletion parts/k8s/kuberneteswindowsfunctions.ps1
@@ -1,4 +1,5 @@
# This is a temporary file to test dot-sourcing functions stored in separate scripts in a zip file
# This filter removes null characters (\0) which are captured in nssm.exe output when logged through powershell
filter RemoveNulls { $_ -replace '\0', '' }

filter Timestamp {"$(Get-Date -Format o): $_"}

Expand Down Expand Up @@ -209,6 +210,7 @@ function Register-NodeResetScriptTask {
Write-Log "Creating a startup task to run windowsnodereset.ps1"

(Get-Content 'c:\AzureData\k8s\windowsnodereset.ps1') |
Foreach-Object { $_ -replace '{{CsiProxyEnabled}}', $global:EnableCsiProxy } |
Foreach-Object { $_ -replace '{{MasterSubnet}}', $global:MasterSubnet } |
Foreach-Object { $_ -replace '{{NetworkMode}}', $global:NetworkMode } |
Foreach-Object { $_ -replace '{{NetworkPlugin}}', $global:NetworkPlugin } |
Expand Down
11 changes: 11 additions & 0 deletions parts/k8s/kuberneteswindowssetup.ps1
Expand Up @@ -136,6 +136,10 @@ $global:VNetCNIPluginsURL = "{{WrapAsParameter "vnetCniWindowsPluginsURL"}}"
$global:EnableTelemetry = "{{WrapAsVariable "enableTelemetry" }}";
$global:TelemetryKey = "{{WrapAsVariable "applicationInsightsKey" }}";

# CSI Proxy settings
$global:EnableCsiProxy = [System.Convert]::ToBoolean("{{WrapAsVariable "windowsEnableCSIProxy" }}");
$global:CsiProxyUrl = "{{WrapAsVariable "windowsCSIProxyURL" }}";

# Base64 representation of ZIP archive
$zippedFiles = "{{ GetKubernetesWindowsAgentFunctions }}"

Expand All @@ -149,6 +153,7 @@ Expand-Archive scripts.zip -DestinationPath "C:\\AzureData\\"
. c:\AzureData\k8s\windowskubeletfunc.ps1
. c:\AzureData\k8s\windowscnifunc.ps1
. c:\AzureData\k8s\windowsazurecnifunc.ps1
. c:\AzureData\k8s\windowscsiproxyfunc.ps1
. c:\AzureData\k8s\windowsinstallopensshfunc.ps1
. c:\AzureData\k8s\windowscontainerdfunc.ps1

Expand Down Expand Up @@ -284,6 +289,10 @@ try
Write-CACert -CACertificate $global:CACertificate `
-KubeDir $global:KubeDir

if ($global:EnableCsiProxy) {
New-CsiProxyService -CsiProxyPackageUrl $global:CsiProxyUrl -KubeDir $global:KubeDir
}

Write-Log "Write kube config"
Write-KubeConfig -CACertificate $global:CACertificate `
-KubeDir $global:KubeDir `
Expand Down Expand Up @@ -378,6 +387,8 @@ try
-KubeletNodeLabels $global:KubeletNodeLabels `
-UseContainerD $useContainerD



Get-LogCollectionScripts

Write-Log "Disable Internet Explorer compat mode and set homepage"
Expand Down
35 changes: 35 additions & 0 deletions parts/k8s/windowscsiproxyfunc.ps1
@@ -0,0 +1,35 @@
function New-CsiProxyService {
Param(
[Parameter(Mandatory = $true)][string]
$CsiProxyPackageUrl,
[Parameter(Mandatory = $true)][string]
$KubeDir
)

$tempdir = New-TemporaryDirectory
$binaryPackage = "$tempdir\csiproxy.tar"

DownloadFileOverHttp -Url $CsiProxyPackageUrl -DestinationPath $binaryPackage

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

del $tempdir -Recurse

& "$KubeDir\nssm.exe" install csi-proxy-server "$KubeDir\csi-proxy-server.exe" | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppDirectory "$KubeDir" | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppRestartDekay 5000 | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server Description csi-proxy-server | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server Start SERVICE_DEMAND_START | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server ObjectName LocalSystem | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server Type SERVICE_WIN32_OWN_PROCESS | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppThrottle 1500 | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppStdout "$KubeDir\csi-proxy-server.log" | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppStderr "$KubeDir\csi-proxy-server.err.log" | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppStdoutCreationDisposition 4 | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppStderrCreationDisposition 4 | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppRotateFiles 1 | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppRotateOnline 1 | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppRotateSeconds 86400 | RemoveNulls
& "$KubeDir\nssm.exe" set csi-proxy-server AppRotateBytes 10485760 | RemoveNulls
}
10 changes: 6 additions & 4 deletions parts/k8s/windowskubeletfunc.ps1
Expand Up @@ -302,9 +302,6 @@ Get-KubeBinaries {
del $tempdir -Recurse
}

# This filter removes null characters (\0) which are captured in nssm.exe output when logged through powershell
filter RemoveNulls { $_ -replace '\0', '' }

# TODO: replace KubeletStartFile with a Kubelet config, remove NSSM, and use built-in service integration
function
New-NSSMService {
Expand All @@ -320,13 +317,18 @@ New-NSSMService {
$KubeProxyStartFile
)

$kubeletDependOnServices = "docker"
if ($global:EnableCsiProxy) {
$kubeletDependOnServices += " csi-proxy-server"
}

# setup kubelet
& "$KubeDir\nssm.exe" install Kubelet C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet AppDirectory $KubeDir | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet AppParameters $KubeletStartFile | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet DisplayName Kubelet | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet AppRestartDelay 5000 | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet DependOnService docker | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet DependOnService "$kubeletDependOnServices" | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet Description Kubelet | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet Start SERVICE_DEMAND_START | RemoveNulls
& "$KubeDir\nssm.exe" set Kubelet ObjectName LocalSystem | RemoveNulls
Expand Down
12 changes: 12 additions & 0 deletions parts/k8s/windowsnodereset.ps1
Expand Up @@ -8,6 +8,7 @@ $global:LogPath = "c:\k\windowsnodereset.log"
$global:HNSModule = "c:\k\hns.psm1"

# Note: the following templated values are expanded kuberneteswindowsfunctions.ps1/Register-NodeResetScriptTask() not during template generation!
$global:CsiProxyEnabled = [System.Convert]::ToBoolean("{{CsiProxyEnabled}}")
$global:MasterSubnet = "{{MasterSubnet}}"
$global:NetworkMode = "{{NetworkMode}}"
$global:NetworkPlugin = "{{NetworkPlugin}}"
Expand All @@ -31,6 +32,11 @@ Stop-Service kubeproxy
Write-Log "Stopping kubelet service"
Stop-Service kubelet

if ($global:CsiProxyEnabled) {
Write-Log "Stopping csi-proxy-server service"
Stop-Service csi-proxy-server
}

#
# Perform cleanup
#
Expand Down Expand Up @@ -83,6 +89,12 @@ if ($global:NetworkPlugin -eq 'kubenet') {
#
# Start Services
#

if ($global:CsiProxyEnabled) {
Write-Log "Starting csi-proxy-server service"
Start-Service csi-proxy-server
}

Write-Log "Starting kubelet service"
Start-Service kubelet

Expand Down
2 changes: 2 additions & 0 deletions pkg/api/common/const.go
Expand Up @@ -39,6 +39,8 @@ const (
MaxIPAddressCount = 256
// address relative to the first consecutive Kubernetes static IP
DefaultInternalLbStaticIPOffset = 10
// DefaultEnableCSIProxyWindows determines if CSI proxy should be enabled by default for Windows nodes
DefaultEnableCSIProxyWindows = false
)

// Availability profiles
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/converterfromapi.go
Expand Up @@ -184,6 +184,8 @@ func convertLinuxProfileToVLabs(obj *LinuxProfile, vlabsProfile *vlabs.LinuxProf
func convertWindowsProfileToVLabs(api *WindowsProfile, vlabsProfile *vlabs.WindowsProfile) {
vlabsProfile.AdminUsername = api.AdminUsername
vlabsProfile.AdminPassword = api.AdminPassword
vlabsProfile.CSIProxyURL = api.CSIProxyURL
vlabsProfile.EnableCSIProxy = api.EnableCSIProxy
if api.ImageRef != nil {
vlabsProfile.ImageRef = &vlabs.ImageReference{}
vlabsProfile.ImageRef.Gallery = api.ImageRef.Gallery
Expand Down
2 changes: 2 additions & 0 deletions pkg/api/convertertoapi.go
Expand Up @@ -178,6 +178,8 @@ func convertVLabsLinuxProfile(vlabs *vlabs.LinuxProfile, api *LinuxProfile) {
func convertVLabsWindowsProfile(vlabs *vlabs.WindowsProfile, api *WindowsProfile) {
api.AdminUsername = vlabs.AdminUsername
api.AdminPassword = vlabs.AdminPassword
api.CSIProxyURL = vlabs.CSIProxyURL
api.EnableCSIProxy = vlabs.EnableCSIProxy
if vlabs.ImageRef != nil {
api.ImageRef = &ImageReference{}
api.ImageRef.Gallery = vlabs.ImageRef.Gallery
Expand Down
10 changes: 10 additions & 0 deletions pkg/api/types.go
Expand Up @@ -210,6 +210,8 @@ type CustomNodesDNS struct {
type WindowsProfile struct {
AdminUsername string `json:"adminUsername"`
AdminPassword string `json:"adminPassword" conform:"redact"`
CSIProxyURL string `json:"csiProxyURL,omitempty"`
EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"`
ImageRef *ImageReference `json:"imageReference,omitempty"`
ImageVersion string `json:"imageVersion"`
WindowsImageSourceURL string `json:"windowsImageSourceURL"`
Expand Down Expand Up @@ -1708,6 +1710,14 @@ func (a *AgentPoolProfile) GetKubernetesLabels(rg string, deprecated bool) strin
return buf.String()
}

// IsCSIProxyEnabled returns true if csi proxy service should be enable for Windows nodes
func (w *WindowsProfile) IsCSIProxyEnabled() bool {
if w.EnableCSIProxy != nil {
return *w.EnableCSIProxy
}
return common.DefaultEnableCSIProxyWindows
}

// HasSecrets returns true if the customer specified secrets to install
func (w *WindowsProfile) HasSecrets() bool {
return len(w.Secrets) > 0
Expand Down
10 changes: 10 additions & 0 deletions pkg/api/vlabs/types.go
Expand Up @@ -162,6 +162,8 @@ type CustomNodesDNS struct {
type WindowsProfile struct {
AdminUsername string `json:"adminUsername,omitempty"`
AdminPassword string `json:"adminPassword,omitempty"`
CSIProxyURL string `json:"csiProxyURL,omitempty"`
EnableCSIProxy *bool `json:"enableCSIProxy,omitempty"`
ImageRef *ImageReference `json:"imageReference,omiteempty"`
ImageVersion string `json:"imageVersion,omitempty"`
WindowsImageSourceURL string `json:"WindowsImageSourceUrl"`
Expand Down Expand Up @@ -887,6 +889,14 @@ func (l *LinuxProfile) HasCustomNodesDNS() bool {
return false
}

// IsCSIProxyEnabled returns true if CSI proxy service should be enable for Windows nodes
func (w *WindowsProfile) IsCSIProxyEnabled() bool {
if w.EnableCSIProxy != nil {
return *w.EnableCSIProxy
}
return common.DefaultEnableCSIProxyWindows
}

// IsSwarmMode returns true if this template is for Swarm Mode orchestrator
func (o *OrchestratorProfile) IsSwarmMode() bool {
return o.OrchestratorType == SwarmMode
Expand Down

0 comments on commit 13e72f2

Please sign in to comment.