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

Commit

Permalink
Merge pull request #51 from aaronlevy/1.3-updates
Browse files Browse the repository at this point in the history
Update to use v1.3.0-alpha.5
  • Loading branch information
aaronlevy committed Jun 8, 2016
2 parents 7c6fb2a + 72d0b61 commit dee39f8
Show file tree
Hide file tree
Showing 4,879 changed files with 540,778 additions and 318,518 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,18 @@ conformance-%: clean all

# This will naively try and create a vendor dir from a k8s release
# USE: make vendor VENDOR_VERSION=vX.Y.Z
VENDOR_VERSION = v1.2.1
VENDOR_VERSION = v1.3.0-alpha.5
vendor: vendor-$(VENDOR_VERSION)

vendor-$(VENDOR_VERSION):
@echo "Creating k8s vendor dir: $@"
@mkdir -p $@/k8s.io/kubernetes
@git clone --branch=$(VENDOR_VERSION) --depth=1 https://github.com/kubernetes/kubernetes $@/k8s.io/kubernetes > /dev/null 2>&1
@cd $@/k8s.io/kubernetes && git checkout $(VENDOR_VERSION) > /dev/null 2>&1
@cd $@/k8s.io/kubernetes && rm -rf docs examples hack cluster
@cd $@/k8s.io/kubernetes/Godeps/_workspace/src && mv k8s.io/heapster $(abspath $@/k8s.io) && rmdir k8s.io
@mv $@/k8s.io/kubernetes/Godeps/_workspace/src/* $(abspath $@)
@rm -rf $@/k8s.io/kubernetes/Godeps $@/k8s.io/kubernetes/.git
@cd $@/k8s.io/kubernetes && rm -rf docs examples hack cluster Godeps
@cd $@/k8s.io/kubernetes/vendor && mv k8s.io/heapster $(abspath $@/k8s.io) && rmdir k8s.io
@mv $@/k8s.io/kubernetes/vendor/* $(abspath $@)
@rm -rf $@/k8s.io/kubernetes/vendor $@/k8s.io/kubernetes/.git

clean:
rm -rf _output
Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,48 @@
# Bootkube

Bootkube provides an entire kubernetes control plane in a single binary, and includes commands to render and consume assets for bootstrapping a self-hosted kubernetes cluster. Bootkube is expected to be used simply for bootstrapping purposes.
Bootkube is a helper tool for launching self-hosted Kubernetes clusters.

The current mode of operation is to use an ssh-tunnel to establish a temporary control-plane on a remote node. The bootkube binary can be run locally, while accepting connections from the remote node. This temporary control-plane will exist long enough to establish a self-hosted kubernetes installation. Once the self-hosted components have started, bootkube will exit and close the connection - leaving no bootstrap assets behind.
When launched, bootkube will act as a temporary Kubernetes control-plane (api-server, scheduler, controller-manager), which operates long enough to bootstrap a replacement self-hosted control-plane.

Additionally, bootkube can be used to generate all of the necessary assets for use in bootstrapping a new cluster. These assets can then be modified to support any additional configuration options.

## Usage

Bootkube has two modes of operation.
Bootkube has two main commands: `render` and `start`

### Render assets

First, you can use bootkube to render out all of the assets (including kubernetes object manifests, TLS assets and kubeconfig) that you need to run a self-hosted kubernetes cluster. This feature is still experimental and changing rapidly.
Bootkube can be used to render all of the assets necessary for bootstrapping a self-hosted Kubernetes cluster. This includes generation of TLS assets, Kubernetes object manifests, and a kubeconfig to connect to the bootstrapped cluster.

To see available options, run:

```
bootkube render --help
```

To use this feature, run:
Example:

```
bootkube render <options>
bootkube render --asset-dir=my-cluster
```

You can customize the generated manifests by passing flags to the command. For more information on the supported commands, run `bootkube help render`.
The resulting assets can be inspected / modified in the generated asset-dir.

### Start bootkube

To start bootkube use the `start` subcommand:
To start bootkube use the `start` subcommand.

To see available options, run:

```
bootkube start <options>
bootkube start --help
```

Bootkube expects a directory containing the manifests to be provided as a command line flag, as well as other TLS assets (all of which can be taken from the `render` command). To see the available flags, run `bootkube help start`.
Example:

When you start bootkube, you must also give it the addresses of your etcd servers, and enough information for bootkube to create an ssh tunnel to the node that will become a member of the master control plane. Upon startup, bootkube will create a reverse proxy using an ssh connection, which will allow a bootstrap kubelet to contact the apiserver running as part of bootkube.
```
bootkube start --asset-dir=my-cluster
```

## Hack

Expand All @@ -56,7 +68,7 @@ cd $GOPATH/github.com/coreos/bootkube
Then, to build:

```
make all
make
```

And optionally, to install into $GOPATH/bin:
Expand Down
6 changes: 3 additions & 3 deletions hack/multi-node/user-data.sample
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ coreos:
content: |
[Service]
EnvironmentFile=/etc/environment
Environment=KUBELET_ACI=quay.io/peanutbutter/hyperkube
Environment=KUBELET_VERSION=v1.2.4_inotify.3
Environment=KUBELET_ACI=quay.io/coreos/hyperkube
Environment=KUBELET_VERSION=v1.3.0-alpha.5_coreos.0
ExecStart=/usr/lib/coreos/kubelet-wrapper \
--bootstrap \
--api-servers=https://172.17.4.101:443 \
--kubeconfig=/etc/kubernetes/kubeconfig \
--lock-file=/var/run/lock/kubelet.lock \
--exit-on-lock-contention \
--allow-privileged \
--hostname-override=${COREOS_PUBLIC_IPV4} \
--node-labels=master=true \
Expand Down
1 change: 1 addition & 0 deletions hack/single-node/conformance-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ set -euo pipefail
ssh_key="$(vagrant ssh-config | awk '/IdentityFile/ {print $2}' | tr -d '"')"
ssh_port="$(vagrant ssh-config | awk '/Port [0-9]+/ {print $2}')"

export CHECK_NODE_COUNT=false
../tests/conformance-test.sh "127.0.0.1" "${ssh_port}" "${ssh_key}"
6 changes: 3 additions & 3 deletions hack/single-node/user-data.sample
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ coreos:
content: |
[Service]
EnvironmentFile=/etc/environment
Environment=KUBELET_ACI=quay.io/peanutbutter/hyperkube
Environment=KUBELET_VERSION=v1.2.4_inotify.3
Environment=KUBELET_ACI=quay.io/coreos/hyperkube
Environment=KUBELET_VERSION=v1.3.0-alpha.5_coreos.0
ExecStart=/usr/lib/coreos/kubelet-wrapper \
--bootstrap \
--api-servers=https://172.17.4.100:443 \
--kubeconfig=/etc/kubernetes/kubeconfig \
--lock-file=/var/run/lock/kubelet.lock \
--exit-on-lock-contention=true \
--allow-privileged \
--hostname-override=${COREOS_PUBLIC_IPV4} \
--node-labels=master=true \
Expand Down
15 changes: 10 additions & 5 deletions hack/tests/conformance-test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/bin/bash
set -euo pipefail

CONFORMANCE_VERSION=${CONFORMANCE_VERSION:-v1.2.4}
CHECK_NODE_COUNT=${CHECK_NODE_COUNT:-true}
CONFORMANCE_REPO=${CONFORMANCE_REPO:-github.com/coreos/kubernetes}
CONFORMANCE_VERSION=${CONFORMANCE_VERSION:-v1.3.0-alpha.5+coreos.0}

usage() {
echo "USAGE:"
Expand All @@ -19,25 +21,28 @@ ssh_host=$1
ssh_port=$2
ssh_key=$3

K8S_SRC=/home/core/go/src/k8s.io/kubernetes
ssh -q -o stricthostkeychecking=no -i ${ssh_key} -p ${ssh_port} core@${ssh_host} \
"mkdir -p /home/core/go/src/k8s.io/kubernetes && git clone https://github.com/kubernetes/kubernetes /home/core/go/src/k8s.io/kubernetes"
"mkdir -p ${K8S_SRC} && [[ -d ${K8S_SRC}/.git ]] || git clone https://${CONFORMANCE_REPO} ${K8S_SRC}"

RKT_OPTS=$(echo \
"--volume=kc,kind=host,source=/home/core/cluster/auth/kubeconfig "\
"--volume=k8s,kind=host,source=/home/core/go/src/k8s.io/kubernetes " \
"--volume=k8s,kind=host,source=${K8S_SRC} " \
"--mount volume=kc,target=/kubeconfig " \
"--mount volume=k8s,target=/go/src/k8s.io/kubernetes")

# Init steps necessary to run conformance in docker://golang:1.6.2 container
INIT="apt-get update && apt-get install -y rsync"

TEST_FLAGS="-v --test -check_version_skew=false -check_node_count=${CHECK_NODE_COUNT} --test_args=\"ginkgo.focus='\[Conformance\]'\""

CONFORMANCE=$(echo \
"cd /go/src/k8s.io/kubernetes && " \
"git checkout ${CONFORMANCE_VERSION} && " \
"make all WHAT=cmd/kubectl && " \
"make all WHAT=github.com/onsi/ginkgo/ginkgo && " \
"make all WHAT=vendor/github.com/onsi/ginkgo/ginkgo && " \
"make all WHAT=test/e2e/e2e.test && " \
"KUBECONFIG=/kubeconfig KUBERNETES_CONFORMANCE_TEST=Y hack/ginkgo-e2e.sh -ginkgo.focus='\[Conformance\]'")
"KUBECONFIG=/kubeconfig KUBERNETES_PROVIDER=skeleton KUBERNETES_CONFORMANCE_TEST=Y go run hack/e2e.go ${TEST_FLAGS}")

CMD="sudo rkt run --insecure-options=image ${RKT_OPTS} docker://golang:1.6.2 --exec /bin/bash -- -c \"${INIT} && ${CONFORMANCE}\""

Expand Down

0 comments on commit dee39f8

Please sign in to comment.