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

implement storageclass #27

Closed
wants to merge 40 commits into from
Closed

Conversation

zetaab
Copy link
Contributor

@zetaab zetaab commented Dec 11, 2018

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
Copy link

CLAassistant commented Dec 11, 2018

CLA assistant check
All committers have signed the CLA.

volume.HostPath = &v1.HostPathVolumeSource{
Path: vol.HostPath.Path,
Type: &source,
if usePVC {
Copy link
Contributor Author

@zetaab zetaab Dec 11, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is difference between vol.HostPath and vol.EmptyDir? Do we need persistentvolumeclaim in both?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

kubernetes: persistent volumes
4 participants