diff --git a/README.md b/README.md index e4676162..45fcdff1 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,10 @@ -# 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 ``. To maintain backward compatibility with earlier deployment files, the naming of NFS Client Provisioner is retained. -```sh -make build -make container -# `nfs-subdir-external-provisioner:latest` will be created. -# To upload this to your custom 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. @@ -38,7 +27,7 @@ $ helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/n 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. @@ -72,11 +61,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. +You must edit the provisioner's deployment file to specify the correct location of your nfs-subdir-external-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 with your server's hostname. @@ -132,7 +119,7 @@ To disable leader election, define an env variable named ENABLE_LEADER_ELECTION | 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-` | | 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 | -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 @@ -147,7 +134,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: @@ -185,6 +172,19 @@ 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. +# To upload this to your custom 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 +``` + # 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}`. diff --git a/deploy/deployment-arm.yaml b/deploy/deployment-arm.yaml deleted file mode 100644 index ec19d92b..00000000 --- a/deploy/deployment-arm.yaml +++ /dev/null @@ -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: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.0-rc2 - volumeMounts: - - name: nfs-client-root - mountPath: /persistentvolumes - env: - - name: PROVISIONER_NAME - value: k8s-sigs.io/nfs-subdir-external-provisioner - - 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 diff --git a/deploy/objects/deployment-arm.yaml b/deploy/objects/deployment-arm.yaml deleted file mode 100644 index 7519f51a..00000000 --- a/deploy/objects/deployment-arm.yaml +++ /dev/null @@ -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: gcr.io/k8s-staging-sig-storage/nfs-subdir-external-provisioner:v4.0.0 - volumeMounts: - - name: nfs-client-root - mountPath: /persistentvolumes - env: - - name: PROVISIONER_NAME - value: k8s-sigs.io/nfs-subdir-external-provisioner - - 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