Skip to content

Commit

Permalink
fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
supershal committed Feb 11, 2016
1 parent 89da964 commit f34ff37
Showing 1 changed file with 26 additions and 15 deletions.
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@

## Deploy influxdb cluster to kubernetes cluster
- Create "infra" namespace

```
$ kubectl create -f ./k8s/infra-namespace.yaml
```
- Set default namespace to "infra"

```
$ export CONTEXT=$(kubectl config view | grep current-context | awk '{print $2}')
$ kubectl config set-context $(CONTEXT) --namespace=<insert-namespace-name-here>
Expand Down Expand Up @@ -67,45 +69,44 @@

## Verify cluster setup
- ssh to k8s minion

```
$ vagrant ssh minion-1
OR
$ ssh vagrant@minion-1 # make sure you have set up vagrant config in your ./ssh/config. use vagrant ssh-config command.
```
- locate one of the influxdb container and exec

```
$ sudo docker ps
$ sudo docker exec -it /bin/bash <container_id> /bin/bash
```
- launch influxdb cli and check cluster members

```
$ influx
$ show servers
```
It should give all members of the cluser something like.

```
> show servers
name: data_nodes
----------------
id http_addr tcp_addr
1 10.244.1.7:8086 10.244.1.7:8088
4 10.244.2.190:8086 10.244.2.190:8088
5 10.244.1.179:8086 10.244.1.179:8088
7 10.244.2.194:8086 10.244.2.194:8088
9 10.244.3.237:8086 10.244.3.237:8088
11 10.244.2.66:8086 10.244.2.66:8088
4 10.244.1.3:8086 10.244.1.3:8088
5 10.244.2.200:8086 10.244.2.200:8088
6 10.244.1.185:8086 10.244.1.185:8088
7 10.244.2.183:8086 10.244.2.183:8088


name: meta_nodes
----------------
id http_addr tcp_addr
1 10.244.1.7:8091 10.244.1.7:8088
2 10.244.2.190:8091 10.244.2.190:8088
3 10.244.1.179:8091 10.244.1.179:8088
6 10.244.2.194:8091 10.244.2.194:8088
8 10.244.3.237:8091 10.244.3.237:8088
10 10.244.2.66:8091 10.244.2.66:8088
```
1 10.244.1.2:8091 10.244.1.2:8088
2 10.244.2.199:8091 10.244.2.199:8088
3 10.244.1.184:8091 10.244.1.184:8088
```
## Terminate cluster
- delete influxdb service
Expand Down Expand Up @@ -133,34 +134,41 @@ id http_addr tcp_addr
If you are not making any code changes and/or building docker image for influxdb, you can skip this section.
1. Install GO latest version and set up go workspace. [Instructions]
2. Install godep
```
$ go get -u github.com/tools/godep
```
3. Restore dependency
```
$ godep restore
```
4. Install and test influxdbconfig program locally.
- Build go binary for testing.
```
```
$ go build -o influxdblocal ./influxdb/main.go
```
- Setup kubectl proxy to proxy influxdb api server
```
$ kubectl proxy --port=9090 &
```
- test locally.
```
$ LOCAL_PROXY="http://localhost:9090" INFLUXDB_POD_SELECTORS="app=influxdb" NAMESPACE="infra" influxdblocal test
```
It will spit out the the influxdb cluster config parameters to console.
4. build influxdbconfig executable from the go program and create docker image for influxdbconfig + influxdb
- Create docker-machine vm and set docker daemon
```
$ docker-machine create --driver=virtualbox default
$ eval "$(docker-machine env default)"
```
- build the image
```
$ ./influxdb/build.sh
```
Expand All @@ -169,15 +177,18 @@ If you are not making any code changes and/or building docker image for influxdb
- (Faster) Copy image directly to k8s minion. Use this method if you frequently building the image.
* One time setup for ssh to minion.
Go to your kubernetes installation and locate Vagrantfile.
```
$ vagrant ssh-config
```
Copy output of above command to your ~/.ssh/config file.
* copy the image from docker-machine VM to K8S minion.
```
$ docker save supershal/influxdb:stresstest | ssh vagrant@minion-1 sudo docker load
```
- (Slower) push to docker hub.
```
$ docker push supershal/influxdb:stresstest
```
Expand Down Expand Up @@ -213,4 +224,4 @@ https://github.com/kubernetes/kubernetes/blob/master/docs/devel/client-libraries
- browse Golang doc and sourcecode for k8s (or any golang project)
* install Dash https://kapeli.com/dash
* load golang docs for any go project. checkout docs for Dash
* load golang docs for any go project. checkout docs for Dash

0 comments on commit f34ff37

Please sign in to comment.