Commit 1538933b authored by Arie Peterson's avatar Arie Peterson
Browse files

Merge branch 'merge-v0.0.22' into 'master'

Update to latest local-path-provisioner version

See merge request !5
parents 4b32a0be b5360b85
Pipeline #13027 passed with stages
in 1 minute and 46 seconds
......@@ -31,13 +31,26 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/local-path-provisioner"
tag: "${DRONE_BRANCH}-head-amd64"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
event:
- push
- name: docker-tagged-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
......@@ -50,9 +63,6 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
......@@ -94,13 +104,26 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/local-path-provisioner"
tag: "${DRONE_BRANCH}-head-arm64"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
event:
- push
- name: docker-tagged-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
......@@ -113,9 +136,6 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
......@@ -156,13 +176,26 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
- name: docker-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/local-path-provisioner"
tag: "${DRONE_BRANCH}-head-arm"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
event:
- push
- name: docker-tagged-publish
image: plugins/docker
settings:
dockerfile: package/Dockerfile
......@@ -175,9 +208,6 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
......@@ -222,13 +252,29 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
- name: docker-publish
image: rancher/drone-images:docker-s390x
volumes:
- name: docker
path: /var/run/docker.sock
settings:
dockerfile: package/Dockerfile
password:
from_secret: docker_password
repo: "rancher/local-path-provisioner"
tag: "${DRONE_BRANCH}-head-s390x"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
event:
- push
- name: docker-tagged-publish
image: rancher/drone-images:docker-s390x
volumes:
- name: docker
......@@ -244,9 +290,6 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
......@@ -265,6 +308,26 @@ platform:
steps:
- name: manifest
image: plugins/manifest:1.0.2
settings:
username:
from_secret: docker_username
password:
from_secret: docker_password
platforms:
- linux/amd64
- linux/arm64
- linux/arm
- linux/s390x
target: "rancher/local-path-provisioner:${DRONE_BRANCH}-head"
template: "rancher/local-path-provisioner:${DRONE_BRANCH}-head-ARCH"
when:
instance:
- drone-publish.rancher.io
event:
- push
- name: manifest-tag
image: plugins/manifest:1.0.2
settings:
username:
......@@ -281,9 +344,6 @@ steps:
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
......
......@@ -4,7 +4,7 @@ include:
variables:
CHART_NAME: local-path-provisioner
CHART_DIR: deploy/chart/
CHART_DIR: deploy/chart/local-path-provisioner/
KANIKO_BUILD_IMAGENAME: local-path-provisioner
stages:
......
......@@ -24,11 +24,23 @@ Kubernetes v1.12+.
In this setup, the directory `/opt/local-path-provisioner` will be used across all the nodes as the path for provisioning (a.k.a, store the persistent volume data). The provisioner will be installed in `local-path-storage` namespace by default.
- Stable
```
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.22/deploy/local-path-storage.yaml
```
- Development
```
kubectl apply -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
```
Or, use `kustomize` to deploy.
- Stable
```
kustomize build "github.com/rancher/local-path-provisioner/deploy?ref=v0.0.22" | kubectl apply -f -
```
- Development
```
kustomize build "github.com/rancher/local-path-provisioner/deploy?ref=master" | kubectl apply -f -
```
......@@ -119,7 +131,7 @@ Now you've verified that the provisioner works as expected.
### Customize the ConfigMap
The configuration of the provisioner is a json file `config.json` and two bash scripts `setup` and `teardown`, stored in the a config map, e.g.:
The configuration of the provisioner is a json file `config.json`, a Pod template `helperPod.yaml` and two bash scripts `setup` and `teardown`, stored in a config map, e.g.:
```
kind: ConfigMap
apiVersion: v1
......@@ -146,40 +158,12 @@ data:
}
setup: |-
#!/bin/sh
while getopts "m:s:p:" opt
do
case $opt in
p)
absolutePath=$OPTARG
;;
s)
sizeInBytes=$OPTARG
;;
m)
volMode=$OPTARG
;;
esac
done
mkdir -m 0777 -p ${absolutePath}
set -eu
mkdir -m 0777 -p "$VOL_DIR"
teardown: |-
#!/bin/sh
while getopts "m:s:p:" opt
do
case $opt in
p)
absolutePath=$OPTARG
;;
s)
sizeInBytes=$OPTARG
;;
m)
volMode=$OPTARG
;;
esac
done
rm -rf ${absolutePath}
set -eu
rm -rf "$VOL_DIR"
helperPod.yaml: |-
apiVersion: v1
kind: Pod
......@@ -209,16 +193,19 @@ The configuration must obey following rules:
3. No duplicate paths allowed for one node.
4. No duplicate node allowed.
#### Scripts `setup` and `teardown` and `helperPod.yaml`
#### Scripts `setup` and `teardown` and the `helperPod.yaml` template
The script `setup` will be executed before the volume is created, to prepare the directory on the node for the volume.
* The `setup` script is run before the volume is created, to prepare the volume directory on the node.
* The `teardown` script is run after the volume is deleted, to cleanup the volume directory on the node.
* The `helperPod.yaml` template is used to create a helper Pod that runs the `setup` or `teardown` script.
The script `teardown` will be executed after the volume is deleted, to cleanup the directory on the node for the volume.
The scripts receive their input as environment variables:
The yaml file `helperPod.yaml` will be created by local-path-storage to execute `setup` or `teardown` script with three paramemters `-p <path> -s <size> -m <mode>` :
* path: the absolute path provisioned on the node
- size: pvc.Spec.resources.requests.storage in bytes
* mode: pvc.Spec.VolumeMode
| Environment variable | Description |
| -------------------- | ----------- |
| `VOL_DIR` | Volume directory that should be created or removed. |
| `VOL_MODE` | The PersistentVolume mode (`Block` or `Filesystem`). |
| `VOL_SIZE_BYTES` | Requested volume size in bytes. |
#### Reloading
......@@ -242,6 +229,12 @@ Before uninstallation, make sure the PVs created by the provisioner have already
To uninstall, execute:
- Stable
```
kubectl delete -f https://raw.githubusercontent.com/rancher/local-path-provisioner/v0.0.22/deploy/local-path-storage.yaml
```
- Development
```
kubectl delete -f https://raw.githubusercontent.com/rancher/local-path-provisioner/master/deploy/local-path-storage.yaml
```
......
apiVersion: v1
description: Use HostPath for persistent local storage with Kubernetes
name: local-path-provisioner
version: 0.0.21
appVersion: "v0.0.21"
version: 0.0.22
appVersion: "v0.0.22"
keywords:
- storage
- hostpath
......@@ -10,4 +10,3 @@ kubeVersion: ">=1.12.0-r0"
home: https://github.com/rancher/local-path-provisioner
sources:
- https://github.com/rancher/local-path-provisioner.git
......@@ -56,7 +56,7 @@ default values.
| Parameter | Description | Default |
| ----------------------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| `image.repository` | Local Path Provisioner image name | `rancher/local-path-provisioner` |
| `image.tag` | Local Path Provisioner image tag | `v0.0.21` |
| `image.tag` | Local Path Provisioner image tag | `v0.0.22` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `storageClass.create` | If true, create a `StorageClass` | `true` |
| `storageClass.provisionerName` | The provisioner name for the storage class | `nil` |
......
......@@ -4,7 +4,7 @@ replicaCount: 1
image:
repository: rancher/local-path-provisioner
tag: v0.0.21
tag: v0.0.22
pullPolicy: IfNotPresent
helperImage:
......@@ -93,40 +93,12 @@ configmap:
# specify the custom script for setup and teardown
setup: |-
#!/bin/sh
while getopts "m:s:p:" opt
do
case $opt in
p)
absolutePath=$OPTARG
;;
s)
sizeInBytes=$OPTARG
;;
m)
volMode=$OPTARG
;;
esac
done
mkdir -m 0777 -p ${absolutePath}
set -eu
mkdir -m 0777 -p "$VOL_DIR"
teardown: |-
#!/bin/sh
while getopts "m:s:p:" opt
do
case $opt in
p)
absolutePath=$OPTARG
;;
s)
sizeInBytes=$OPTARG
;;
m)
volMode=$OPTARG
;;
esac
done
rm -rf ${absolutePath}
set -eu
rm -rf "$VOL_DIR"
# specify the custom helper pod yaml
helperPod: |-
apiVersion: v1
......
......@@ -23,40 +23,12 @@ data:
}
setup: |-
#!/bin/sh
while getopts "m:s:p:" opt
do
case $opt in
p)
absolutePath=$OPTARG
;;
s)
sizeInBytes=$OPTARG
;;
m)
volMode=$OPTARG
;;
esac
done
mkdir -m 0777 -p ${absolutePath}
set -eu
mkdir -m 0777 -p "$VOL_DIR"
teardown: |-
#!/bin/sh
while getopts "m:s:p:" opt
do
case $opt in
p)
absolutePath=$OPTARG
;;
s)
sizeInBytes=$OPTARG
;;
m)
volMode=$OPTARG
;;
esac
done
rm -rf ${absolutePath}
set -eu
rm -rf "$VOL_DIR"
helperPod.yaml: |-
apiVersion: v1
kind: Pod
......
......@@ -62,7 +62,7 @@ spec:
serviceAccountName: local-path-provisioner-service-account
containers:
- name: local-path-provisioner
image: rancher/local-path-provisioner:v0.0.21
image: rancher/local-path-provisioner:v0.0.22
imagePullPolicy: IfNotPresent
command:
- local-path-provisioner
......@@ -110,40 +110,12 @@ data:
}
setup: |-
#!/bin/sh
while getopts "m:s:p:" opt
do
case $opt in
p)
absolutePath=$OPTARG
;;
s)
sizeInBytes=$OPTARG
;;
m)
volMode=$OPTARG
;;
esac
done
mkdir -m 0777 -p ${absolutePath}
set -eu
mkdir -m 0777 -p "$VOL_DIR"
teardown: |-
#!/bin/sh
while getopts "m:s:p:" opt
do
case $opt in
p)
absolutePath=$OPTARG
;;
s)
sizeInBytes=$OPTARG
;;
m)
volMode=$OPTARG
;;
esac
done
rm -rf ${absolutePath}
set -eu
rm -rf "$VOL_DIR"
helperPod.yaml: |-
apiVersion: v1
kind: Pod
......
......@@ -16,7 +16,7 @@ spec:
serviceAccountName: local-path-provisioner-service-account
containers:
- name: local-path-provisioner
image: rancher/local-path-provisioner:v0.0.21
image: rancher/local-path-provisioner:v0.0.22
imagePullPolicy: Always
command:
- local-path-provisioner
......
......@@ -3,7 +3,7 @@ this is an example to enable quota for xfs
# Usage
> 1. build a helper image using the sample dockerfile to replace helper image xxx/storage-xfs-quota:v0.1 at configmap(helperPod.yaml) of debug.yaml.
> 2. use the sample setup and teardown script at configmap of debug.yaml
> 2. use the sample setup and teardown scripts contained within the kustomization.
Notice:
> 1. make sure the path at nodePathMap is the mountpoint of xfs which enables pquota
......@@ -13,6 +13,7 @@ Notice:
> git clone https://github.com/rancher/local-path-provisioner.git
> cd local-path-provisioner
> go build
> kubectl apply -f debug.yaml
> kubectl apply -k examples/quota
> kubectl delete -n local-path-storage deployment local-path-provisioner
> ./local-path-provisioner --debug start --namespace=local-path-storage
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment