This repository has been archived by the owner on Jan 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 558
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generic cloud-controller-manager config interface (#2017)
* etcd client port is static 2397 * humans are the best * using vars for etcd master ports * generic cloud-controller-manager * we need this if after all * added ccm example and using helpers * debug * err.Error() for string * bye bye debug * we do need that sleep, though!
- Loading branch information
1 parent
24c19e0
commit 5e7549d
Showing
11 changed files
with
181 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
examples/kubernetes-config/kubernetes-cloud-controller-manager.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"apiVersion": "vlabs", | ||
"properties": { | ||
"orchestratorProfile": { | ||
"orchestratorType": "Kubernetes", | ||
"orchestratorRelease": "1.8", | ||
"kubernetesConfig": { | ||
"useCloudControllerManager": true | ||
} | ||
}, | ||
"masterProfile": { | ||
"count": 1, | ||
"dnsPrefix": "", | ||
"vmSize": "Standard_D2_v2" | ||
}, | ||
"agentPoolProfiles": [ | ||
{ | ||
"name": "agentpool1", | ||
"count": 3, | ||
"vmSize": "Standard_D2_v2", | ||
"availabilityProfile": "AvailabilitySet" | ||
} | ||
], | ||
"linuxProfile": { | ||
"adminUsername": "azureUser", | ||
"ssh": { | ||
"publicKeys": [ | ||
{ | ||
"keyData": "" | ||
} | ||
] | ||
} | ||
}, | ||
"servicePrincipalProfile": { | ||
"clientId": "", | ||
"secret": "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package acsengine | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/Azure/acs-engine/pkg/api" | ||
) | ||
|
||
func setCloudControllerManagerConfig(cs *api.ContainerService) { | ||
o := cs.Properties.OrchestratorProfile | ||
staticLinuxCloudControllerManagerConfig := map[string]string{ | ||
"--allocate-node-cidrs": strconv.FormatBool(!o.IsAzureCNI()), | ||
"--cloud-provider": "azure", | ||
"--cloud-config": "/etc/kubernetes/azure.json", | ||
"--cluster-cidr": o.KubernetesConfig.ClusterSubnet, | ||
"--kubeconfig": "/var/lib/kubelet/kubeconfig", | ||
"--leader-elect": "true", | ||
"--v": "2", | ||
} | ||
|
||
// Set --cluster-name based on appropriate DNS prefix | ||
if cs.Properties.MasterProfile != nil { | ||
staticLinuxCloudControllerManagerConfig["--cluster-name"] = cs.Properties.MasterProfile.DNSPrefix | ||
} else if cs.Properties.HostedMasterProfile != nil { | ||
staticLinuxCloudControllerManagerConfig["--cluster-name"] = cs.Properties.HostedMasterProfile.DNSPrefix | ||
} | ||
|
||
staticWindowsCloudControllerManagerConfig := make(map[string]string) | ||
for key, val := range staticLinuxCloudControllerManagerConfig { | ||
staticWindowsCloudControllerManagerConfig[key] = val | ||
} | ||
// Windows cloud-controller-manager config overrides | ||
// TODO placeholder for specific config overrides for Windows clusters | ||
|
||
// Default cloud-controller-manager config | ||
defaultCloudControllerManagerConfig := map[string]string{ | ||
"--node-monitor-grace-period": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod, | ||
} | ||
|
||
// If no user-configurable cloud-controller-manager config values exists, use the defaults | ||
if o.KubernetesConfig.CloudControllerManagerConfig == nil { | ||
o.KubernetesConfig.CloudControllerManagerConfig = defaultCloudControllerManagerConfig | ||
} else { | ||
for key, val := range defaultCloudControllerManagerConfig { | ||
// If we don't have a user-configurable cloud-controller-manager config for each option | ||
if _, ok := o.KubernetesConfig.CloudControllerManagerConfig[key]; !ok { | ||
// then assign the default value | ||
o.KubernetesConfig.CloudControllerManagerConfig[key] = val | ||
} | ||
} | ||
} | ||
|
||
// We don't support user-configurable values for the following, | ||
// so any of the value assignments below will override user-provided values | ||
var overrideCloudControllerManagerConfig map[string]string | ||
if cs.Properties.HasWindows() { | ||
overrideCloudControllerManagerConfig = staticWindowsCloudControllerManagerConfig | ||
} else { | ||
overrideCloudControllerManagerConfig = staticLinuxCloudControllerManagerConfig | ||
} | ||
for key, val := range overrideCloudControllerManagerConfig { | ||
o.KubernetesConfig.CloudControllerManagerConfig[key] = val | ||
} | ||
|
||
// TODO add RBAC support | ||
/*if *o.KubernetesConfig.EnableRbac { | ||
o.KubernetesConfig.CloudControllerManagerConfig["--use-service-account-credentials"] = "true" | ||
}*/ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters