Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

Add DigitalOcean provisioner #470

Merged
merged 4 commits into from
Dec 20, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,9 @@ flycheck_*.el

# cinder binary
/openstack/standalone-cinder/cinder-provisioner

# digitalocean binaries
/digitalocean/digitalocean-flexplugin
/digitalocean/deploy/docker/digitalocean-flexplugin
/digitalocean/digitalocean-provisioner
/digitalocean/deploy/docker/digitalocean-provisioner
48 changes: 48 additions & 0 deletions digitalocean/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2016 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

REGISTRY = quay.io/kubernetes_incubator
IMAGE_FLEXPLUGIN = $(REGISTRY)/digitalocean-flexplugin
IMAGE_PROVISONER = $(REGISTRY)/digitalocean-provisioner

VERSION := latest

all build:
GOOS=linux go install -v ./cmd/digitalocean-flexplugin
CGO_ENABLED=0 GOOS=linux go build ./cmd/digitalocean-flexplugin
GOOS=linux go install -v ./cmd/digitalocean-provisioner
CGO_ENABLED=0 GOOS=linux go build ./cmd/digitalocean-provisioner
.PHONY: all build

container: build quick-container
.PHONY: container

quick-container:
cp digitalocean-flexplugin deploy/docker/digitalocean-flexplugin
docker build -t $(IMAGE_FLEXPLUGIN):$(VERSION) -f deploy/docker/Dockerfile.flexplugin deploy/docker
cp digitalocean-provisioner deploy/docker/digitalocean-provisioner
docker build -t $(IMAGE_PROVISONER):$(VERSION) -f deploy/docker/Dockerfile.provisioner deploy/docker
.PHONY: quick-container

push: container
docker push $(IMAGE_FLEXPLUGIN):$(VERSION)
docker push $(IMAGE_PROVISONER):$(VERSION)
.PHONY: push

clean:
rm -f digitalocean-flexplugin
rm -f deploy/docker/digitalocean-flexplugin
rm -f digitalocean-provisioner
rm -f deploy/docker/digitalocean-provisioner
.PHONY: clean
2 changes: 2 additions & 0 deletions digitalocean/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
approvers:
- klausenbusk
25 changes: 25 additions & 0 deletions digitalocean/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Kubernetes DigitalOcean provisioner

This is an simple provisioner for DigitalOcean [Block Storage](https://www.digitalocean.com/products/storage/).

**Deploy**

1. Get a DigitalOcean access-token [here](https://cloud.digitalocean.com/settings/api/tokens).
`base64` the token and insert it into [manifests/digitalocean-secret.yaml](manifests/digitalocean-secret.yaml).
Create the secret: `kubectl create -f manifests/digitalocean-secret.yaml`
2. Deploy the provisioner: `kubectl create -f manifests/digitalocean-provisioner.yaml`
3. Adjust the `hostPath` in [manifests/digitalocean-flex-plugin-deploy.yaml](manifests/digitalocean-flex-plugin-deploy.yaml)
Deploy the flex plugin "installer": `kubectl create -f manifests/digitalocean-flex-plugin-deploy.yaml`
4. Modify the zone in [manifests/sc.yaml](manifests/sc.yaml)
Deploy the default `StorageClass`: `kubectl create -f manifests/sc.yaml`
5. (**optional**) Try it out with the example pod and PVC
```
kubectl create -f examples/pvc.yaml
kubectl create -f examples/pod-application.yaml
```

**TODO**
- [ ] Support multi zones
- [x] Rewrite flexvolume plugin in Go
- [ ] Prevent k8s from scheduling more than 5 disks to a single droplet
- [ ] Improve documentation
Loading