From 1e8a85f9e860d84758b7eeeef98194c83d961e65 Mon Sep 17 00:00:00 2001 From: Cole Mickens Date: Wed, 15 Jun 2016 22:39:36 -0700 Subject: [PATCH] changes for some of initial feedback --- min-turnup/Dockerfile | 19 +++---------------- min-turnup/Makefile | 3 +++ min-turnup/README-azure | 13 ------------- min-turnup/phase1/azure/configure-vm.sh | 8 +++----- min-turnup/phase2/ansible/Makefile | 3 +-- .../roles/master/templates/etcd.json.j2 | 8 ++++++-- .../roles/node/templates/kubelet.service.j2 | 6 ++---- 7 files changed, 18 insertions(+), 42 deletions(-) delete mode 100644 min-turnup/README-azure diff --git a/min-turnup/Dockerfile b/min-turnup/Dockerfile index e54c441ce..5ecbe3843 100644 --- a/min-turnup/Dockerfile +++ b/min-turnup/Dockerfile @@ -5,25 +5,12 @@ RUN bash -c "\ apt-get install -y make unzip jq && \ rm -rf /var/lib/apt/lists/*" -ENV TERRAFORM_VERSION 0.7.0-rc1 +ENV TERRAFORM_VERSION 0.7.0-rc2 RUN bash -c "\ wget -q -O /tmp/terraform.zip \"https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip\" && \ unzip /tmp/terraform.zip -d /usr/local/bin/ && \ rm /tmp/terraform.zip" -################################################################################################ -# TEMP: For now get terraform from source so we get ipv4 forwarding for Azure -################################################################################################ -#RUN bash -c "\ -# apt-get update && apt-get -y upgrade && \ -# apt-get install -y nodejs npm golang-go && \ -# rm -rf /var/lib/apt/lists/*" -#ENV GOPATH "/root/gopkgs" -#ENV PATH "$GOPATH/bin:$PATH" -#RUN bash -c "mkdir -p $GOPATH/src/github.com/hashicorp/ && \ -# git clone https://github.com/hashicorp/terraform $GOPATH/src/github.com/hashicorp/terraform && \ -# cd $GOPATH/src/github.com/hashicorp/terraform; make dev" - ################################################################################################ # Azure - Required dependencies ################################################################################################ @@ -46,8 +33,8 @@ RUN bash -c "\ make; \ cp jsonnet /usr/bin/jsonnet;" -WORKDIR /opt/kube-deploy +WORKDIR /opt/kube-min-turnup -ADD . /opt/kube-deploy/ +ADD . /opt/kube-min-turnup/ CMD make diff --git a/min-turnup/Makefile b/min-turnup/Makefile index 7ff84243d..07c76655d 100644 --- a/min-turnup/Makefile +++ b/min-turnup/Makefile @@ -24,6 +24,9 @@ docker-build: docker build -t kube-min-turnup . docker-run: docker-build + docker run -it --net=host kube-min-turnup /bin/bash + +docker-dev: docker-build docker run -it --net=host -v `pwd`:/opt/kube-min-turnup kube-min-turnup /bin/bash default: diff --git a/min-turnup/README-azure b/min-turnup/README-azure deleted file mode 100644 index 7fb621d81..000000000 --- a/min-turnup/README-azure +++ /dev/null @@ -1,13 +0,0 @@ -Things: - -1. Hardcodes assumptions about ubuntu+systemd -2. terraform is flaky around the subnet -3. terraform is flaky around kubelet.tar sometimes -4. kubelet.service is very flaky and hang irrepairably hang nodes -5. phases are fairly tightly coupled - -Other things: - -1. This copies root ca private key to the nodes which is not needed - -2. I don't see `config.phase2.extra-api-sans` being used anywhere... diff --git a/min-turnup/phase1/azure/configure-vm.sh b/min-turnup/phase1/azure/configure-vm.sh index 39a44d9db..078974739 100644 --- a/min-turnup/phase1/azure/configure-vm.sh +++ b/min-turnup/phase1/azure/configure-vm.sh @@ -18,8 +18,6 @@ EOF curl -sSL https://get.docker.com/ | sh -apt-get update -#apt-get dist-upgrade -y apt-get install -y jq systemctl start docker || true @@ -32,8 +30,9 @@ fi azure_file="/etc/kubernetes/azure.json" config_file="/etc/kubernetes/k8s_config.json" -mkdir /etc/kubernetes -# these get filled in from terraform +mkdir -p /etc/kubernetes + +# the following values are populated by terraform echo -n "${azure_json}" | base64 -d > "$azure_file" echo -n "${k8s_config}" | base64 -d > "$config_file" echo -n "${kubelet_tar}" | base64 -d > "/etc/kubernetes/kubelet.tar" @@ -66,4 +65,3 @@ EOF chmod +x /etc/kubernetes/install.sh /etc/kubernetes/install.sh -#sudo reboot diff --git a/min-turnup/phase2/ansible/Makefile b/min-turnup/phase2/ansible/Makefile index ecc1f1046..e012d9f0f 100644 --- a/min-turnup/phase2/ansible/Makefile +++ b/min-turnup/phase2/ansible/Makefile @@ -1,6 +1,5 @@ TAG=v1 -#IMAGE=gcr.io/mikedanese-k8s/install-k8s -IMAGE=docker.io/colemickens/install-k8s +IMAGE?=docker.io/colemickens/install-k8s build: docker build -t "$(IMAGE):$(TAG)" . diff --git a/min-turnup/phase2/ansible/playbooks/roles/master/templates/etcd.json.j2 b/min-turnup/phase2/ansible/playbooks/roles/master/templates/etcd.json.j2 index f8616527e..c1be50ff5 100644 --- a/min-turnup/phase2/ansible/playbooks/roles/master/templates/etcd.json.j2 +++ b/min-turnup/phase2/ansible/playbooks/roles/master/templates/etcd.json.j2 @@ -47,7 +47,7 @@ "volumeMounts": [ { "name": "varetcd", - "mountPath": "/var/lib/etcd" + "mountPath": "/var/etcd" } ] } @@ -56,7 +56,11 @@ { "name": "varetcd", "hostPath": { - "path": "/var/lib/etcd" +{% if phase1['cloud_provider'] == "gce" %} + "path": "/mnt/master-pd/var/etcd" +{% elif phase1['cloud_provider'] == "azure" %} + "path": "/var/etcd" +{% endif %} } } ] diff --git a/min-turnup/phase2/ansible/playbooks/roles/node/templates/kubelet.service.j2 b/min-turnup/phase2/ansible/playbooks/roles/node/templates/kubelet.service.j2 index 99d4bf136..6348a0d9f 100644 --- a/min-turnup/phase2/ansible/playbooks/roles/node/templates/kubelet.service.j2 +++ b/min-turnup/phase2/ansible/playbooks/roles/node/templates/kubelet.service.j2 @@ -25,21 +25,19 @@ ExecStart=/usr/bin/docker run \ --cloud-config="/etc/kubernetes/azure.json" \ {% endif %} --enable-server \ - --register-node=true \ --register-schedulable={{ role == "node" }} \ --enable-debugging-handlers \ --api-servers=https://{{ master_ip }} \ --kubeconfig=/srv/kubernetes/kubeconfig.json \ -{% if role == "master" %} --config=/etc/kubernetes/manifests \ -{% elif role == "node" %} +{% if role == "node" %} --hairpin-mode=promiscuous-bridge \ --network-plugin=kubenet \ --reconcile-cidr \ {% endif %} --cluster-dns=10.3.0.10 \ --cluster-domain=cluster.local \ - --v=9 + --v=2 Restart=always KillMode=process