-
Notifications
You must be signed in to change notification settings - Fork 558
Conversation
pkg/acsengine/defaults.go
Outdated
// DefaultReschedulerAddonsConfig is the default rescheduler Kubernetes addon Config | ||
DefaultReschedulerAddonsConfig = api.KubernetesAddon{ | ||
Name: DefaultReschedulerAddonName, | ||
Enabled: pointerToBool(true), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be enabled by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ship this as false to be cautious, and then figure out how we want to bake the feature before turning default to true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, you could pay back some of my tech debt by changing these boolean literals inside pointerToBool()
to api.DefaultTillerAddonEnabled
and api.DefaultDashboardAddonEnabled
:)
pkg/acsengine/defaults.go
Outdated
CPURequests: "300m", | ||
MemoryRequests: "150Mi", | ||
CPULimits: "300m", | ||
MemoryLimits: "150Mi", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^^ need to discuss what default limits to use for rescheduler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should copy what's here:
(limits can copy requests)
name: rescheduler | ||
resources: | ||
requests: | ||
cpu: 10m |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// todo change this to param
@@ -570,7 +572,20 @@ func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode s | |||
if dashboardAddon.Containers[c].Image != "" { | |||
addValue(parametersMap, "kubernetesDashboardSpec", dashboardAddon.Containers[c].Image) | |||
} else { | |||
addValue(parametersMap, "kubernetesDashboardSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+KubeConfigs[k8sVersion]["dashboard"]) | |||
addValue(parametersMap, "kubernetesDashboardSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+KubeConfigs[k8sVersion][DefaultDashboardAddonName]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackfrancis is there a reason why this wasn't using the name var? is it okay that I changed it? (1/3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 and thanks!
@@ -1191,7 +1211,7 @@ func (t *TemplateGenerator) getTemplateFuncMap(cs *api.ContainerService) templat | |||
val = dashboardAddon.Containers[dC].Image | |||
} | |||
} else { | |||
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion]["dashboard"] | |||
val = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase + KubeConfigs[k8sVersion][DefaultDashboardAddonName] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackfrancis same here (2/3)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 and thanks ditto
"gchighthreshold": strconv.Itoa(DefaultKubernetesGCHighThreshold), | ||
"gclowthreshold": strconv.Itoa(DefaultKubernetesGCLowThreshold), | ||
"hyperkube": "hyperkube-amd64:v1.8.2", | ||
DefaultDashboardAddonName: "kubernetes-dashboard-amd64:v1.7.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackfrancis and here (3/3)
pkg/api/const.go
Outdated
@@ -86,4 +86,6 @@ const ( | |||
DefaultTillerAddonEnabled = true | |||
// DefaultDashboardAddonEnabled determines the acs-engine provided default for enabling kubernetes-dashboard addon | |||
DefaultDashboardAddonEnabled = true | |||
// DefaultReschedulerAddonEnabled determines the acs-engine provided default for enabling kubernetes-rescheduler addon | |||
DefaultReschedulerAddonEnabled = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True or false here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be false to match.
@@ -85,6 +85,10 @@ const ( | |||
DefaultOrchestratorName = "k8s" | |||
// DefaultEtcdDiskSize specifies the default size for Kubernetes master etcd disk volumes in GB | |||
DefaultEtcdDiskSize = "128" | |||
// DefaultReschedulerImage defines the rescheduler deployment version on Kubernetes Clusters | |||
DefaultReschedulerImage = "rescheduler:v0.3.1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the right version to use as default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's ship w/ latest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0.3.1 is the latest tag here
parts/kubernetesmastercustomdata.yml
Outdated
sed -i "s|<kubernetesReschedulerMemoryRequests>|{{WrapAsVariable "kubernetesReschedulerMemoryRequests"}}|g" "/etc/kubernetes/addons/kube-rescheduler-deployment.yaml" | ||
sed -i "s|<kubernetesReschedulerCPULimit>|{{WrapAsVariable "kubernetesReschedulerCPULimit"}}|g" "/etc/kubernetes/addons/kube-rescheduler-deployment.yaml" | ||
sed -i "s|<kubernetesReschedulerMemoryLimit>|{{WrapAsVariable "kubernetesReschedulerMemoryLimit"}}|g" "/etc/kubernetes/addons/kube-rescheduler-deployment.yaml" | ||
{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for clarity let's unindent this {{end}}
to match the `{{if``
pkg/acsengine/defaults.go
Outdated
@@ -334,6 +355,10 @@ func setOrchestratorDefaults(cs *api.ContainerService) { | |||
if a.OrchestratorProfile.KubernetesConfig.Addons[d].IsEnabled(api.DefaultDashboardAddonEnabled) { | |||
a.OrchestratorProfile.KubernetesConfig.Addons[d] = assignDefaultAddonVals(a.OrchestratorProfile.KubernetesConfig.Addons[d], DefaultDashboardAddonsConfig) | |||
} | |||
r := getAddonsIndexByName(a.OrchestratorProfile.KubernetesConfig.Addons, DefaultReschedulerAddonName) | |||
if a.OrchestratorProfile.KubernetesConfig.Addons[r].IsEnabled(api.DefaultReschedulerAddonEnabled) { | |||
a.OrchestratorProfile.KubernetesConfig.Addons[r] = assignDefaultAddonVals(a.OrchestratorProfile.KubernetesConfig.Addons[r], DefaultDashboardAddonsConfig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 2nd arg to assignDefaultAddonVals()
here should be DefaultReschedulerAddonsConfig
. (I know, copy/paste + tired eye sockets...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes thanks for catching that
pkg/acsengine/engine.go
Outdated
@@ -547,6 +548,7 @@ func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode s | |||
addValue(parametersMap, "kubernetesDNSMasqSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+KubeConfigs[k8sVersion]["dnsmasq"]) | |||
addValue(parametersMap, "kubernetesExecHealthzSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+KubeConfigs[k8sVersion]["exechealthz"]) | |||
addValue(parametersMap, "kubernetesHeapsterSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+KubeConfigs[k8sVersion]["heapster"]) | |||
addValue(parametersMap, "kubernetesReschedulerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+KubeConfigs[k8sVersion]["rescheduler"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use DefaultReschedulerAddonName
as map key here
pkg/api/types.go
Outdated
func (k *KubernetesConfig) IsReschedulerEnabled() bool { | ||
var reschedulerAddon KubernetesAddon | ||
for i := range k.Addons { | ||
if k.Addons[i].Name == "rescheduler" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use DefaultReschedulerAddonName
here
pkg/api/types_test.go
Outdated
if e != DefaultReschedulerAddonEnabled { | ||
t.Fatalf("KubernetesConfig.IsReschedulerEnabled() should return %t when no rescheduler addon has been specified, instead returned %t", DefaultReschedulerAddonEnabled, e) | ||
} | ||
c.Addons = append(c.Addons, getMockAddon("rescheduler")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use DefaultReschedulerAddonName
here
pkg/api/types_test.go
Outdated
c = KubernetesConfig{ | ||
Addons: []KubernetesAddon{ | ||
{ | ||
Name: "rescheduler", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use DefaultReschedulerAddonName
here
resources: | ||
requests: | ||
cpu: <kubernetesReschedulerCPURequests> | ||
memory: <kubernetesReschedulerCPULimit> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to be <kubernetesReschedulerMemoryRequests>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops yes thank you!
@@ -49,6 +49,7 @@ Here are the valid values for the orchestrator types: | |||
|Name of addon|Enabled by default?|How many containers|Description| | |||
|tiller|true|Delivers the Helm server-side component: tiller. See https://github.com/kubernetes/helm for more info.| | |||
|kubernetes-dashboard|true|1|Delivers the kubernetes dashboard component. See https://github.com/kubernetes/dashboard for more info.| | |||
|rescheduler|false|Delivers the kubernetes rescheduler component.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't find the kubernetes repo for rescheduler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
What this PR does / why we need it: Guaranteed scheduling of critical add-ons requires a Rescheduler pod to be running, this PR adds that Rescheduler.
Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #944Release note: