Merge pull request #5594 from lhuard1A/libvirt-coreos_kube-push

libvirt-coreos: Make kube-push able to push non-release kubernetes binaries
This commit is contained in:
Zach Loafman 2015-03-20 10:20:02 -07:00
commit 7f02e110f4
3 changed files with 41 additions and 3 deletions

View File

@ -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

View File

@ -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
@ -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"

View File

@ -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:
```
@ -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
```