drone / drone-runtime

[DEPRECATED] migrated to https://github.com/drone-runners
Other
62 stars 43 forks source link

implement storageclass #27

Closed zetaab closed 5 years ago

zetaab commented 5 years ago

fixes #19

I am executing this pipeline:

kind: pipeline
name: default

steps:
- name: foo
  image: alpine
  commands:
  - touch hello.txt

- name: bar
  image: alpine
  commands:
  - ls hello.txt

With storageclass (new functionality)

% kubectl get storageclass
NAME             PROVISIONER               AGE
gluster-heketi   kubernetes.io/glusterfs   116m
% ./drone-runtime --kube-storageclass=gluster-heketi --kube-config=/Users/xxxx/projects/kubernetes/kubernetes/.kubeconfiggithub .drone.json --kube-debug

[foo:0] + touch hello.txt
[bar:0] + ls hello.txt
[bar:1] hello.txt
% kubectl get pods -o wide -n 3p35c9ty3xzsaidjbkepvfnuafugx912
NAME                               READY     STATUS      RESTARTS   AGE       IP          NODE
fqwz8qv5bpydrx5x9b28s3vy81vylx3q   0/1       Completed   0          17s       10.32.0.4   dev-node-1-0
wyc59yt0ti1nz44v3sy4pn59phritqt3   0/1       Completed   0          6s        10.36.0.4   dev-node-2-0

Like you can see steps are executed in different nodes. However, the print is little bit different what it is without persistent volume. Check that [bar:1] hello.txt vs hello.txt rows. Any ideas what is causing that?

Without storageclass (the behaviour before (and after) this PR)

% ./drone-runtime --kube-config=/Users/xxxx/projects/kubernetes/kubernetes/.kubeconfiggithub .drone.json --kube-debug

[foo:0] + touch hello.txt
[bar:0] + ls hello.txt
hello.txt

Anyways now if people have RWX volumes in cluster they can use multiple nodes to build stuff. I installed heketi to my cluster using https://github.com/gluster/gluster-kubernetes and then dynamically provisioning pvcs from it.

CLAassistant commented 5 years ago

CLA assistant check
All committers have signed the CLA.