Skip to content

Commit

Permalink
bump lpp to 0.0.27
Browse files Browse the repository at this point in the history
  • Loading branch information
rxbn committed May 28, 2024
1 parent 76c3839 commit 796eae9
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 20 deletions.
4 changes: 2 additions & 2 deletions charts/local-path-provisioner/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v1
description: Use HostPath for persistent local storage with Kubernetes
name: local-path-provisioner
version: 0.0.26
appVersion: "v0.0.26"
version: 0.0.27
appVersion: "v0.0.27"
keywords:
- storage
- hostpath
Expand Down
11 changes: 6 additions & 5 deletions charts/local-path-provisioner/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ solution than the built-in `local` volume feature in Kubernetes.
```console
$ git clone https://github.com/rancher/local-path-provisioner.git
$ cd local-path-provisioner
$ helm install --name local-path-storage --namespace local-path-storage ./deploy/chart/
$ helm install --name local-path-storage --namespace local-path-storage ./deploy/chart/local-path-provisioner
```

## Introduction
Expand All @@ -30,7 +30,7 @@ To install the chart with the release name `local-path-storage`:
```console
$ git clone https://github.com/rancher/local-path-provisioner.git
$ cd local-path-provisioner
$ helm install ./deploy/chart/ --name local-path-storage --namespace local-path-storage
$ helm install ./deploy/chart/local-path-provisioner --name local-path-storage --namespace local-path-storage
```

The command deploys Local Path Provisioner on the Kubernetes cluster in the default configuration. The
Expand Down Expand Up @@ -64,6 +64,7 @@ default values.
| `storageClass.defaultVolumeType` | The default volume type this storage class creates | `hostPath` |
| `storageClass.name` | The name to assign the created StorageClass | local-path |
| `storageClass.reclaimPolicy` | ReclaimPolicy field of the class | Delete |
| `storageClass.pathPattern` | Template for the volume directory name | `nil` |
| `nodePathMap` | Configuration of where to store the data on each node | `[{node: DEFAULT_PATH_FOR_NON_LISTED_NODES, paths: [/opt/local-path-provisioner]}]` |
| `resources` | Local Path Provisioner resource requests & limits | `{}` |
| `rbac.create` | If true, create & use RBAC resources | `true` |
Expand All @@ -81,14 +82,14 @@ default values.
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

```console
$ helm install ./deploy/chart/ --name local-path-storage --namespace local-path-storage --set storageClass.provisionerName=rancher.io/local-path
$ helm install ./deploy/chart/local-path-provisioner --name local-path-storage --namespace local-path-storage --set storageClass.provisionerName=rancher.io/local-path
```

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the
chart. For example,

```console
$ helm install --name local-path-storage --namespace local-path-storage ./deploy/chart/ -f values.yaml
$ helm install --name local-path-storage --namespace local-path-storage ./deploy/chart/local-path-provisioner -f values.yaml
```

> **Tip**: You can use the default [values.yaml](values.yaml)
Expand All @@ -113,5 +114,5 @@ If the output contains "beta", you may install the chart with RBAC enabled (see
To enable the creation of RBAC resources (On clusters with RBAC). Do the following:

```console
$ helm install ./deploy/chart/ --name local-path-storage --namespace local-path-storage --set rbac.create=true
$ helm install ./deploy/chart/local-path-provisioner --name local-path-storage --namespace local-path-storage --set rbac.create=true
```
24 changes: 23 additions & 1 deletion charts/local-path-provisioner/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,20 @@ data:
{{- with .Values.sharedFileSystemPath }}
{{- $config = set $config "sharedFileSystemPath" . }}
{{- end }}
{{- with .Values.storageClassConfigs }}
{{- $configs := dict }}
{{- range $key, $value := . }}
{{- $configValue := dict }}
{{- with $value.nodePathMap }}
{{- $configValue = set $configValue "nodePathMap" . }}
{{- end }}
{{- with $value.sharedFileSystemPath }}
{{- $configValue = set $configValue "sharedFileSystemPath" . }}
{{- end }}
{{- $configs = set $configs $key $configValue }}
{{- end }}
{{- $config = set $config "storageClassConfigs" $configs }}
{{- end }}
{{- $config | toPrettyJson | nindent 4 }}
setup: |-
{{- .Values.configmap.setup | nindent 4 }}
Expand All @@ -22,8 +36,13 @@ data:
helperPod.yaml: |-
apiVersion: v1
kind: Pod
namespace: {{ default .Release.Namespace .Values.configmap.helperPod.namespaceOverride }}
metadata:
name: helper-pod
name: {{ .Values.configmap.helperPod.name }}
{{- with .Values.configmap.helperPod.annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
priorityClassName: system-node-critical
tolerations:
Expand All @@ -38,3 +57,6 @@ data:
image: {{ .Values.helperImage.repository }}:{{ .Values.helperImage.tag }}
{{- end }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
resources:
{{- toYaml .Values.helperPod.resources | nindent 12 }}
7 changes: 4 additions & 3 deletions charts/local-path-provisioner/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app.kubernetes.io/name: {{ include "local-path-provisioner.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{ include "local-path-provisioner.labels" . | indent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand Down Expand Up @@ -74,6 +73,8 @@ spec:
env:
- name: POD_NAMESPACE
value: {{ .Release.Namespace }}
- name: CONFIG_MOUNT_PATH
value: /etc/config/
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
Expand All @@ -91,4 +92,4 @@ spec:
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
30 changes: 22 additions & 8 deletions charts/local-path-provisioner/templates/storageclass.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
{{ if .Values.storageClass.create -}}
{{- $storageClasses := list }}
{{ if .Values.storageClassConfigs }}
{{ $storageClasses = .Values.storageClassConfigs }}
{{- else }}
{{ $storageClasses = dict .Values.storageClass.name .Values }}
{{ end }}
{{- $dot := . }}
{{- range $name, $values := $storageClasses }}
{{ if $values.storageClass.create -}}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: {{ .Values.storageClass.name }}
name: {{ $name }}
labels:
{{ include "local-path-provisioner.labels" . | indent 4 }}
{{ include "local-path-provisioner.labels" $dot | indent 4 }}
annotations:
storageclass.kubernetes.io/is-default-class: "{{ .Values.storageClass.defaultClass }}"
defaultVolumeType: "{{ .Values.storageClass.defaultVolumeType }}"
provisioner: {{ template "local-path-provisioner.provisionerName" . }}
volumeBindingMode: {{ .Values.storageClass.volumeBindingMode }}
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
storageclass.kubernetes.io/is-default-class: "{{ $values.storageClass.defaultClass }}"
defaultVolumeType: "{{ $values.storageClass.defaultVolumeType }}"
provisioner: {{ template "local-path-provisioner.provisionerName" $dot }}
volumeBindingMode: {{ $values.storageClass.volumeBindingMode }}
reclaimPolicy: {{ $values.storageClass.reclaimPolicy }}
allowVolumeExpansion: true
{{- if .Values.storageClass.pathPattern }}
parameters:
pathPattern: {{ .Values.storageClass.pathPattern | quote }}
{{ end -}}
{{- end }}
---
{{- end }}
35 changes: 34 additions & 1 deletion charts/local-path-provisioner/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ replicaCount: 1

image:
repository: rancher/local-path-provisioner
tag: v0.0.26
tag: v0.0.27
pullPolicy: IfNotPresent

helperImage:
Expand Down Expand Up @@ -47,6 +47,9 @@ storageClass:
## volumeBindingMode field controls when volume binding and dynamic provisioning should occur, can be "Immediate" or "WaitForFirstConsumer"
volumeBindingMode: WaitForFirstConsumer

## Set a path pattern, if unset the default will be used
# pathPattern: "{{ .PVC.Namespace }}-{{ .PVC.Name }}"

# nodePathMap is the place user can customize where to store the data on each node.
# 1. If one node is not listed on the nodePathMap, and Kubernetes wants to create volume on it, the paths specified in
# DEFAULT_PATH_FOR_NON_LISTED_NODES will be used for provisioning.
Expand All @@ -72,6 +75,22 @@ nodePathMap:
# If `sharedFileSystemPath` is used, then `nodePathMap` must be set to `[]`.
# sharedFileSystemPath: ""

# `storageClassConfigs` allows the provisioner to manage multiple independent storage classes.
# Each storage class must have a unique name, and contains the same fields as shown above for
# a single storage class setup, EXCEPT for the provisionerName, which is the same for all
# storage classes, and name, which is the key of the map.
# storageClassConfigs: {}
# my-storage-class:
# storageClass:
# create: true
# defaultClass: false
# defaultVolumeType: hostPath
# reclaimPolicy: Delete
# sharedFileSystemPath: ""
# ## OR
# # See above
# nodePathMap: {}

podAnnotations: {}

podSecurityContext: {}
Expand Down Expand Up @@ -99,6 +118,15 @@ resources: {}
# cpu: 100m
# memory: 128Mi

helperPod:
resources: {}
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi

rbac:
# Specifies whether RBAC resources should be created
create: true
Expand Down Expand Up @@ -128,6 +156,11 @@ configmap:
#!/bin/sh
set -eu
rm -rf "$VOL_DIR"
helperPod:
# Allows to run the helper pod in another namespace. Uses release namespace by default.
namespaceOverride: ""
name: "helper-pod"
annotations: {}

# Number of provisioner worker threads to call provision/delete simultaneously.
# workerThreads: 4
Expand Down

0 comments on commit 796eae9

Please sign in to comment.