Skip to content

Commit

Permalink
Update conditionals to match both N series and device plugin
Browse files Browse the repository at this point in the history
BUGFIX - Update docker runtime on NON GPU enabled machines
Add accelerator label to GPU enabled nodes
Add nodeselector label match where accelerator=nvidia for nvidia-device-plugin
  • Loading branch information
lachie83 committed Jun 6, 2018
1 parent e9f061e commit 2511e6f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,4 @@ spec:
path: /var/lib/kubelet/device-plugins
nodeSelector:
beta.kubernetes.io/os: linux
accelerator: nvidia
6 changes: 4 additions & 2 deletions parts/k8s/kubernetesagentcustomdata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ write_files:
"log-opts": {
"max-size": "50m",
"max-file": "5"
}{{if IsNVIDIADevicePluginEnabled}}
}{{if IsNSeriesSKU .}}{{if IsNVIDIADevicePluginEnabled}}
,"default-runtime": "nvidia",
"runtimes": {
"nvidia": {
"path": "/usr/bin/nvidia-container-runtime",
"runtimeArgs": []
}
}{{end}}
}{{end}}{{end}}
}
- path: "/etc/kubernetes/certs/ca.crt"
Expand Down Expand Up @@ -138,8 +138,10 @@ write_files:
KUBELET_REGISTER_SCHEDULABLE=true
KUBELET_NODE_LABELS={{GetAgentKubernetesLabels . "',variables('labelResourceGroup'),'"}}
{{if IsNSeriesSKU .}}
{{if IsNVIDIADevicePluginEnabled}}
KUBELET_REGISTER_WITH_TAINTS=--register-with-taints={{WrapAsVariable "registerWithGpuTaints"}}
{{end}}
{{end}}

AGENT_ARTIFACTS_CONFIG_PLACEHOLDER

Expand Down
2 changes: 2 additions & 0 deletions parts/k8s/kubernetesbase.t
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"{{.Name}}Index": {{$index}},
{{template "k8s/kubernetesagentvars.t" .}}
{{if IsNSeriesSKU .}}
{{if IsNVIDIADevicePluginEnabled}}
"registerWithGpuTaints": "nvidia.com/gpu=true:NoSchedule",
{{end}}
{{end}}
{{if .IsStorageAccount}}
{{if .HasDisks}}
Expand Down
4 changes: 4 additions & 0 deletions pkg/acsengine/template_generator.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat
storagetier, _ := getStorageAccountType(profile.VMSize)
buf.WriteString(fmt.Sprintf(",storageprofile=managed,storagetier=%s", storagetier))
}
if isNSeriesSKU(profile) {
accelerator := "nvidia"
buf.WriteString(fmt.Sprintf(",accelerator=%s", accelerator))
}
buf.WriteString(fmt.Sprintf(",kubernetes.azure.com/cluster=%s", rg))
for k, v := range profile.CustomNodeLabels {
buf.WriteString(fmt.Sprintf(",%s=%s", k, v))
Expand Down

0 comments on commit 2511e6f

Please sign in to comment.