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

Conversation

@jackfrancis
Copy link
Member

What this PR does / why we need it: exposes a generic key/val interface for configuring cloud-controller-manager, using the configuration keys documented here:

https://kubernetes.io/docs/reference/generated/cloud-controller-manager/

API model usage patterns will look like this:

"kubernetesConfig": {
    <...>
    "cloudControllerManagerConfig": {
          "--route-reconciliation-period": "1m"
    }
    <...>
}
Generic controller-manager config interface

@ghost ghost assigned jackfrancis Jan 9, 2018
@ghost ghost added the in progress label Jan 9, 2018
@jackfrancis
Copy link
Member Author

@JunSun17 Kindly requesting review. :) This is the final generic k8s runtime config to expose!

Copy link
Contributor

@JunSun17 JunSun17 left a comment

Choose a reason for hiding this comment

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

Looks good to me, just clarify the comment below and good to go.


// Default cloud-controller-manager config
defaultCloudControllerManagerConfig := map[string]string{
"--node-monitor-grace-period": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
Copy link
Contributor

Choose a reason for hiding this comment

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

From the md file, the default is "--route-reconciliation-period", a typo?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! Actually, the doc is correct, it's an error in the defaultCloudControllerManagerConfig object! (see the changes to parts/k8s/manifests/kubernetesmaster-cloud-controller-manager.yaml). I'll fix.

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

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

lgtm, added a few comments

}
return strings.TrimSuffix(buf.String(), ", ")
},
"GetCloudControllerManagerConfigKeyVals": func(kc *api.KubernetesConfig) string {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it necessary to pass in the KubernetesConfig here? For distinct agent/master configs it needs to be passed in but since this looks like it's using the orchestratorProfile's kubernetesConfig here you could also use cs.Properties.OrchestratorProfile.KubernetesConfig since the getTemplateFuncMap gets passed in a ContainerService

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm actually planning to submit a follow-up PR that generalizes the getter function so that it works on map[string]strings generically.

},
"GetCloudControllerManagerConfigKeyVals": func(kc *api.KubernetesConfig) string {
cloudControllerManagerConfig := kc.CloudControllerManagerConfig
// Order by key for consistency
Copy link
Contributor

Choose a reason for hiding this comment

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

if this starts getting repeated in more configs (it's already in GetControllerManagerConfigKeyVals, GetKubeletConfigKeyVals and GetApiServerConfigKeyVals) maybe it's time to extract it to a function

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, yes! What I said above.

"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.8",
"kubernetesConfig": {
"useCloudControllerManager": true
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be beneficial to put a CloudControllerManagerConfig field here for reference

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure I want to encourage someone to use this yet until we spend some time testing various custom configurations that actually work! :)

@jackfrancis jackfrancis merged commit 5e7549d into Azure:master Jan 10, 2018
@ghost ghost removed the in progress label Jan 10, 2018
@jackfrancis jackfrancis deleted the generic-ccm branch January 10, 2018 19:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants