Compare commits
62 Commits
v4.0.0-rc1
...
nfs-subdir
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
888d6dbd39 | ||
|
|
cadce2dbc9 | ||
|
|
fab8b5623e | ||
|
|
b668ec9f74 | ||
|
|
b5b2918215 | ||
|
|
2bee3e0f77 | ||
|
|
f86551598e | ||
|
|
522d8f83d5 | ||
|
|
5364f1b4bf | ||
|
|
7417303508 | ||
|
|
9affea2658 | ||
|
|
8c82a35627 | ||
|
|
863e96984b | ||
|
|
e5d160f03e | ||
|
|
8b8d398b53 | ||
|
|
707f140b76 | ||
|
|
da1c2a6e3e | ||
|
|
8e20383b4c | ||
|
|
21815a26f4 | ||
|
|
b33cad598a | ||
|
|
c50d1aea01 | ||
|
|
5fda156007 | ||
|
|
f08caa228c | ||
|
|
f491425b8b | ||
|
|
1e913d1ade | ||
|
|
a57db9a5a7 | ||
|
|
819f6d382d | ||
|
|
221db2f021 | ||
|
|
b7b4412004 | ||
|
|
487b9092a6 | ||
|
|
a99f3dafb1 | ||
|
|
571aadd47e | ||
|
|
9b9ac9aa8d | ||
|
|
6b7372c8cd | ||
|
|
5f8f90d71a | ||
|
|
f4f3c572b2 | ||
|
|
8da26f952b | ||
|
|
f716044142 | ||
|
|
54ea552d39 | ||
|
|
0a66252619 | ||
|
|
11566f6795 | ||
|
|
8903a7c073 | ||
|
|
099ddce5cc | ||
|
|
bd160c8e1c | ||
|
|
3eb80593a9 | ||
|
|
a1927e5c2e | ||
|
|
607385ebee | ||
|
|
cd45565480 | ||
|
|
23ecb30672 | ||
|
|
f2e15da1e9 | ||
|
|
73163eb740 | ||
|
|
d9f68cefe9 | ||
|
|
ffc0286ee6 | ||
|
|
d19dc6e13b | ||
|
|
3837a51db7 | ||
|
|
56edbc016b | ||
|
|
8dd86a700b | ||
|
|
30b0f52598 | ||
|
|
7483890c52 | ||
|
|
aea8ecafba | ||
|
|
6fd46c11d4 | ||
|
|
f44ac23c42 |
@@ -1 +0,0 @@
|
||||
./release-tools/cloudbuild.sh
|
||||
21
.cloudbuild.sh
Executable file
21
.cloudbuild.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Copyright 2020 The Kubernetes Authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
: ${CSI_PROW_BUILD_PLATFORMS:="linux amd64; linux arm -arm; linux arm64 -arm64; linux ppc64le -ppc64le; linux s390x -s390x"}
|
||||
|
||||
# shellcheck disable=SC1091
|
||||
. release-tools/cloudbuild.sh
|
||||
18
.github/workflows/helm-chart-lint.yml
vendored
Normal file
18
.github/workflows/helm-chart-lint.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: Lint Helm Charts
|
||||
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
lint-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Set up chart-testing
|
||||
uses: helm/chart-testing-action@v2.0.1
|
||||
|
||||
- name: Run chart-testing (lint)
|
||||
run: ct lint --validate-maintainers=false
|
||||
25
.github/workflows/helm-chart-release.yml
vendored
Normal file
25
.github/workflows/helm-chart-release.yml
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
name: Release Helm Charts
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config user.name "$GITHUB_ACTOR"
|
||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
||||
|
||||
- name: Run chart-releaser
|
||||
uses: helm/chart-releaser-action@v1.1.0
|
||||
env:
|
||||
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
|
||||
45
CHANGELOG.md
45
CHANGELOG.md
@@ -1,3 +1,46 @@
|
||||
# v4.0.2
|
||||
- Add arm7 (32bit) support (https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/58)
|
||||
|
||||
# v4.0.1
|
||||
- Preserve name of the PV directory name during archiving (https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/59)
|
||||
|
||||
# v4.0.0
|
||||
- Remove redundant field in the rbac.yaml (https://github.com/kubernetes-retired/external-storage/pull/970)
|
||||
- Use `kubernetes-sigs/sig-storage-lib-external-provisioner` instead of `incubator/external-storage/lib` (https://github.com/kubernetes-retired/external-storage/pull/1026)
|
||||
- Fill in rbac.yaml with ServiceAccount manifest (https://github.com/kubernetes-retired/external-storage/pull/1060, https://github.com/kubernetes-retired/external-storage/pull/1179)
|
||||
- Make ARM deployment consistent with regular deployment (https://github.com/kubernetes-retired/external-storage/pull/1090)
|
||||
- Update Deployment apiVersion (from `extensions/v1beta1` to `apps/v1`) and added selector field (https://github.com/kubernetes-retired/external-storage/pull/1230/, https://github.com/kubernetes-retired/external-storage/pull/1231/, https://github.com/kubernetes-retired/external-storage/pull/1283/, https://github.com/kubernetes-retired/external-storage/pull/1294/)
|
||||
- Fix namespace in deployments (https://github.com/kubernetes-retired/external-storage/pull/1087, https://github.com/kubernetes-retired/external-storage/pull/1279)
|
||||
- Update path creation and implemented possibility save data after removing PV (https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/7/)
|
||||
- Support for running controller outside of cluster (https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/9)
|
||||
- Add a flag to disable leader election (https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/22)
|
||||
- Switched to kubernetes `v1.18.0` to be compatible with `>=1.20` selfLink removal (https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/26/)
|
||||
- Enable mountOptions from StorageClass to PersistentVolume (https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/28)
|
||||
|
||||
# v3.1.0
|
||||
- Make leader-election configurable: default endpoints object namespace to controller's instead of kube-system (https://github.com/kubernetes-retired/external-storage/pull/957)
|
||||
|
||||
# v3.0.1
|
||||
- Fix archiveOnDelete parsing (https://github.com/kubernetes-retired/external-storage/pull/929)
|
||||
|
||||
# v3.0.0
|
||||
- Adds archiveOnDelete parameter to provisioner (https://github.com/kubernetes-retired/external-storage/pull/905)
|
||||
- Change all clusterroles to have endpoints permissions and reduced events permissions, consolidate where possible (https://github.com/kubernetes-retired/external-storage/pull/892)
|
||||
|
||||
# v2.1.2
|
||||
- Propagate StorageClass MountOptions to PVs (https://github.com/kubernetes-retired/external-storage/pull/835)
|
||||
- Skip deletion if the corresponding directory is not found (https://github.com/kubernetes-retired/external-storage/pull/859)
|
||||
|
||||
# v2.1.1
|
||||
- Revert "Add namespace extended attributes to directory" (https://github.com/kubernetes-retired/external-storage/pull/816)
|
||||
|
||||
# v2.1.0
|
||||
- Change the storage apiVersion from `storage.k8s.io/v1beta1` to `storage.k8s.io/v1` (https://github.com/kubernetes-retired/external-storage/pull/599)
|
||||
- Fix Makefile to build on OSX (https://github.com/kubernetes-retired/external-storage/pull/661)
|
||||
- Change the RBAC apiVersion from `rbac.authorization.k8s.io/v1alpha1` to `rbac.authorization.k8s.io/v1` (https://github.com/kubernetes-retired/external-storage/pull/656)
|
||||
- Add serviceAccount to deployment (https://github.com/kubernetes-retired/external-storage/pull/653)
|
||||
- Add namespace extended attributes to directory (https://github.com/kubernetes-retired/external-storage/pull/672)
|
||||
|
||||
# v2.0.1
|
||||
- Add support for ARM (Raspberry PI). Image at `quay.io/external_storage/nfs-client-provisioner-arm`. (https://github.com/kubernetes-incubator/external-storage/pull/275)
|
||||
|
||||
@@ -5,4 +48,4 @@
|
||||
- Fix issue 149 - nfs-client-provisioner create folder with 755, not 777 (https://github.com/kubernetes-incubator/external-storage/pull/150)
|
||||
|
||||
# v1
|
||||
- Initial release
|
||||
- Initial release
|
||||
|
||||
2
Makefile
2
Makefile
@@ -17,4 +17,4 @@ all: build
|
||||
|
||||
include release-tools/build.make
|
||||
|
||||
BUILD_PLATFORMS=linux amd64; linux arm64 -arm64; linux ppc64le -ppc64le; linux s390x -s390x
|
||||
BUILD_PLATFORMS=linux amd64; linux arm -arm; linux arm64 -arm64; linux ppc64le -ppc64le; linux s390x -s390x
|
||||
|
||||
76
README.md
76
README.md
@@ -1,34 +1,25 @@
|
||||
# Kubernetes NFS-Client Provisioner
|
||||
# Kubernetes NFS Subdir External Provisioner
|
||||
|
||||
NFS subdir external provisioner is an automatic provisioner that use your _existing and already configured_ NFS server to support dynamic provisioning of Kubernetes Persistent Volumes via Persistent Volume Claims. Persistent volumes are provisioned as `${namespace}-${pvcName}-${pvName}`.
|
||||
**NFS subdir external provisioner** is an automatic provisioner that use your _existing and already configured_ NFS server to support dynamic provisioning of Kubernetes Persistent Volumes via Persistent Volume Claims. Persistent volumes are provisioned as `${namespace}-${pvcName}-${pvName}`.
|
||||
|
||||
Note: This repository is being migrated from https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client. Some of the following instructions will be updated once the migration is completed. To test container image built from this repository, you will have to build and push the nfs-client-provisioner image using the following instructions.
|
||||
Note: This repository is migrated from https://github.com/kubernetes-incubator/external-storage/tree/master/nfs-client. As part of the migration:
|
||||
- The container image name and repository has changed to `gcr.io/k8s-staging-sig-storage` and `nfs-subdir-external-provisioner` respectively.
|
||||
- To maintain backward compatibility with earlier deployment files, the naming of NFS Client Provisioner is retained as `nfs-client-provisioner` in the deployment YAMLs.
|
||||
- One of the pending areas for development on this repository is to add automated e2e tests. If you would like to contribute, please raise an issue or reach us on the Kubernetes slack #sig-storage channel.
|
||||
|
||||
```sh
|
||||
make build
|
||||
make container
|
||||
# `nfs-subdir-external-provisioner:latest` will be created.
|
||||
# To upload this to your customer registry, say `quay.io/myorg`, you can use
|
||||
# docker tag nfs-subdir-external-provisioner:latest quay.io/myorg/nfs-subdir-external-provisioner:latest
|
||||
# docker push quay.io/myorg/nfs-subdir-external-provisioner:latest
|
||||
```
|
||||
|
||||
## How to deploy nfs-client to your cluster
|
||||
|
||||
**nfs-client** is an automatic provisioner that use your _existing and already configured_ NFS server to support dynamic provisioning of Kubernetes Persistent Volumes via Persistent Volume Claims. Persistent volumes are provisioned as `${namespace}-${pvcName}-${pvName}`.
|
||||
## How to deploy NFS Subdir External Provisioner to your cluster
|
||||
|
||||
To note again, you must _already_ have an NFS Server.
|
||||
|
||||
### With Helm
|
||||
|
||||
Follow the instructions from the helm chart [README](deploy/helm/README.md).
|
||||
Follow the instructions from the helm chart [README](charts/nfs-subdir-external-provisioner/README.md).
|
||||
|
||||
The tl;dr is
|
||||
|
||||
```console
|
||||
$ git clone https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner.git
|
||||
$ cd nfs-subdir-external-provisioner/deploy/helm/
|
||||
$ helm install nfs-subdir-external-provisioner . \
|
||||
$ helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
|
||||
$ helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
|
||||
--set nfs.server=x.x.x.x \
|
||||
--set nfs.path=/exported/path
|
||||
```
|
||||
@@ -39,7 +30,7 @@ $ helm install nfs-subdir-external-provisioner . \
|
||||
|
||||
Make sure your NFS server is accessible from your Kubernetes cluster and get the information you need to connect to it. At a minimum you will need its hostname.
|
||||
|
||||
**Step 2: Get the NFS-Client Provisioner files**
|
||||
**Step 2: Get the NFS Subdir External Provisioner files**
|
||||
|
||||
To setup the provisioner you will download a set of YAML files, edit them to add your NFS server's connection information and then apply each with the `kubectl` / `oc` command.
|
||||
|
||||
@@ -73,11 +64,9 @@ $ oc create role use-scc-hostmount-anyuid --verb=use --resource=scc --resource-n
|
||||
$ oc adm policy add-role-to-user use-scc-hostmount-anyuid system:serviceaccount:$NAMESPACE:nfs-client-provisioner
|
||||
```
|
||||
|
||||
**Step 4: Configure the NFS-Client provisioner**
|
||||
**Step 4: Configure the NFS subdir external provisioner**
|
||||
|
||||
Note: To deploy to an ARM-based environment, use: `deploy/deployment-arm.yaml` instead, otherwise use `deploy/deployment.yaml`.
|
||||
|
||||
You must edit the provisioner's deployment file to specify the correct location of your nfs-client-provisioner container image.
|
||||
If you would like to use a custom built nfs-subdir-external-provisioner image, you must edit the provisioner's deployment file to specify the correct location of your `nfs-client-provisioner` container image.
|
||||
|
||||
Next you must edit the provisioner's deployment file to add connection information for your NFS server. Edit `deploy/deployment.yaml` and replace the two occurences of <YOUR NFS SERVER HOSTNAME> with your server's hostname.
|
||||
|
||||
@@ -101,13 +90,13 @@ spec:
|
||||
serviceAccountName: nfs-client-provisioner
|
||||
containers:
|
||||
- name: nfs-client-provisioner
|
||||
image: quay.io/external_storage/nfs-client-provisioner:latest
|
||||
image: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.2
|
||||
volumeMounts:
|
||||
- name: nfs-client-root
|
||||
mountPath: /persistentvolumes
|
||||
env:
|
||||
- name: PROVISIONER_NAME
|
||||
value: fuseim.pri/ifs
|
||||
value: k8s-sigs.io/nfs-subdir-external-provisioner
|
||||
- name: NFS_SERVER
|
||||
value: <YOUR NFS SERVER HOSTNAME>
|
||||
- name: NFS_PATH
|
||||
@@ -119,7 +108,7 @@ spec:
|
||||
path: /var/nfs
|
||||
```
|
||||
|
||||
You may also want to change the PROVISIONER_NAME above from `fuseim.pri/ifs` to something more descriptive like `nfs-storage`, but if you do remember to also change the PROVISIONER_NAME in the storage class definition below.
|
||||
Note: If you want to change the PROVISIONER_NAME above from `k8s-sigs.io/nfs-subdir-external-provisioner` to something else like `myorg/nfs-storage`, remember to also change the PROVISIONER_NAME in the storage class definition below.
|
||||
|
||||
To disable leader election, define an env variable named ENABLE_LEADER_ELECTION and set its value to false.
|
||||
|
||||
@@ -129,18 +118,18 @@ To disable leader election, define an env variable named ENABLE_LEADER_ELECTION
|
||||
|
||||
| Name | Description | Default |
|
||||
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------: |
|
||||
| onDelete | If it exists and has a delete value, delete the directory, if it exists and has a retain value, save the directory. | will be archived with name on the share: `archived-+volume.Name` |
|
||||
| archiveOnDelete | If it exists and has a false value, delete the directory. if `onDelete` exists, `archiveOnDelete` will be ignored. | will be archived with name on the share: `archived-+volume.Name` |
|
||||
| pathPattern | Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace. To specify metadata use `${.PVC.}`: `${PVC.namespace}` | n/a |
|
||||
| onDelete | If it exists and has a delete value, delete the directory, if it exists and has a retain value, save the directory. | will be archived with name on the share: `archived-<volume.Name>` |
|
||||
| archiveOnDelete | If it exists and has a false value, delete the directory. if `onDelete` exists, `archiveOnDelete` will be ignored. | will be archived with name on the share: `archived-<volume.Name>` |
|
||||
| pathPattern | Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace. To specify metadata use `${.PVC.<metadata>}`. Example: If folder should be named like `<pvc-namespace>-<pvc-name>`, use `${.PVC.namespace}-${.PVC.name}` as pathPattern. | n/a |
|
||||
|
||||
This is `deploy/class.yaml` which defines the NFS-Client's Kubernetes Storage Class:
|
||||
This is `deploy/class.yaml` which defines the NFS subdir external provisioner's Kubernetes Storage Class:
|
||||
|
||||
```yaml
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: managed-nfs-storage
|
||||
provisioner: fuseim.pri/ifs # or choose another name, must match deployment's env PROVISIONER_NAME'
|
||||
provisioner: k8s-sigs.io/nfs-subdir-external-provisioner # or choose another name, must match deployment's env PROVISIONER_NAME'
|
||||
parameters:
|
||||
pathPattern: "${.PVC.namespace}/${.PVC.annotations.nfs.io/storage-path}" # waits for nfs.io/storage-path annotation, if not specified will accept as empty string.
|
||||
onDelete: delete
|
||||
@@ -148,7 +137,7 @@ parameters:
|
||||
|
||||
**Step 6: Finally, test your environment!**
|
||||
|
||||
Now we'll test your NFS provisioner.
|
||||
Now we'll test your NFS subdir external provisioner.
|
||||
|
||||
Deploy:
|
||||
|
||||
@@ -166,7 +155,7 @@ Now check the folder has been deleted.
|
||||
|
||||
**Step 7: Deploying your own PersistentVolumeClaims**
|
||||
|
||||
To deploy your own PVC, make sure that you have the correct `storage-class` as indicated by your `deploy/class.yaml` file.
|
||||
To deploy your own PVC, make sure that you have the correct `storageClassName` as indicated by your `deploy/class.yaml` file.
|
||||
|
||||
For example:
|
||||
|
||||
@@ -176,9 +165,9 @@ apiVersion: v1
|
||||
metadata:
|
||||
name: test-claim
|
||||
annotations:
|
||||
volume.beta.kubernetes.io/storage-class: "managed-nfs-storage"
|
||||
nfs.io/storage-path: "test-path" # not required, depending on whether this annotation was shown in the storage class description
|
||||
spec:
|
||||
storageClassName: managed-nfs-storage
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
resources:
|
||||
@@ -186,6 +175,20 @@ spec:
|
||||
storage: 1Mi
|
||||
```
|
||||
|
||||
# Build and publish your own container image
|
||||
|
||||
To build your own custom container image from this repository, you will have to build and push the nfs-subdir-external-provisioner image using the following instructions.
|
||||
|
||||
```sh
|
||||
make build
|
||||
make container
|
||||
# `nfs-subdir-external-provisioner:latest` will be created.
|
||||
# Note: This will build a single-arch image that matches the machine on which container is built.
|
||||
# To upload this to your custom registry, say `quay.io/myorg` and arch as amd64, you can use
|
||||
# docker tag nfs-subdir-external-provisioner:latest quay.io/myorg/nfs-subdir-external-provisioner-amd64:latest
|
||||
# docker push quay.io/myorg/nfs-subdir-external-provisioner-amd64:latest
|
||||
```
|
||||
|
||||
# Build and publish with GitHub Actions
|
||||
|
||||
In a forked repository you can use GitHub Actions pipeline defined in [.github/workflows/release.yml](.github/workflows/release.yml). The pipeline builds Docker images for `linux/amd64`, `linux/arm64`, and `linux/arm/v7` platforms and publishes them using a multi-arch manifest. The pipeline is triggered when you add a tag like `gh-v{major}.{minor}.{patch}` to your commit and push it to GitHub. The tag is used for generating Docker image tags: `latest`, `{major}`, `{major}:{minor}`, `{major}:{minor}:{patch}`.
|
||||
@@ -202,3 +205,6 @@ The pipeline adds several labels:
|
||||
**Important:**
|
||||
* The pipeline performs the docker login command using `REGISTRY_USERNAME` and `REGISTRY_TOKEN` secrets, which have to be provided.
|
||||
* You also need to provide the `DOCKER_IMAGE` secret specifying your Docker image name, e.g., `quay.io/[username]/nfs-subdir-external-provisioner`.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
apiVersion: v1
|
||||
appVersion: 3.1.0
|
||||
appVersion: 4.0.2
|
||||
description: nfs-subdir-external-provisioner is an automatic provisioner that used your *already configured* NFS server, automatically creating Persistent Volumes.
|
||||
name: nfs-subdir-external-provisioner
|
||||
home: https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
|
||||
version: 3.0.0
|
||||
kubeVersion: ">=1.9.0 <1.20.0"
|
||||
version: 4.0.7
|
||||
kubeVersion: ">=1.9.0-0"
|
||||
sources:
|
||||
- https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner
|
||||
keywords:
|
||||
@@ -5,22 +5,19 @@ The [NFS subdir external provisioner](https://github.com/kubernetes-sigs/nfs-sub
|
||||
## TL;DR;
|
||||
|
||||
```console
|
||||
$ git clone https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner.git
|
||||
$ cd nfs-subdir-external-provisioner/deploy/helm/
|
||||
$ helm install nfs-subdir-external-provisioner . \
|
||||
$ helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
|
||||
$ helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
|
||||
--set nfs.server=x.x.x.x \
|
||||
--set nfs.path=/exported/path
|
||||
```
|
||||
|
||||
For **arm** deployments set `image.repository` to `--set image.repository=quay.io/external_storage/nfs-client-provisioner-arm`
|
||||
|
||||
## 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-sigs/nfs-subdir-external-provisioner) into the cluster which dynamically creates persistent volumes from single NFS share.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes >=1.9, <1.20
|
||||
- Kubernetes >=1.9
|
||||
- Existing NFS Share
|
||||
|
||||
## Installing the Chart
|
||||
@@ -28,9 +25,9 @@ This charts installs custom [storage class](https://kubernetes.io/docs/concepts/
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```console
|
||||
$ helm install my-release . \
|
||||
$ helm install my-release nfs-subdir-external-provisioner/nfs-subdir-external-provisioner \
|
||||
--set nfs.server=x.x.x.x \
|
||||
--set nfs.path=/exported/path```
|
||||
--set nfs.path=/exported/path
|
||||
```
|
||||
|
||||
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.
|
||||
@@ -55,16 +52,19 @@ The following tables lists the configurable parameters of this chart and their d
|
||||
| ----------------------------------- | ----------------------------------------------------------- | ------------------------------------------------- |
|
||||
| `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.1.0-k8s1.11` |
|
||||
| `image.repository` | Provisioner image | `gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner` |
|
||||
| `image.tag` | Version of provisioner image | `v4.0.2` |
|
||||
| `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` |
|
||||
| `storageClass.archiveOnDelete` | Archive PVC when deleting | `true` |
|
||||
| `storageClass.onDelete` | Strategy on PVC deletion. Overrides `archiveOnDelete` when set to lowercase values `delete` or `retain` | null |
|
||||
| `storageClass.pathPattern` | Specifies a template for the directory name | null |
|
||||
| `storageClass.accessModes` | Set access mode for PV | `ReadWriteOnce` |
|
||||
| `leaderElection.enabled` | Enables or disables leader election | `true` |
|
||||
| `nfs.server` | Hostname of the NFS server (required) | null (ip or hostname) |
|
||||
| `nfs.path` | Basepath of the mount point to be used | `/nfs-storage` |
|
||||
| `nfs.mountOptions` | Mount options (e.g. 'nfsvers=3') | null |
|
||||
@@ -55,6 +55,10 @@ spec:
|
||||
value: {{ .Values.nfs.server }}
|
||||
- name: NFS_PATH
|
||||
value: {{ .Values.nfs.path }}
|
||||
{{- if eq .Values.leaderElection.enabled false }}
|
||||
- name: ENABLE_LEADER_ELECTION
|
||||
value: "false"
|
||||
{{- end }}
|
||||
{{- with .Values.resources }}
|
||||
resources:
|
||||
{{ toYaml . | indent 12 }}
|
||||
@@ -17,6 +17,12 @@ allowVolumeExpansion: {{ .Values.storageClass.allowVolumeExpansion }}
|
||||
reclaimPolicy: {{ .Values.storageClass.reclaimPolicy }}
|
||||
parameters:
|
||||
archiveOnDelete: "{{ .Values.storageClass.archiveOnDelete }}"
|
||||
{{- if .Values.storageClass.pathPattern }}
|
||||
pathPattern: "{{ .Values.storageClass.pathPattern }}"
|
||||
{{- end }}
|
||||
{{- if .Values.storageClass.onDelete }}
|
||||
onDelete: "{{ .Values.storageClass.onDelete }}"
|
||||
{{- end }}
|
||||
{{- if .Values.nfs.mountOptions }}
|
||||
mountOptions:
|
||||
{{- range .Values.nfs.mountOptions }}
|
||||
@@ -2,8 +2,8 @@ replicaCount: 1
|
||||
strategyType: Recreate
|
||||
|
||||
image:
|
||||
repository: quay.io/external_storage/nfs-client-provisioner
|
||||
tag: v3.1.0-k8s1.11
|
||||
repository: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner
|
||||
tag: v4.0.2
|
||||
pullPolicy: IfNotPresent
|
||||
|
||||
nfs:
|
||||
@@ -35,9 +35,22 @@ storageClass:
|
||||
# When set to false your PVs will not be archived by the provisioner upon deletion of the PVC.
|
||||
archiveOnDelete: true
|
||||
|
||||
# If it exists and has 'delete' value, delete the directory. If it exists and has 'retain' value, save the directory.
|
||||
# Overrides archiveOnDelete.
|
||||
# Ignored if value not set.
|
||||
onDelete:
|
||||
|
||||
# Specifies a template for creating a directory path via PVC metadata's such as labels, annotations, name or namespace.
|
||||
# Ignored if value not set.
|
||||
pathPattern:
|
||||
|
||||
# Set access mode - ReadWriteOnce, ReadOnlyMany or ReadWriteMany
|
||||
accessModes: ReadWriteOnce
|
||||
|
||||
leaderElection:
|
||||
# When set to false leader election will be disabled
|
||||
enabled: true
|
||||
|
||||
## For RBAC support:
|
||||
rbac:
|
||||
# Specifies whether RBAC resources should be created
|
||||
@@ -139,8 +139,8 @@ func (p *nfsProvisioner) Provision(ctx context.Context, options controller.Provi
|
||||
|
||||
func (p *nfsProvisioner) Delete(ctx context.Context, volume *v1.PersistentVolume) error {
|
||||
path := volume.Spec.PersistentVolumeSource.NFS.Path
|
||||
relativePath := strings.Replace(path, p.path, "", 1)
|
||||
oldPath := filepath.Join(mountPath, relativePath)
|
||||
basePath := filepath.Base(path)
|
||||
oldPath := filepath.Join(mountPath, basePath)
|
||||
|
||||
if _, err := os.Stat(oldPath); os.IsNotExist(err) {
|
||||
glog.Warningf("path %s does not exist, deletion skipped", oldPath)
|
||||
@@ -179,7 +179,7 @@ func (p *nfsProvisioner) Delete(ctx context.Context, volume *v1.PersistentVolume
|
||||
}
|
||||
}
|
||||
|
||||
archivePath := filepath.Join(mountPath, "archived-"+volume.Name)
|
||||
archivePath := filepath.Join(mountPath, "archived-"+basePath)
|
||||
glog.V(4).Infof("archiving path %s to %s", oldPath, archivePath)
|
||||
return os.Rename(oldPath, archivePath)
|
||||
}
|
||||
|
||||
@@ -2,6 +2,6 @@ apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: managed-nfs-storage
|
||||
provisioner: fuseim.pri/ifs # or choose another name, must match deployment's env PROVISIONER_NAME'
|
||||
provisioner: k8s-sigs.io/nfs-subdir-external-provisioner # or choose another name, must match deployment's env PROVISIONER_NAME'
|
||||
parameters:
|
||||
archiveOnDelete: "false"
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nfs-client-provisioner
|
||||
labels:
|
||||
app: nfs-client-provisioner
|
||||
# replace with namespace where provisioner is deployed
|
||||
namespace: default
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nfs-client-provisioner
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nfs-client-provisioner
|
||||
spec:
|
||||
serviceAccountName: nfs-client-provisioner
|
||||
containers:
|
||||
- name: nfs-client-provisioner
|
||||
image: quay.io/external_storage/nfs-client-provisioner-arm:latest
|
||||
volumeMounts:
|
||||
- name: nfs-client-root
|
||||
mountPath: /persistentvolumes
|
||||
env:
|
||||
- name: PROVISIONER_NAME
|
||||
value: fuseim.pri/ifs
|
||||
- name: NFS_SERVER
|
||||
value: 10.10.10.60
|
||||
- name: NFS_PATH
|
||||
value: /ifs/kubernetes
|
||||
volumes:
|
||||
- name: nfs-client-root
|
||||
nfs:
|
||||
server: 10.10.10.60
|
||||
path: /ifs/kubernetes
|
||||
@@ -21,19 +21,19 @@ spec:
|
||||
serviceAccountName: nfs-client-provisioner
|
||||
containers:
|
||||
- name: nfs-client-provisioner
|
||||
image: quay.io/external_storage/nfs-client-provisioner:latest
|
||||
image: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.2
|
||||
volumeMounts:
|
||||
- name: nfs-client-root
|
||||
mountPath: /persistentvolumes
|
||||
env:
|
||||
- name: PROVISIONER_NAME
|
||||
value: fuseim.pri/ifs
|
||||
value: k8s-sigs.io/nfs-subdir-external-provisioner
|
||||
- name: NFS_SERVER
|
||||
value: 10.10.10.60
|
||||
value: 10.3.243.101
|
||||
- name: NFS_PATH
|
||||
value: /ifs/kubernetes
|
||||
volumes:
|
||||
- name: nfs-client-root
|
||||
nfs:
|
||||
server: 10.10.10.60
|
||||
server: 10.3.243.101
|
||||
path: /ifs/kubernetes
|
||||
|
||||
@@ -2,6 +2,6 @@ apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: managed-nfs-storage
|
||||
provisioner: fuseim.pri/ifs # or choose another name, must match deployment's env PROVISIONER_NAME'
|
||||
provisioner: k8s-sigs.io/nfs-subdir-external-provisioner # or choose another name, must match deployment's env PROVISIONER_NAME'
|
||||
parameters:
|
||||
archiveOnDelete: "false"
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
kind: Deployment
|
||||
apiVersion: extensions/v1beta1
|
||||
metadata:
|
||||
name: nfs-client-provisioner
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nfs-client-provisioner
|
||||
spec:
|
||||
serviceAccountName: nfs-client-provisioner
|
||||
containers:
|
||||
- name: nfs-client-provisioner
|
||||
image: quay.io/external_storage/nfs-client-provisioner-arm:latest
|
||||
volumeMounts:
|
||||
- name: nfs-client-root
|
||||
mountPath: /persistentvolumes
|
||||
env:
|
||||
- name: PROVISIONER_NAME
|
||||
value: fuseim.pri/ifs
|
||||
- name: NFS_SERVER
|
||||
value: 10.10.10.60
|
||||
- name: NFS_PATH
|
||||
value: /ifs/kubernetes
|
||||
volumes:
|
||||
- name: nfs-client-root
|
||||
nfs:
|
||||
server: 10.10.10.60
|
||||
path: /ifs/kubernetes
|
||||
@@ -14,13 +14,13 @@ spec:
|
||||
serviceAccountName: nfs-client-provisioner
|
||||
containers:
|
||||
- name: nfs-client-provisioner
|
||||
image: quay.io/external_storage/nfs-client-provisioner:latest
|
||||
image: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.2
|
||||
volumeMounts:
|
||||
- name: nfs-client-root
|
||||
mountPath: /persistentvolumes
|
||||
env:
|
||||
- name: PROVISIONER_NAME
|
||||
value: fuseim.pri/ifs
|
||||
value: k8s-sigs.io/nfs-subdir-external-provisioner
|
||||
- name: NFS_SERVER
|
||||
value: 10.10.10.60
|
||||
- name: NFS_PATH
|
||||
|
||||
@@ -2,8 +2,6 @@ kind: PersistentVolumeClaim
|
||||
apiVersion: v1
|
||||
metadata:
|
||||
name: test-claim
|
||||
annotations:
|
||||
volume.beta.kubernetes.io/storage-class: "managed-nfs-storage"
|
||||
spec:
|
||||
storageClassName: managed-nfs-storage
|
||||
accessModes:
|
||||
|
||||
Reference in New Issue
Block a user