Skip to content

Commit

Permalink
Merge pull request kubernetes#5594 from lhuard1A/libvirt-coreos_kube-…
Browse files Browse the repository at this point in the history
…push

libvirt-coreos: Make kube-push able to push non-release kubernetes binaries
  • Loading branch information
zmerlynn committed Mar 20, 2015
2 parents c5f7351 + 8fb8e20 commit 7f02e11
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cluster/libvirt-coreos/user_data_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ coreos:
ConditionPathIsDirectory=/opt/kubernetes/addons
Description=Kubernetes addons
Documentation=https://github.com/GoogleCloudPlatform/kubernetes
Requires=opt-kubernetes.mount kube-apiserver.service
Requires=opt-kubernetes.mount
Wants=kube-apiserver.service
[Service]
Type=oneshot
Expand Down
29 changes: 28 additions & 1 deletion cluster/libvirt-coreos/util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ function initialize-pool {
# fi

mkdir -p "$POOL_PATH/kubernetes"
kube-push
kube-push-internal

mkdir -p "$POOL_PATH/kubernetes/manifests"
if [[ "$ENABLE_NODE_LOGGING" == "true" ]]; then
Expand Down Expand Up @@ -271,10 +271,37 @@ function upload-server-tars {

# Update a kubernetes cluster with latest source
function kube-push {
kube-push-internal
ssh-to-node "$MASTER_NAME" "sudo systemctl restart kube-apiserver kube-controller-manager kube-scheduler"
for ((i=0; i < NUM_MINIONS; i++)); do
ssh-to-node "${MINION_NAMES[$i]}" "sudo systemctl restart kubelet kube-proxy"
done
wait-cluster-readiness
}

function kube-push-internal {
case "${KUBE_PUSH:-release}" in
release)
kube-push-release;;
local)
kube-push-local;;
*)
echo "The only known push methods are \"release\" to use the relase tarball or \"local\" to use the binaries built by make. KUBE_PUSH is set \"$KUBE_PUSH\"" >&2
return 1;;
esac
}

function kube-push-release {
find-release-tars
upload-server-tars
}

function kube-push-local {
rm -rf "$POOL_PATH/kubernetes/bin/*"
mkdir -p "$POOL_PATH/kubernetes/bin"
cp "${KUBE_ROOT}/_output/local/go/bin"/* "$POOL_PATH/kubernetes/bin"
}

# Execute prior to running tests to build a release if required for env
function test-build-release {
echo "TODO"
Expand Down
12 changes: 11 additions & 1 deletion docs/getting-started-guides/libvirt-coreos.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ The `KUBERNETES_PROVIDER` environment variable tells all of the various cluster

The `NUM_MINIONS` environment variable may be set to specify the number of minions to start. If it is not set, the number of minions defaults to 3.

The `KUBE_PUSH` environment variable may be set to specify which kubernetes binaries must be deployed on the cluster. Its possible values are:

* `release` (default if `KUBE_PUSH` is not set) will deploy the binaries of `_output/release-tars/kubernetes-server-….tar.gz`. This is built with `make release` or `make release-skip-tests`.
* `local` will deploy the binaries of `_output/local/go/bin`. These are built with `make`.

You can check that your machines are there and running with:

```
Expand Down Expand Up @@ -154,12 +159,17 @@ Destroy the libvirt-CoreOS cluster
cluster/kube-down.sh
```

Uptade the libvirt-CoreOS cluster with a new Kubernetes release:
Update the libvirt-CoreOS cluster with a new Kubernetes release produced by `make release` or `make release-skip-tests`:

```
cluster/kube-push.sh
```

Update the libvirt-CoreOS cluster with the locally built Kubernetes binaries produced by `make`:
```
KUBE_PUSH=local cluster/kube-push.sh
```

Interact with the cluster

```
Expand Down

0 comments on commit 7f02e11

Please sign in to comment.