diff --git a/stable/nfs-client-provisioner/.helmignore b/stable/nfs-client-provisioner/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/stable/nfs-client-provisioner/.helmignore @@ -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 diff --git a/stable/nfs-client-provisioner/Chart.yaml b/stable/nfs-client-provisioner/Chart.yaml new file mode 100644 index 0000000000..4afccd8b47 --- /dev/null +++ b/stable/nfs-client-provisioner/Chart.yaml @@ -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: bart@verwilst.be +keywords: +- nfs +- storage diff --git a/stable/nfs-client-provisioner/README.md b/stable/nfs-client-provisioner/README.md new file mode 100644 index 0000000000..d9bb365255 --- /dev/null +++ b/stable/nfs-client-provisioner/README.md @@ -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) | `{}` | diff --git a/stable/nfs-client-provisioner/ci/test-values.yaml b/stable/nfs-client-provisioner/ci/test-values.yaml new file mode 100644 index 0000000000..2ef0a71579 --- /dev/null +++ b/stable/nfs-client-provisioner/ci/test-values.yaml @@ -0,0 +1,2 @@ +nfs: + server: 127.0.0.1 diff --git a/stable/nfs-client-provisioner/templates/_helpers.tpl b/stable/nfs-client-provisioner/templates/_helpers.tpl new file mode 100644 index 0000000000..824e26c23f --- /dev/null +++ b/stable/nfs-client-provisioner/templates/_helpers.tpl @@ -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 -}} diff --git a/stable/nfs-client-provisioner/templates/clusterrole.yaml b/stable/nfs-client-provisioner/templates/clusterrole.yaml new file mode 100644 index 0000000000..ba09b3e5a6 --- /dev/null +++ b/stable/nfs-client-provisioner/templates/clusterrole.yaml @@ -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"] diff --git a/stable/nfs-client-provisioner/templates/clusterrolebinding.yaml b/stable/nfs-client-provisioner/templates/clusterrolebinding.yaml new file mode 100644 index 0000000000..a3dd1b9f7e --- /dev/null +++ b/stable/nfs-client-provisioner/templates/clusterrolebinding.yaml @@ -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 diff --git a/stable/nfs-client-provisioner/templates/deployment.yaml b/stable/nfs-client-provisioner/templates/deployment.yaml new file mode 100644 index 0000000000..5ca757543c --- /dev/null +++ b/stable/nfs-client-provisioner/templates/deployment.yaml @@ -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 }} diff --git a/stable/nfs-client-provisioner/templates/serviceaccount.yaml b/stable/nfs-client-provisioner/templates/serviceaccount.yaml new file mode 100644 index 0000000000..294089676d --- /dev/null +++ b/stable/nfs-client-provisioner/templates/serviceaccount.yaml @@ -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 -}} diff --git a/stable/nfs-client-provisioner/templates/storageclass.yaml b/stable/nfs-client-provisioner/templates/storageclass.yaml new file mode 100644 index 0000000000..686ffe98f7 --- /dev/null +++ b/stable/nfs-client-provisioner/templates/storageclass.yaml @@ -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 -}} diff --git a/stable/nfs-client-provisioner/values.yaml b/stable/nfs-client-provisioner/values.yaml new file mode 100644 index 0000000000..9eb72b3fe5 --- /dev/null +++ b/stable/nfs-client-provisioner/values.yaml @@ -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: {}