File tree 9 files changed +81
-26
lines changed
9 files changed +81
-26
lines changed Original file line number Diff line number Diff line change 12
12
# See the License for the specific language governing permissions and
13
13
# limitations under the License.
14
14
15
- FROM fedora:26
15
+ FROM golang:1.10.1-alpine3.7 as builder
16
+ WORKDIR /go/src/github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver
17
+ ADD . .
18
+ RUN CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static"' -o bin/gce-pd-csi-driver ./cmd/
16
19
17
- COPY gce-csi-driver /gce-csi-driver
20
+ FROM alpine:3.7
21
+ COPY --from=builder /go/src/github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/bin/gce-pd-csi-driver /gce-pd-csi-driver
18
22
19
- RUN yum -y install "*/mkfs.ext4"
20
-
21
- ENTRYPOINT ["/gce-csi-driver" ]
23
+ ENTRYPOINT ["/gce-pd-csi-driver" ]
Original file line number Diff line number Diff line change @@ -25,18 +25,16 @@ gce-pd-driver:
25
25
go build -o bin/gce-pd-csi-driver-test ./test/e2e/
26
26
27
27
build-container : gce-pd-driver
28
- cp bin/gce-pd-csi-driver deploy/docker
29
- docker build -t $(STAGINGIMAGE ) :$(STAGINGVERSION ) deploy/docker
28
+ docker build -t $(STAGINGIMAGE ) :$(STAGINGVERSION ) .
30
29
31
30
push-container : build-container
32
31
gcloud docker -- push $(STAGINGIMAGE ) :$(STAGINGVERSION )
33
32
34
33
prod-build-container : gce-pd-driver
35
- cp bin/gce-pd-csi-driver deploy/docker
36
- docker build -t $(PRODIMAGE ) :$(PRODVERSION ) deploy/docker
34
+ docker build -t $(PRODIMAGE ) :$(PRODVERSION )
37
35
38
36
prod-push-container : prod-build-container
39
37
gcloud docker -- push $(PRODIMAGE ) :$(PRODVERSION )
40
38
41
39
test-sanity : gce-pd-driver
42
- go test -timeout 30s github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/pkg/test -run ^TestSanity$
40
+ go test -timeout 30s github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/pkg/test -run ^TestSanity$
Original file line number Diff line number Diff line change @@ -10,5 +10,40 @@ Specification compliant driver used by Container Orchestrators to manage the
10
10
lifecycle of Google Compute Engine Persistent Disks.
11
11
12
12
## Installing
13
+ ### Kubernetes
13
14
Templates and further information for installing this driver on Kubernetes are
14
- in deploy/kubernetes/
15
+ in [ ` ./deploy/kubernetes/README.md ` ] ( deployREADME )
16
+
17
+ ## Development
18
+
19
+ ###Manual
20
+
21
+ Setup [ GCP service account first] ( deployREADME ) (one time step)
22
+
23
+ To bring up developed drivers:
24
+ ```
25
+ $ make push-container
26
+ $ ./deploy/kubernetes/deploy-driver.sh
27
+ ```
28
+
29
+ To bring down drivers:
30
+ ```
31
+ $ ./deploy/kubernetes/delete-driver.sh
32
+ ```
33
+
34
+ ## Testing
35
+ Unit tests in ` _test ` files in the same package as the functions tested.
36
+
37
+ Sanity and E2E tests can be found in ` ./test/ ` and more detailed testing
38
+ information is in [ ` ./test/README.md ` ] ( testREADME )
39
+
40
+ ## Dependency Management
41
+ Use [ dep] ( https://github.com/golang/dep )
42
+ ```
43
+ $ dep ensure
44
+ ```
45
+
46
+ To modify dependencies or versions change ` ./Gopkg.toml `
47
+
48
+ [ deployREADME ] : github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/deploy/kubernetes/README.md
49
+ [ testREADME ] : github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/test/README.md
Original file line number Diff line number Diff line change 1
- Step 1 (Create Credentials):
2
- Create Service Account Credential JSON on GCP:
3
- - TODO: Add detailed steps on how to do this
4
- - Requires both Compute Owner and Cloud Project Owner permissions
5
- Create Kubernetes secret:
6
- -kubectl create secret generic cloud-sa --from-file=cloud-sa.json
7
- Modify "controller.yaml" to use your secret
8
-
9
- Step 2 (Set up Driver):
10
- kubectl create -f setup.yaml
11
- kubectl create -f node.yaml
12
- kubectl create -f controller.yaml
13
-
14
- Step 3 (Run demo [ optional] ):
15
- kubectl create -f demo-pod.yaml
1
+ 1 . One-time per project: Create GCP service account for CSI driver
2
+ 1 . Export environment variables for location for service account private key file and name of the service account
3
+ ```
4
+ $ export SA_FILE=~/.../cloud-sa.json
5
+ $ export GCEPD_SA_NAME=sample-service-account
6
+ ```
7
+ 2. Setup project with script
8
+ ```
9
+ $ ./deploy/setup_project.sh
10
+ ```
11
+ 2. Deploy driver to Kubernetes cluster
12
+ ```
13
+ $ ./deploy/kubernetes/deploy_driver.sh
14
+ ```
15
+ 3. Create example PVC and Pod
16
+ ```
17
+ $ kubectl create -f ./examples/demo-pod.yaml
18
+ ```
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ kubectl delete -f node.yaml
4
+ kubectl delete -f controller.yaml
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ source ./common.sh
3
+ kubectl create secret generic cloud-sa --from-file=$SA_FILE
4
+ kubectl create -f setup-cluster.yaml
5
+ kubectl create -f node.yaml
6
+ kubectl create -f controller.yaml
File renamed without changes.
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ source ./common.sh
4
+ IAM_NAME=" $GCEPD_SA_NAME @$PROJECT .iam.gserviceaccount.com"
5
+ gcloud iam service-accounts create $GCEPD_SA_NAME
6
+ gcloud iam service-accounts keys create $SA_FILE --iam-account $IAM_NAME
7
+ gcloud projects add-iam-policy-binding $PROJECT --member serviceAccount:$IAM_NAME --role roles/compute.storageAdmin roles/compute.admin
File renamed without changes.
You can’t perform that action at this time.
0 commit comments