This repository has been archived by the owner on Feb 22, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16.7k
NFS client provisioner #6433
Merged
Merged
NFS client provisioner #6433
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
5eb0c58
Add nfs-client-provisioner chart
verwilst 11c7984
Moved to stable, minimum version is 1.9+
verwilst df53d67
Change provisionerName default
verwilst 650853f
Change incubator references to stable in README, Add heritage labels,…
verwilst 48d0aed
update values.yaml to serviceAccount changes
verwilst 5ac4942
use helpers for storageclass provisionerName
verwilst 862463c
actually use template for helper variable
verwilst 0f40d9d
Make allowVolumeExpansion and reclaimPolicy configurable
verwilst d67533e
fullname everywhere, update readme and set to latest version
verwilst 08f470e
use helper for serviceAccountName
verwilst 7329421
Update deployment.yaml
unguiculus 1ce1eb4
Update values.yaml
unguiculus adac718
remove whitespace
verwilst 621c4df
Merge branch 'nfs-client-provisioner' of github.com:verwilst/charts i…
verwilst 9ca4f93
use helper function for sa binding as well
verwilst ed61c6e
add default nfs.server value for ci
verwilst 7d7b4b1
add endpoints bindings
verwilst 09598e6
go to version 3.0.1
verwilst eb65cb4
add archiveOnDelete, sync clusterrole rules
verwilst 63f859b
fix README.md parameters
verwilst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Patterns to ignore when building packages. | ||
# This supports shell glob matching, relative path matching, and | ||
# negation (prefixed with !). Only one pattern per line. | ||
.DS_Store | ||
# Common VCS dirs | ||
.git/ | ||
.gitignore | ||
.bzr/ | ||
.bzrignore | ||
.hg/ | ||
.hgignore | ||
.svn/ | ||
# Common backup files | ||
*.swp | ||
*.bak | ||
*.tmp | ||
*~ | ||
# Various IDEs | ||
.project | ||
.idea/ | ||
*.tmproj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: v1 | ||
appVersion: 2.1.1 | ||
description: nfs-client is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes. | ||
name: nfs-client-provisioner | ||
home: https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client | ||
version: 0.1.0 | ||
sources: | ||
- https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client | ||
maintainers: | ||
- name: verwilst | ||
email: [email protected] | ||
keywords: | ||
- nfs | ||
- storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# nfs-client-provisioner | ||
|
||
The [NFS client provisioner](https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client) is an automatic provisioner for Kubernetes that uses your *already configured* NFS server, automatically creating Persistent Volumes. | ||
|
||
## TL;DR; | ||
|
||
```console | ||
$ helm install stable/nfs-client-provisioner | ||
``` | ||
|
||
## Introduction | ||
|
||
This charts installs custom [storage class](https://kubernetes.io/docs/concepts/storage/storage-classes/) into a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. It also installs a [NFS client provisioner](https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client) into the cluster which dynamically creates persistent volumes from single NFS share. | ||
|
||
## Prerequisites | ||
|
||
- Kubernetes 1.9+ | ||
- Existing NFS Share | ||
|
||
## Installing the Chart | ||
|
||
To install the chart with the release name `my-release`: | ||
|
||
```console | ||
$ helm install --name my-release --set nfs.server=x.x.x.x --set nfs.path=/exported/path stable/nfs-client-provisioner | ||
``` | ||
|
||
The command deploys the given storage class in the default configuration. It can be used afterswards to provision persistent volumes. The [configuration](#configuration) section lists the parameters that can be configured during installation. | ||
|
||
> **Tip**: List all releases using `helm list` | ||
|
||
## Uninstalling the Chart | ||
|
||
To uninstall/delete the `my-release` deployment: | ||
|
||
```console | ||
$ helm delete my-release | ||
``` | ||
|
||
The command removes all the Kubernetes components associated with the chart and deletes the release. | ||
|
||
## Configuration | ||
|
||
The following tables lists the configurable parameters of this chart and their default values. | ||
|
||
| Parameter | Description | Default | | ||
| --------------------------------- | ------------------------------------- | --------------------------------------------------------- | | ||
| `replicaCount` | number of provisioner instances to deployed | `1` | | ||
| `strategyType` | specifies the strategy used to replace old Pods by new ones | `Recreate` | | ||
| `image.repository` | provisioner image | `quay.io/external_storage/nfs-client-provisioner` | | ||
| `image.tag` | version of provisioner image | `v3.0.1-k8s1.11` | | ||
| `image.pullPolicy` | image pull policy | `IfNotPresent` | | ||
| `storageclass.name` | name of the storageclass | `nfs-client` | | ||
| `storageclass.defaultClass` | Set as the default StorageClass | `false` | | ||
| `storageclass.allowVolumeExpansion` | Allow expanding the volume | `true` | | ||
| `storageclass.reclaimPolicy` | Method used to reclaim an obsoleted volume | `Delete` | | ||
| `storageclass.provisionerName` | name of the provisionerName | null | | ||
| `storageclass.archiveOnDelete` | archive pvc when deleting | `true` | | ||
| `nfs.server` | hostname of the NFS server | null (ip or hostname) | | ||
| `nfs.path` | basepath of the mount point to be used | `/ifs/kubernetes` | | ||
| `resources` | Resources required (e.g. CPU, memory) | `{}` | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
nfs: | ||
server: 127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "nfs-client-provisioner.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
If release name contains chart name it will be used as a full name. | ||
*/}} | ||
{{- define "nfs-client-provisioner.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- $name := default .Chart.Name .Values.nameOverride -}} | ||
{{- if contains $name .Release.Name -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "nfs-client-provisioner.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{- define "nfs-client-provisioner.provisionerName" -}} | ||
{{- if .Values.storageClass.provisionerName -}} | ||
{{- printf .Values.storageClass.provisionerName -}} | ||
{{- else -}} | ||
cluster.local/{{ template "nfs-client-provisioner.fullname" . -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "nfs-client-provisioner.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create -}} | ||
{{ default (include "nfs-client-provisioner.fullname" .) .Values.serviceAccount.name }} | ||
{{- else -}} | ||
{{ default "default" .Values.serviceAccount.name }} | ||
{{- end -}} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
kind: ClusterRole | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
labels: | ||
app: {{ template "nfs-client-provisioner.name" . }} | ||
chart: {{ template "nfs-client-provisioner.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "nfs-client-provisioner.fullname" . }}-runner | ||
rules: | ||
- apiGroups: [""] | ||
resources: ["persistentvolumes"] | ||
verbs: ["get", "list", "watch", "create", "delete"] | ||
- apiGroups: [""] | ||
resources: ["persistentvolumeclaims"] | ||
verbs: ["get", "list", "watch", "update"] | ||
- apiGroups: ["storage.k8s.io"] | ||
resources: ["storageclasses"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["create", "update", "patch"] | ||
- apiGroups: [""] | ||
resources: ["endpoints"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch"] |
17 changes: 17 additions & 0 deletions
17
stable/nfs-client-provisioner/templates/clusterrolebinding.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
kind: ClusterRoleBinding | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
metadata: | ||
labels: | ||
app: {{ template "nfs-client-provisioner.name" . }} | ||
chart: {{ template "nfs-client-provisioner.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: run-{{ template "nfs-client-provisioner.fullname" . }} | ||
subjects: | ||
- kind: ServiceAccount | ||
name: {{ template "nfs-client-provisioner.serviceAccountName" . }} | ||
namespace: {{ .Release.Namespace }} | ||
roleRef: | ||
kind: ClusterRole | ||
name: {{ template "nfs-client-provisioner.fullname" . }}-runner | ||
apiGroup: rbac.authorization.k8s.io |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "nfs-client-provisioner.fullname" . }} | ||
labels: | ||
app: {{ template "nfs-client-provisioner.name" . }} | ||
chart: {{ template "nfs-client-provisioner.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
replicas: {{ .Values.replicaCount }} | ||
strategy: | ||
type: {{ .Values.strategyType }} | ||
selector: | ||
matchLabels: | ||
app: {{ template "nfs-client-provisioner.name" . }} | ||
release: {{ .Release.Name }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "nfs-client-provisioner.name" . }} | ||
release: {{ .Release.Name }} | ||
spec: | ||
serviceAccountName: {{ template "nfs-client-provisioner.serviceAccountName" . }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
volumeMounts: | ||
- name: nfs-client-root | ||
mountPath: /persistentvolumes | ||
env: | ||
- name: PROVISIONER_NAME | ||
value: {{ template "nfs-client-provisioner.provisionerName" . }} | ||
- name: NFS_SERVER | ||
value: {{ .Values.nfs.server }} | ||
- name: NFS_PATH | ||
value: {{ .Values.nfs.path }} | ||
volumes: | ||
- name: nfs-client-root | ||
nfs: | ||
server: {{ .Values.nfs.server }} | ||
path: {{ .Values.nfs.path }} |
11 changes: 11 additions & 0 deletions
11
stable/nfs-client-provisioner/templates/serviceaccount.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{{ if .Values.serviceAccount.create }} | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
labels: | ||
app: {{ template "nfs-client-provisioner.name" . }} | ||
chart: {{ template "nfs-client-provisioner.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ template "nfs-client-provisioner.serviceAccountName" . }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{ if .Values.storageClass.create -}} | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
labels: | ||
app: {{ template "nfs-client-provisioner.name" . }} | ||
chart: {{ template "nfs-client-provisioner.chart" . }} | ||
heritage: {{ .Release.Service }} | ||
release: {{ .Release.Name }} | ||
name: {{ .Values.storageClass.name }} | ||
{{- if .Values.storageClass.defaultClass }} | ||
annotations: | ||
storageclass.kubernetes.io/is-default-class: "true" | ||
{{- end }} | ||
provisioner: {{ template "nfs-client-provisioner.provisionerName" . }} | ||
allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }} | ||
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }} | ||
parameters: | ||
archiveOnDelete: "{{ .Values.storageClass.archiveOnDelete }}" | ||
{{ end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Default values for nfs-client-provisioner. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
|
||
replicaCount: 1 | ||
strategyType: Recreate | ||
|
||
image: | ||
repository: quay.io/external_storage/nfs-client-provisioner | ||
tag: v3.0.1-k8s1.11 | ||
pullPolicy: IfNotPresent | ||
|
||
nfs: | ||
server: | ||
path: /ifs/kubernetes | ||
|
||
# For creating the StorageClass automatically: | ||
storageClass: | ||
create: true | ||
|
||
# Set a provisioner name. If unset, a name will be generated. | ||
# provisionerName: | ||
|
||
# Set StorageClass as the default StorageClass | ||
# Ignored if storageClass.create is false | ||
defaultClass: false | ||
|
||
# Set a StorageClass name | ||
# Ignored if storageClass.create is false | ||
name: nfs-client | ||
|
||
# Allow volume to be expanded dynamically | ||
allowVolumeExpansion: true | ||
|
||
# Method used to reclaim an obsoleted volume | ||
reclaimPolicy: Delete | ||
|
||
# When set to false your PVs will not be archived by the provisioner upon deletion of the PVC. | ||
archiveOnDelete: true | ||
|
||
## For RBAC support: | ||
rbac: | ||
# Specifies whether RBAC resources should be created | ||
create: true | ||
|
||
serviceAccount: | ||
# Specifies whether a ServiceAccount should be created | ||
create: true | ||
|
||
# The name of the ServiceAccount to use. | ||
# If not set and create is true, a name is generated using the fullname template | ||
name: | ||
|
||
resources: {} | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
|
||
nodeSelector: {} | ||
|
||
tolerations: [] | ||
|
||
affinity: {} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should endpoints access be added too? see: https://github.com/kubernetes-incubator/external-storage/blob/master/nfs-client/deploy/auth/clusterrole.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only been added 2 weeks ago so it seems kubernetes-retired/external-storage@d46083d. I can sync it though. ;-) Man I really want to get this merged. :-p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be good - it was malfunctioning for me without it