This commit is contained in:
Anthony Howe 2017-10-13 19:18:05 -07:00 коммит произвёл GitHub
Родитель 20cefd4b0d
Коммит c120d50505
4 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -119,6 +119,11 @@ write_files:
{{if IsKubernetesVersionGe "1.6.0"}}
KUBELET_NON_MASQUERADE_CIDR=--non-masquerade-cidr={{WrapAsVariable "kubernetesNonMasqueradeCidr"}}
KUBELET_FEATURE_GATES=--feature-gates=Accelerators=true
{{if IsKubernetesVersionTilde "1.6.x"}}
KUBELET_FIX_43704_1=--cgroups-per-qos=false
KUBELET_FIX_43704_2=--enforce-node-allocatable=
KUBELET_FIX_43704_3=""
{{end}}
{{end}}
- path: "/etc/systemd/system/kubelet.service"

Просмотреть файл

@ -37,6 +37,8 @@ ExecStart=/usr/bin/docker run \
--pod-infra-container-image="${KUBELET_POD_INFRA_CONTAINER_IMAGE}" \
--address=0.0.0.0 \
--allow-privileged=true \
${KUBELET_FIX_43704_1} \
${KUBELET_FIX_43704_2}${KUBELET_FIX_43704_3} \
--enable-server \
--pod-manifest-path=/etc/kubernetes/manifests \
--cluster-dns=${KUBELET_CLUSTER_DNS} \

Просмотреть файл

@ -215,9 +215,15 @@ write_files:
KUBELET_REGISTER_NODE=--register-node=true
KUBELET_REGISTER_WITH_TAINTS=--register-with-taints={{WrapAsVariable "registerWithTaints"}}
{{end}}
{{if IsKubernetesVersionTilde "1.6.x"}}
KUBELET_FIX_43704_1=--cgroups-per-qos=false
KUBELET_FIX_43704_2=--enforce-node-allocatable=
KUBELET_FIX_43704_3=""
{{end}}
{{else}}
KUBELET_REGISTER_SCHEDULABLE={{WrapAsVariable "registerSchedulable"}}
{{end}}
- path: "/etc/systemd/system/kubelet.service"
permissions: "0644"
encoding: gzip

Просмотреть файл

@ -732,6 +732,14 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat
constraint, _ := semver.NewConstraint(">=" + version)
return cs.Properties.OrchestratorProfile.OrchestratorType == api.Kubernetes && constraint.Check(orchestratorVersion)
},
"IsKubernetesVersionTilde": func(version string) bool {
// examples include
// ~2.3 is equivalent to >= 2.3, < 2.4
// ~1.2.x is equivalent to >= 1.2.0, < 1.3.0
orchestratorVersion, _ := semver.NewVersion(cs.Properties.OrchestratorProfile.OrchestratorVersion)
constraint, _ := semver.NewConstraint("~" + version)
return cs.Properties.OrchestratorProfile.OrchestratorType == api.Kubernetes && constraint.Check(orchestratorVersion)
},
"GetKubernetesLabels": func(profile *api.AgentPoolProfile) string {
var buf bytes.Buffer
buf.WriteString(fmt.Sprintf("kubernetes.io/role=agent,agentpool=%s", profile.Name))