Skip to content

Commit

Permalink
Update hostpath demo to use lib v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
wongma7 committed Mar 6, 2017
1 parent b858466 commit b14328a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ script:
- rm -rf ./vendor
- go test ./controller
- popd
# Test building hostpath-provisioner demo
# Test building hostpath-provisioner demo (both methods)
- pushd ./docs/demo/hostpath-provisioner
- docker build -t hostpath-provisioner:latest .
- make image
- make clean
- popd
# Test building and running nfs-provisioner
- pushd ./nfs
Expand Down
1 change: 1 addition & 0 deletions docs/demo/hostpath-provisioner/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ hostpath-provisioner: $(shell find . -name "*.go")

.PHONY: clean
clean:
rm -rf vendor
rm hostpath-provisioner
9 changes: 3 additions & 6 deletions docs/demo/hostpath-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,7 @@ Before we can run our provisioner in a pod we need to build a Docker image for t

Our [glide.yaml](./glide.yaml) was created by manually setting the latest version of external-storage/lib & setting the version of client-go to the same one that external-storage/lib uses. We use it to populate a vendor directory containing dependencies.

```
$ glide install -v
...
```

Now we can use the [Go Docker image](https://hub.docker.com/_/golang/) to build & run our hostpath-provisioner.
Now we can use the [Go Docker image](https://hub.docker.com/_/golang/) to build & run our hostpath-provisioner. The following Dockerfile will build the hostpath-provisioner binary inside the container. Note the `glide install -v` command that gets the dependencies listed in our glide.yaml.

```dockerfile
FROM golang:1.7.4
Expand All @@ -202,6 +197,8 @@ $ docker build -t hostpath-provisioner:latest .
Successfully built 9bb0954337a0
```

>Note that the above build process is not the only one available to you. We include here an example of an alternative static build process that results in a much smaller image: see the Makefile and Dockerfile.scratch if you're interested. Regardless of which method you choose, you should end up with a container tagged hostpath-provisioner:latest.
Now we can specify our image in a pod. Recall that we set `pvDir` to `/tmp/hostpath-provisioner`. Since we are running our provisioner in a container as a pod, we should mount a corresponding `hostPath` volume there to serve as the parent of all provisioned PVs' `hostPath` volumes.

```yaml
Expand Down
13 changes: 7 additions & 6 deletions docs/demo/hostpath-provisioner/glide.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions docs/demo/hostpath-provisioner/glide.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package: github.com/kubernetes-incubator/external-storage/docs/demo/hostpath-pro
import:
- package: github.com/golang/glog
- package: github.com/kubernetes-incubator/external-storage
version: 2517d1f
version: v1.0.0
subpackages:
- controller
- package: k8s.io/client-go
version: v2.0.0-alpha.0-9-g89c6009
version: ^v2.0.0
subpackages:
- kubernetes
- pkg/api/v1
Expand Down

0 comments on commit b14328a

Please sign in to comment.