-
Notifications
You must be signed in to change notification settings - Fork 558
Add cloud-controller-manager support for Kubernetes cluster #1584
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
apiVersion: "v1" | ||
kind: "Pod" | ||
metadata: | ||
name: "cloud-controller-manager" | ||
namespace: "kube-system" | ||
labels: | ||
tier: control-plane | ||
component: cloud-controller-manager | ||
spec: | ||
hostNetwork: true | ||
containers: | ||
- name: "cloud-controller-manager" | ||
image: "<kubernetesCcmImageSpec>" | ||
command: | ||
- "cloud-controller-manager" | ||
- "--kubeconfig=/var/lib/kubelet/kubeconfig" | ||
- "--allocate-node-cidrs=<allocateNodeCidrs>" | ||
- "--cluster-cidr=<kubeClusterCidr>" | ||
- "--cluster-name=<masterFqdnPrefix>" | ||
- "--cloud-provider=azure" | ||
- "--cloud-config=/etc/kubernetes/azure.json" | ||
- "--leader-elect=true" | ||
# TODO: RBAC support | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's needed or outstanding for enabling RBAC? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is actually meant for enabling 'use-service-account-credentials', which does not work now, pending on kubernetes#53511 |
||
# - "<kubernetesEnableRbac>" | ||
- "--route-reconciliation-period=<kubernetesCtrlMgrRouteReconciliationPeriod>" | ||
- "--v=2" | ||
volumeMounts: | ||
- name: "etc-kubernetes" | ||
mountPath: "/etc/kubernetes" | ||
- name: "etc-ssl" | ||
mountPath: "/etc/ssl" | ||
readOnly: true | ||
- name: "var-lib-kubelet" | ||
mountPath: "/var/lib/kubelet" | ||
- name: msi | ||
mountPath: "/var/lib/waagent/ManagedIdentity-Settings" | ||
readOnly: true | ||
volumes: | ||
- name: "etc-kubernetes" | ||
hostPath: | ||
path: "/etc/kubernetes" | ||
- name: "etc-ssl" | ||
hostPath: | ||
path: "/etc/ssl" | ||
- name: "var-lib-kubelet" | ||
hostPath: | ||
path: "/var/lib/kubelet" | ||
- name: msi | ||
hostPath: | ||
path: "/var/lib/waagent/ManagedIdentity-Settings" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -100,6 +100,15 @@ write_files: | |
content: !!binary | | ||
MASTER_KUBERNETES_CONTROLLER_MANAGER_B64_GZIP_STR | ||
|
||
{{if UseCloudControllerManager }} | ||
- path: /etc/kubernetes/manifests/cloud-controller-manager.yaml | ||
permissions: "0644" | ||
encoding: gzip | ||
owner: "root" | ||
content: !!binary | | ||
MASTER_KUBERNETES_CLOUD_CONTROLLER_MANAGER_B64_GZIP_STR | ||
{{end}} | ||
|
||
- path: /etc/kubernetes/manifests/kube-scheduler.yaml | ||
permissions: "0644" | ||
encoding: gzip | ||
|
@@ -242,6 +251,11 @@ write_files: | |
{{else}} | ||
KUBELET_REGISTER_SCHEDULABLE={{WrapAsVariable "registerSchedulable"}} | ||
{{end}} | ||
{{if UseCloudControllerManager }} | ||
CLOUD_PROVIDER=external | ||
{{else}} | ||
CLOUD_PROVIDER=azure | ||
{{end}} | ||
|
||
- path: "/etc/systemd/system/kubelet.service" | ||
permissions: "0644" | ||
|
@@ -343,6 +357,16 @@ write_files: | |
{{end}} | ||
sed -i "s|<etcdApiVersion>|{{ .OrchestratorProfile.GetAPIServerEtcdAPIVersion }}|g" "/etc/kubernetes/manifests/kube-apiserver.yaml" | ||
|
||
{{if UseCloudControllerManager }} | ||
sed -i "s|<kubernetesCcmImageSpec>|{{WrapAsVariable "kubernetesCcmImageSpec"}}|g; s|<masterFqdnPrefix>|{{WrapAsVariable "masterFqdnPrefix"}}|g; s|<allocateNodeCidrs>|{{WrapAsVariable "allocateNodeCidrs"}}|g; s|<kubeClusterCidr>|{{WrapAsVariable "kubeClusterCidr"}}|g; s|<kubernetesCtrlMgrRouteReconciliationPeriod>|{{WrapAsVariable "kubernetesCtrlMgrRouteReconciliationPeriod"}}|g" \ | ||
/etc/kubernetes/manifests/cloud-controller-manager.yaml | ||
|
||
sed -i "/--\(cloud-config\|cloud-provider\|route-reconciliation-period\)=/d" \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this stripping off There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, both need to be updated. LIne323 |
||
/etc/kubernetes/manifests/kube-controller-manager.yaml | ||
sed -i "/--\(cloud-config\|cloud-provider\)=/d" \ | ||
/etc/kubernetes/manifests/kube-apiserver.yaml | ||
{{end}} | ||
|
||
- path: "/opt/azure/containers/provision.sh" | ||
permissions: "0744" | ||
encoding: gzip | ||
|
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 there no change needed for
kubelet.service
to include the--provider-id
flag?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.
provider-id can be detected now:
kubernetes/kubernetes#50730
https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/azure/azure_instances.go#L103