Commit 4b32a0be authored by Arie Peterson's avatar Arie Peterson
Browse files

Merge branch 'pull-upstream-master' into 'master'

Merge changes from upstream master

See merge request !4
parents fe10b9e1 f88bf090
Pipeline #11506 passed with stages
in 1 minute and 39 seconds
......@@ -186,6 +186,75 @@ volumes:
host:
path: /var/run/docker.sock
---
kind: pipeline
name: s390x
platform:
os: linux
arch: amd64
# Hack needed for s390x: https://gist.github.com/colstrom/c2f359f72658aaabb44150ac20b16d7c#gistcomment-3858388
node:
arch: s390x
steps:
- name: build
image: rancher/dapper:v0.5.8
commands:
- dapper ci
volumes:
- name: docker
path: /var/run/docker.sock
- name: github_binary_release
image: rancher/drone-images:github-release-s390x
settings:
api_key:
from_secret: github_token
prerelease: true
checksum:
- sha256
checksum_file: CHECKSUMsum-s390x.txt
checksum_flatten: true
files:
- "dist/artifacts/*"
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_TAG}-s390x"
username:
from_secret: docker_username
when:
instance:
- drone-publish.rancher.io
ref:
- refs/head/master
- refs/tags/*
event:
- tag
volumes:
- name: docker
host:
path: /var/run/docker.sock
---
kind: pipeline
name: manifest
......@@ -206,6 +275,7 @@ steps:
- linux/amd64
- linux/arm64
- linux/arm
- linux/s390x
target: "rancher/local-path-provisioner:${DRONE_TAG}"
template: "rancher/local-path-provisioner:${DRONE_TAG}-ARCH"
when:
......@@ -221,3 +291,4 @@ depends_on:
- amd64
- arm64
- arm
- s390x
......@@ -42,7 +42,7 @@ local-path-provisioner-d744ccf98-xfcbk 1/1 Running 0 7m
Check and follow the provisioner log using:
```
$ kubectl -n local-path-storage logs -f -l app=local-path-provisioner
kubectl -n local-path-storage logs -f -l app=local-path-provisioner
```
## Usage
......
apiVersion: v1
description: Use HostPath for persistent local storage with Kubernetes
name: local-path-provisioner
version: 0.0.20
appVersion: "v0.0.20"
version: 0.0.21
appVersion: "v0.0.21"
keywords:
- storage
- hostpath
......
......@@ -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.20` |
| `image.tag` | Local Path Provisioner image tag | `v0.0.21` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `storageClass.create` | If true, create a `StorageClass` | `true` |
| `storageClass.provisionerName` | The provisioner name for the storage class | `nil` |
......
......@@ -47,6 +47,18 @@ spec:
{{- end }}
- --configmap-name
- {{ .Values.configmap.name }}
{{- if .Values.workerThreads }}
- --worker-threads
- {{ .Values.workerThreads }}
{{- end }}
{{- if .Values.provisioningRetryCount }}
- --provisioning-retry-count
- {{ .Values.provisioningRetryCount }}
{{- end }}
{{- if .Values.deletionRetryCount }}
- --deletion-retry-count
- {{ .Values.deletionRetryCount }}
{{- end }}
volumeMounts:
- name: config-volume
mountPath: /etc/config/
......
......@@ -4,7 +4,7 @@ replicaCount: 1
image:
repository: rancher/local-path-provisioner
tag: v0.0.20
tag: v0.0.21
pullPolicy: IfNotPresent
helperImage:
......@@ -139,7 +139,11 @@ configmap:
image: busybox
imagePullPolicy: IfNotPresent
# Number of provisioner worker threads to call provision/delete simultaneously.
# workerThreads: 4
# Number of retries of failed volume provisioning. 0 means retry indefinitely.
# provisioningRetryCount: 15
# Number of retries of failed volume deletion. 0 means retry indefinitely.
# deletionRetryCount: 15
......@@ -62,7 +62,7 @@ spec:
serviceAccountName: local-path-provisioner-service-account
containers:
- name: local-path-provisioner
image: rancher/local-path-provisioner:v0.0.20
image: rancher/local-path-provisioner:v0.0.21
imagePullPolicy: IfNotPresent
command:
- local-path-provisioner
......
......@@ -16,7 +16,7 @@ spec:
serviceAccountName: local-path-provisioner-service-account
containers:
- name: local-path-provisioner
image: rancher/local-path-provisioner:v0.0.20
image: rancher/local-path-provisioner:v0.0.21
imagePullPolicy: Always
command:
- local-path-provisioner
......
......@@ -19,26 +19,32 @@ import (
)
var (
VERSION = "0.0.1"
FlagConfigFile = "config"
FlagProvisionerName = "provisioner-name"
EnvProvisionerName = "PROVISIONER_NAME"
DefaultProvisionerName = "rancher.io/local-path"
FlagNamespace = "namespace"
EnvNamespace = "POD_NAMESPACE"
DefaultNamespace = "local-path-storage"
FlagHelperImage = "helper-image"
EnvHelperImage = "HELPER_IMAGE"
DefaultHelperImage = "rancher/library-busybox:1.32.1"
FlagServiceAccountName = "service-account-name"
DefaultServiceAccount = "local-path-provisioner-service-account"
EnvServiceAccountName = "SERVICE_ACCOUNT_NAME"
FlagKubeconfig = "kubeconfig"
DefaultConfigFileKey = "config.json"
DefaultConfigMapName = "local-path-config"
FlagConfigMapName = "configmap-name"
FlagHelperPodFile = "helper-pod-file"
DefaultHelperPodFile = "helperPod.yaml"
VERSION = "0.0.1"
FlagConfigFile = "config"
FlagProvisionerName = "provisioner-name"
EnvProvisionerName = "PROVISIONER_NAME"
DefaultProvisionerName = "rancher.io/local-path"
FlagNamespace = "namespace"
EnvNamespace = "POD_NAMESPACE"
DefaultNamespace = "local-path-storage"
FlagHelperImage = "helper-image"
EnvHelperImage = "HELPER_IMAGE"
DefaultHelperImage = "rancher/library-busybox:1.32.1"
FlagServiceAccountName = "service-account-name"
DefaultServiceAccount = "local-path-provisioner-service-account"
EnvServiceAccountName = "SERVICE_ACCOUNT_NAME"
FlagKubeconfig = "kubeconfig"
DefaultConfigFileKey = "config.json"
DefaultConfigMapName = "local-path-config"
FlagConfigMapName = "configmap-name"
FlagHelperPodFile = "helper-pod-file"
DefaultHelperPodFile = "helperPod.yaml"
FlagWorkerThreads = "worker-threads"
DefaultWorkerThreads = pvController.DefaultThreadiness
FlagProvisioningRetryCount = "provisioning-retry-count"
DefaultProvisioningRetryCount = pvController.DefaultFailedProvisionThreshold
FlagDeletionRetryCount = "deletion-retry-count"
DefaultDeletionRetryCount = pvController.DefaultFailedDeleteThreshold
)
func cmdNotFound(c *cli.Context, command string) {
......@@ -107,6 +113,21 @@ func StartCmd() cli.Command {
Usage: "Paths to the Helper pod yaml file",
Value: "",
},
cli.IntFlag{
Name: FlagWorkerThreads,
Usage: "Number of provisioner worker threads.",
Value: DefaultWorkerThreads,
},
cli.IntFlag{
Name: FlagProvisioningRetryCount,
Usage: "Number of retries of failed volume provisioning. 0 means retry indefinitely.",
Value: DefaultProvisioningRetryCount,
},
cli.IntFlag{
Name: FlagDeletionRetryCount,
Usage: "Number of retries of failed volume deletion. 0 means retry indefinitely.",
Value: DefaultDeletionRetryCount,
},
},
Action: func(c *cli.Context) {
if err := startDaemon(c); err != nil {
......@@ -222,6 +243,21 @@ func startDaemon(c *cli.Context) error {
}
}
provisioningRetryCount := c.Int(FlagProvisioningRetryCount)
if provisioningRetryCount < 0 {
return fmt.Errorf("invalid negative integer flag %v", FlagProvisioningRetryCount)
}
deletionRetryCount := c.Int(FlagDeletionRetryCount)
if deletionRetryCount < 0 {
return fmt.Errorf("invalid negative integer flag %v", FlagDeletionRetryCount)
}
workerThreads := c.Int(FlagWorkerThreads)
if workerThreads <= 0 {
return fmt.Errorf("invalid zero or negative integer flag %v", FlagWorkerThreads)
}
provisioner, err := NewProvisioner(stopCh, kubeClient, configFile, namespace, helperImage, configMapName, serviceAccountName, helperPodYaml)
if err != nil {
return err
......@@ -232,6 +268,9 @@ func startDaemon(c *cli.Context) error {
provisioner,
serverVersion.GitVersion,
pvController.LeaderElection(false),
pvController.FailedProvisionThreshold(provisioningRetryCount),
pvController.FailedDeleteThreshold(deletionRetryCount),
pvController.Threadiness(workerThreads),
)
logrus.Debug("Provisioner started")
pc.Run(stopCh)
......
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