Skip to content
This repository was archived by the owner on Jul 30, 2021. It is now read-only.

Commit 839838d

Browse files
author
Yifan Gu
authored
Merge pull request #428 from yifan-gu/use_local_bootkube
hack/*, RELEASE.md: Use local static binary for quickstart and conformance test.
2 parents 0972d14 + 741372f commit 839838d

File tree

5 files changed

+13
-39
lines changed

5 files changed

+13
-39
lines changed

RELEASING.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
- Update on-host kubelet versions (`KUBELET_IMAGE_TAG`)
1212
- hack/multi-node/user-data.sample
1313
- hack/single-node/user-data.sample
14+
- hack/quickstart/kubelet.master
15+
- hack/quickstart/kubelet.worker
1416

1517
### Update conformance test k8s version
1618

@@ -54,20 +56,6 @@ Or, manually:
5456
git checkout vX.Y.Z
5557
PUSH_IMAGE=true ./build/build-image.sh
5658
```
57-
58-
# Updating quickstart guides
59-
60-
Note: the quickstart guides use the release images, so we should not update them until after building/pushing new release.
61-
62-
Update on-host kubelet version (`KUBELET_IMAGE_TAG`)
63-
64-
- hack/quickstart/kubelet.master
65-
- hack/quickstart/kubelet.worker
66-
67-
Update the bootkube image version (to latest release)
68-
69-
- hack/quickstart/init-master.sh (`BOOTKUBE_VERSION`)
70-
7159
# Updating checkpointer
7260

7361
This only needs to happen when changes have been made to the checkpointer code / container.

hack/quickstart/init-master.sh

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ IDENT=${IDENT:-${HOME}/.ssh/id_rsa}
88
SSH_OPTS=${SSH_OPTS:-}
99
SELF_HOST_ETCD=${SELF_HOST_ETCD:-false}
1010

11-
BOOTKUBE_REPO=${BOOTKUBE_REPO:-quay.io/coreos/bootkube}
12-
BOOTKUBE_VERSION=${BOOTKUBE_VERSION:-v0.3.13}
13-
1411
function usage() {
1512
echo "USAGE:"
1613
echo "$0: <remote-host>"
@@ -52,11 +49,7 @@ function init_master_node() {
5249
fi
5350

5451
# Render cluster assets
55-
/usr/bin/rkt run \
56-
--volume home,kind=host,source=/home/core \
57-
--mount volume=home,target=/core \
58-
--trust-keys-from-https --net=host ${BOOTKUBE_REPO}:${BOOTKUBE_VERSION} --exec \
59-
/bootkube -- render --asset-dir=/core/assets --api-servers=https://${COREOS_PUBLIC_IPV4}:443,https://${COREOS_PRIVATE_IPV4}:443 ${etcd_render_flags}
52+
/home/core/bootkube -- render --asset-dir=/home/core/assets --api-servers=https://${COREOS_PUBLIC_IPV4}:443,https://${COREOS_PRIVATE_IPV4}:443 ${etcd_render_flags}
6053

6154
# Move the local kubeconfig into expected location
6255
chown -R core:core /home/core/assets
@@ -68,13 +61,7 @@ function init_master_node() {
6861
systemctl enable kubelet; sudo systemctl start kubelet
6962

7063
# Start bootkube to launch a self-hosted cluster
71-
/usr/bin/rkt run \
72-
--volume home,kind=host,source=/home/core \
73-
--mount volume=home,target=/core \
74-
--volume manifests,kind=host,source=/etc/kubernetes/manifests \
75-
--mount volume=manifests,target=/etc/kubernetes/manifests \
76-
--net=host ${BOOTKUBE_REPO}:${BOOTKUBE_VERSION} --exec \
77-
/bootkube -- start --asset-dir=/core/assets ${etcd_start_flags}
64+
/home/core/bootkube -- start --asset-dir=/home/core/assets ${etcd_start_flags}
7865
}
7966

8067
[ "$#" == 1 ] || usage
@@ -84,16 +71,19 @@ function init_master_node() {
8471
exit 1
8572
}
8673

87-
# This script can execute on a remote host by copying itself + kubelet service unit to remote host.
74+
# This script can execute on a remote host by copying itself + bootkube binary + kubelet service unit to remote host.
8875
# After assets are available on the remote host, the script will execute itself in "local" mode.
8976
if [ "${REMOTE_HOST}" != "local" ]; then
9077
# Set up the kubelet.service on remote host
9178
scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} kubelet.master core@${REMOTE_HOST}:/home/core/kubelet.master
9279
ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} core@${REMOTE_HOST} "sudo mv /home/core/kubelet.master /etc/systemd/system/kubelet.service"
9380

81+
# Copy bootkube binary to remote host.
82+
scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} ../../_output/bin/linux/bootkube core@${REMOTE_HOST}:/home/core/bootkube
83+
9484
# Copy self to remote host so script can be executed in "local" mode
9585
scp -i ${IDENT} -P ${REMOTE_PORT} ${SSH_OPTS} ${BASH_SOURCE[0]} core@${REMOTE_HOST}:/home/core/init-master.sh
96-
ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} core@${REMOTE_HOST} "sudo BOOTKUBE_REPO=${BOOTKUBE_REPO} BOOTKUBE_VERSION=${BOOTKUBE_VERSION} SELF_HOST_ETCD=${SELF_HOST_ETCD} /home/core/init-master.sh local"
86+
ssh -i ${IDENT} -p ${REMOTE_PORT} ${SSH_OPTS} core@${REMOTE_HOST} "sudo SELF_HOST_ETCD=${SELF_HOST_ETCD} /home/core/init-master.sh local"
9787

9888
# Copy assets from remote host to a local directory. These can be used to launch additional nodes & contain TLS assets
9989
mkdir ${CLUSTER_DIR}

hack/quickstart/kubelet.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Service]
22
Environment=KUBELET_IMAGE_URL=quay.io/coreos/hyperkube
3-
Environment=KUBELET_IMAGE_TAG=v1.5.6_coreos.0
3+
Environment=KUBELET_IMAGE_TAG=v1.6.1_coreos.0
44
Environment="RKT_RUN_ARGS=\
55
--uuid-file-save=/var/run/kubelet-pod.uuid \
66
--volume etc-resolv,kind=host,source=/etc/resolv.conf --mount volume=etc-resolv,target=/etc/resolv.conf \

hack/quickstart/kubelet.worker

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Service]
22
Environment=KUBELET_IMAGE_URL=quay.io/coreos/hyperkube
3-
Environment=KUBELET_IMAGE_TAG=v1.5.6_coreos.0
3+
Environment=KUBELET_IMAGE_TAG=v1.6.1_coreos.0
44
Environment="RKT_RUN_ARGS=\
55
--uuid-file-save=/var/run/kubelet-pod.uuid \
66
--volume etc-resolv,kind=host,source=/etc/resolv.conf --mount volume=etc-resolv,target=/etc/resolv.conf \

hack/tests/conformance-gce.sh

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ set -euo pipefail
1414
# - $KEY_FILE: path to GCE service account keyfile
1515
#
1616
# OPTIONAL ENV VARS:
17-
# - $BOOTKUBE_REPO: container repo to use to launch bootkube. Default to value in quickstart/init-master.sh
18-
# - $BOOTKUBE_VERSION: container version to use to launch bootkube. Default to value in quickstart/init-master.sh
1917
# - $COREOS_VERSION: CoreOS image version.
2018
#
2119
# PROCESS:
@@ -27,8 +25,6 @@ set -euo pipefail
2725
# - Use the quickstart init-worker.sh script to join node to kubernetes cluster
2826
# - Run conformance tests against the launched cluster
2927
#
30-
BOOTKUBE_REPO=${BOOTKUBE_REPO:-}
31-
BOOTKUBE_VERSION=${BOOTKUBE_VERSION:-}
3228
COREOS_CHANNEL=${COREOS_CHANNEL:-'coreos-stable'}
3329
WORKER_COUNT=4
3430
SELF_HOST_ETCD=${SELF_HOST_ETCD:-false}
@@ -70,7 +66,7 @@ function add_master {
7066

7167
MASTER_IP=$(gcloud compute instances list ${GCE_PREFIX}-m1 --format=json | jq --raw-output '.[].networkInterfaces[].accessConfigs[].natIP')
7268
cd /build/bootkube/hack/quickstart && SSH_OPTS="-o StrictHostKeyChecking=no" \
73-
CLUSTER_DIR=/build/cluster BOOTKUBE_REPO=${BOOTKUBE_REPO} BOOTKUBE_VERSION=${BOOTKUBE_VERSION} SELF_HOST_ETCD=${SELF_HOST_ETCD} ./init-master.sh ${MASTER_IP}
69+
CLUSTER_DIR=/build/cluster SELF_HOST_ETCD=${SELF_HOST_ETCD} ./init-master.sh ${MASTER_IP}
7470
}
7571

7672
function add_workers {
@@ -120,5 +116,5 @@ else
120116
#TODO(pb): See if there is a way to make the --inherit-env option replace
121117
#passing all the variables manually.
122118
sudo rkt run --insecure-options=image ${RKT_OPTS} docker://golang:1.7.4 --exec /bin/bash -- -c \
123-
"IN_CONTAINER=true BOOTKUBE_REPO=${BOOTKUBE_REPO} BOOTKUBE_VERSION=${BOOTKUBE_VERSION} COREOS_CHANNEL=${COREOS_CHANNEL} GCE_PREFIX=${GCE_PREFIX} GCE_SERVICE_ACCOUNT=${GCE_SERVICE_ACCOUNT} GCE_PROJECT=${GCE_PROJECT} SELF_HOST_ETCD=${SELF_HOST_ETCD} /build/bootkube/hack/tests/$(basename $0)"
119+
"IN_CONTAINER=true COREOS_CHANNEL=${COREOS_CHANNEL} GCE_PREFIX=${GCE_PREFIX} GCE_SERVICE_ACCOUNT=${GCE_SERVICE_ACCOUNT} GCE_PROJECT=${GCE_PROJECT} SELF_HOST_ETCD=${SELF_HOST_ETCD} /build/bootkube/hack/tests/$(basename $0)"
124120
fi

0 commit comments

Comments
 (0)