diff --git a/cloud/terraform/cmd/terraform-machine-controller/Makefile b/cloud/terraform/cmd/terraform-machine-controller/Makefile index b495908eec45..dcdb88aaff94 100644 --- a/cloud/terraform/cmd/terraform-machine-controller/Makefile +++ b/cloud/terraform/cmd/terraform-machine-controller/Makefile @@ -18,7 +18,7 @@ GCR_BUCKET = k8s-cluster-api PREFIX = gcr.io/$(GCR_BUCKET) DEV_PREFIX ?= gcr.io/$(shell gcloud config get-value project) NAME = terraform-machine-controller -TAG = 0.0.3 +TAG = 0.0.4 image: docker build -t "$(PREFIX)/$(NAME):$(TAG)" -f ./Dockerfile ../../../.. diff --git a/cloud/terraform/pods.go b/cloud/terraform/pods.go index cdc5070f9bd0..4bf7dd881729 100644 --- a/cloud/terraform/pods.go +++ b/cloud/terraform/pods.go @@ -34,7 +34,7 @@ import ( var apiServerImage = "gcr.io/k8s-cluster-api/cluster-apiserver:0.0.3" var controllerManagerImage = "gcr.io/k8s-cluster-api/controller-manager:0.0.3" -var machineControllerImage = "gcr.io/k8s-cluster-api/terraform-machine-controller:0.0.3" +var machineControllerImage = "gcr.io/k8s-cluster-api/terraform-machine-controller:0.0.4" func init() { if img, ok := os.LookupEnv("MACHINE_CONTROLLER_IMAGE"); ok { diff --git a/cloud/terraform/templates.go b/cloud/terraform/templates.go index f9d4120d4838..ebb0b131797a 100644 --- a/cloud/terraform/templates.go +++ b/cloud/terraform/templates.go @@ -213,7 +213,11 @@ sysctl net.bridge.bridge-nf-call-iptables=1 # kubeadm uses 10th IP as DNS server CLUSTER_DNS_SERVER=$(prips ${SERVICE_CIDR} | head -n 11 | tail -n 1) -sed -i "s/KUBELET_DNS_ARGS=[^\"]*/KUBELET_DNS_ARGS=--cluster-dns=${CLUSTER_DNS_SERVER} --cluster-domain=${CLUSTER_DNS_DOMAIN}/" /etc/systemd/system/kubelet.service.d/10-kubeadm.conf +cat > /etc/systemd/system/kubelet.service.d/20-cloud.conf << EOF +[Service] +Environment="KUBELET_DNS_ARGS=--cluster-dns=${CLUSTER_DNS_SERVER} --cluster-domain=${CLUSTER_DNS_DOMAIN}" +Environment="KUBELET_EXTRA_ARGS=--cloud-provider=vsphere" +EOF systemctl daemon-reload systemctl restart kubelet.service @@ -295,7 +299,11 @@ chmod a+rx /usr/bin/kubeadm systemctl enable docker systemctl start docker -sed -i "s/KUBELET_DNS_ARGS=[^\"]*/KUBELET_DNS_ARGS=--cluster-dns=${CLUSTER_DNS_SERVER} --cluster-domain=${CLUSTER_DNS_DOMAIN}/" /etc/systemd/system/kubelet.service.d/10-kubeadm.conf +cat > /etc/systemd/system/kubelet.service.d/20-cloud.conf << EOF +[Service] +Environment="KUBELET_DNS_ARGS=--cluster-dns=${CLUSTER_DNS_SERVER} --cluster-domain=${CLUSTER_DNS_DOMAIN}" +Environment="KUBELET_EXTRA_ARGS=--cloud-provider=vsphere --cloud-config=/etc/kubernetes/cloud-config/cloud-config.yaml" +EOF systemctl daemon-reload systemctl restart kubelet.service ` + @@ -304,10 +312,37 @@ echo $PRIVATEIP > /tmp/.ip ` + "PUBLICIP=`ip route get 8.8.8.8 | awk '{printf \"%s\", $NF; exit}'`" + ` +# Set up kubeadm config file to pass parameters to kubeadm init. +cat > /etc/kubernetes/kubeadm_config.yaml <