From b14328afb589affeeef9e32a2c48d7d0f81566d7 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 3 Mar 2017 17:25:34 -0500 Subject: [PATCH] Update hostpath demo to use lib v1.0.0 --- .travis.yml | 4 +++- docs/demo/hostpath-provisioner/Makefile | 1 + docs/demo/hostpath-provisioner/README.md | 9 +++------ docs/demo/hostpath-provisioner/glide.lock | 13 +++++++------ docs/demo/hostpath-provisioner/glide.yaml | 4 ++-- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3f9b46e6..3bff5cf4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/docs/demo/hostpath-provisioner/Makefile b/docs/demo/hostpath-provisioner/Makefile index cdbedd94..38908bb0 100644 --- a/docs/demo/hostpath-provisioner/Makefile +++ b/docs/demo/hostpath-provisioner/Makefile @@ -25,4 +25,5 @@ hostpath-provisioner: $(shell find . -name "*.go") .PHONY: clean clean: + rm -rf vendor rm hostpath-provisioner diff --git a/docs/demo/hostpath-provisioner/README.md b/docs/demo/hostpath-provisioner/README.md index f8ba05d4..d24b8700 100644 --- a/docs/demo/hostpath-provisioner/README.md +++ b/docs/demo/hostpath-provisioner/README.md @@ -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 @@ -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 diff --git a/docs/demo/hostpath-provisioner/glide.lock b/docs/demo/hostpath-provisioner/glide.lock index f4826205..c31a0871 100644 --- a/docs/demo/hostpath-provisioner/glide.lock +++ b/docs/demo/hostpath-provisioner/glide.lock @@ -1,5 +1,5 @@ -hash: 5ed4a0454b399910b913d69173efe5e891ce62274216b56dfad3183e0d7d3536 -updated: 2017-02-21T15:30:07.826602914-05:00 +hash: 0123cc12df692481ba34f0a7f71b51a2420b5652c3ef310c8dbc6fb4cffb759b +updated: 2017-03-03T16:31:50.886913856-05:00 imports: - name: cloud.google.com/go version: 3b1ae45394a234c385be014e9a488f2bb6eef821 @@ -65,8 +65,10 @@ imports: version: bbcb9da2d746f8bdbd6a936686a0a6067ada0ec5 - name: github.com/jonboulle/clockwork version: 72f9bd7c4e0c2a40055ab3d0f09654f730cce982 +- name: github.com/juju/ratelimit + version: 77ed1c8a01217656d2080ad51981f6e99adaa177 - name: github.com/kubernetes-incubator/external-storage - version: 2517d1fa42c9908654e64fe4ade039a45e269da7 + version: 7ed750505f701c978a79ebf001cc37fc529d73d0 subpackages: - controller - lib/controller @@ -136,7 +138,7 @@ imports: - name: gopkg.in/yaml.v2 version: 53feefa2559fb8dfa8d81baad31be332c97d6c77 - name: k8s.io/client-go - version: 89c60099837a47cfce19bd14e2d1f16c4670fd58 + version: e121606b0d09b2e1c467183ee46217fa85a6b672 subpackages: - discovery - kubernetes @@ -228,7 +230,6 @@ imports: - pkg/util/net - pkg/util/parsers - pkg/util/rand - - pkg/util/ratelimit - pkg/util/runtime - pkg/util/sets - pkg/util/strategicpatch @@ -250,7 +251,7 @@ imports: - tools/record - transport - name: k8s.io/kubernetes - version: ee03b9b206ece1500b65140f26acc2ebe40b630b + version: e9eeec655e7fdee50d4e19200f9707d1cd4a3371 subpackages: - pkg/util/goroutinemap - pkg/util/goroutinemap/exponentialbackoff diff --git a/docs/demo/hostpath-provisioner/glide.yaml b/docs/demo/hostpath-provisioner/glide.yaml index 9b41ed7a..391db581 100644 --- a/docs/demo/hostpath-provisioner/glide.yaml +++ b/docs/demo/hostpath-provisioner/glide.yaml @@ -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