cleaning up storage

This commit is contained in:
Denise Schannon
2018-07-17 15:00:55 -07:00
parent 0ea65c0d37
commit ffb24e0eb4
7 changed files with 93 additions and 104 deletions
@@ -1,7 +1,6 @@
---
title: Editing Clusters
weight: 3015
draft: true
---
## Editing the Cluster Membership
@@ -1,5 +1,5 @@
---
title: Creating and Managing Projects
title: Editing Projects
weight: 3021
aliases:
- /rancher/v2.x/en/tasks/projects/create-project/
@@ -1,5 +1,5 @@
---
title: Adding and Managing Project Members
title: Adding Users to Projects
weight: 3022
aliases:
- /rancher/v2.x/en/tasks/projects/add-project-members/
@@ -3,6 +3,7 @@ title: Volumes and Storage
weight: 3050
aliases:
- /rancher/v2.x/en/concepts/volumes-and-storage/
- /rancher/v2.x/en/tasks/clusters/adding-storage/
---
There are two ways to create volumes on Kubernetes: Persistent Volumes (PVs) and Storage Classes.
@@ -14,6 +15,61 @@ _Persistent Volumes_ are pre-provisioned storage volumes that you can bind to sp
Rancher allows you to create PVs at cluster level and bind them to PVCs later. Volumes are managed on a per-project basis.
### Adding a Persistent Volume
>**Prerequisites:**
>
>- Working with storage requires the `Manage Volumes` [role]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-role-reference).
>- You must have a storage medium provisioned. For more information, see [Provisioning Storage](provisioning-storage).
Your containers can store data on themselves, but if a container fails, that data is lost. To solve this issue, Kubernetes offers _persistent volumes_, which are external storage disks or file systems that your containers can access. If a container crashes, its replacement container can access the data in a persistent volume without any data loss.
Persistent volumes can either be a disk or file system that you host on premise, or they can be hosted by a vendor, such as Amazon EBS or Azure Disk.
>**Prerequisite:**
>
>- Create a storage volume either on premise or in the cloud, using one of the vendor services listed in [Types of Persistent Volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes).
>- Gather metadata about your storage volume after you create it. You'll need to enter this information into Rancher.
1. From the **Global** view, open the cluster running the containers that you want to add persistent volume storage to.
1. From the main menu, select **Storage > Persistent Volumes**.
1. Click **Add Volume**.
1. Enter a **Name** for the persistent volume.
1. Select the **Volume Plugin** for the disk type or service that you're using.
>**Note:** If the cluster you are adding storage for is a cloud service that also offers cloud storage, you must enable the `cloud provider` option for the cluster, and you must use the service's plug-in to use cloud storage. For example, if you have a Amazon EC2 cluster and you want to use cloud storage for it:
1. You must enable the `cloud provider` option for the EC2 cluster.
2. You must use the `Amazon EBS Disk` volume plugin.
1. Enter the **Capacity** of your volume in gigabytes.
1. Complete the **Plugin Configuration** form. Each plugin type requires information specific to the vendor of disk type. For help regarding each plugin's form and the information that's required, refer to the plug-in's vendor documentation.
1. **Optional:** Complete the **Customize** form. This form features:
- [Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes):
This options sets how many nodes can access the volume, along with the node read/write permissions. The [Kubernetes Documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) includes a table that lists which access modes are supported by the plugins available.
- [Mount Options](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options):
Each volume plugin allows you to specify additional command line options during the mounting process. You can enter these options in the **Mount Option** fields. Consult each plugin's vendor documentation for the mount options available.
- **Assign to Storage Class:**
If you later want to automatically provision persistent volumes identical to the volume that you've specified here, assign it a storage class. Later, when you create a workload, you can assign it a persistent volume claim that references the storage class, which will provision a persistent volume identical to the volume you've specified here.
>**Note:** You must [add a storage class](#adding-storage-classes) before you can assign it to a persistent volume.
1. Click **Save**.
**Result:** Your new persistent volume is created.
## Storage Classes
Storage Classes allow you to create PVCs dynamically without having to create PVs first. For example, an Amazon EBS Storage Class will dynamically create EBS volumes and bind them to PVCs. A Storage Class is similar to the notion of a _storage driver_. The following figure illustrates how a PVC creation triggers the dynamic provisioning of an underlying EBS volume.
@@ -49,13 +105,39 @@ Finally, you can define custom `MountOptions` for the persistent volume created.
`parameters` are specific to each cloud storage provisioner. For full information about the storage classes provisioner parameters, refer to the official [Kubernetes documentation](https://kubernetes.io/docs/concepts/storage/storage-classes/#parameters).
### Adding Storage Classes
_Storage Classes_ allow you to dynamically provision persistent volumes on demand. Think of storage classes as storage profiles that are created automatically upon a request (which is known as a _persistent volume claim_).
1. From the **Global** view, open the cluster for which you want to dynamically provision persistent storage volumes.
1. From the main menu, select `Storage > Storage Classes`. Click `Add Class`.
1. Enter a `Name` for your storage class.
1. From the `Provisioner` drop-down, select the service that you want to use to dynamically provision storage volumes.
>**Note:** If the cluster you are adding a storage class for is a cloud service that also offers cloud storage, you must enable the `cloud provider` option for the cluster, and you must use the service's plug-in to use cloud storage. For example, if you have a Amazon EC2 cluster and you want to use cloud storage for it:
1. You must enable the `cloud provider` option for the EC2 cluster.
2. You must use the `Amazon EBS Disk` provisioner.
1. From the `Parameters` section, fill out the information required for the service to dynamically provision storage volumes. Each provisioner requires different information to dynamically provision storage volumes. Consult the service's documentation for help on how to obtain this information.
1. Click `Save`.
## What's Next?
Mount Persistent Volumes to workloads so that your applications can store their data. You can mount a either a manually created Persistent Volumes or a dynamically created Persistent Volume, which is created from a a Storage Class.
You can mount Persistent Volumes in one of two contexts:
- During deployment of a workload (recommended if possible). For more information, see [Deploying Workloads]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/workloads/deploy-workloads/).
- Following workload creation. For more information, see [Adding Persistent Volume Claims]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/persistent-volume-claims/).
## Related Links
### External Docs
- [Storage](https://kubernetes.io/docs/concepts/storage/)
### Tutorials
- [Adding Storage]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/persistent-volumes-and-storage-classes/)
- [Adding Persistent Volume Claims]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/persistent-volume-claim)
@@ -1,5 +1,5 @@
---
title: Provisioning NFS Storage
title: NFS Storage
weight: 3054
aliases:
- /rancher/v2.x/en/tasks/clusters/adding-storage/provisioning-storage/nfs/
@@ -9,7 +9,7 @@ Before you can use the NFS storage volume plug-in with Rancher deployments, you
>**Note:**
>
>- If you already have an NFS share, you don't need to provision a new NFS server to use the NFS volume plugin within Rancher. Instead, skip the rest of this procedure and complete [adding storage]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/persistent-volumes-and-storage-classes/).
>- If you already have an NFS share, you don't need to provision a new NFS server to use the NFS volume plugin within Rancher. Instead, skip the rest of this procedure and complete [adding storage]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/).
>
>- This procedure demonstrates how to setup an NFS server using Ubuntu, although you should be able to use these instructions for other Linux distros (e.g. Debian, RHEL, Arch Linux, etc.). For official instruction on how to create an NFS server using another Linux distro, consult the distro's documentation.
@@ -65,4 +65,4 @@ Before you can use the NFS storage volume plug-in with Rancher deployments, you
## What's Next?
Within Rancher, add the NFS server as a [storage volume]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/persistent-volumes-and-storage-classes/#adding-a-persistent-volume) and/or [storage class]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/persistent-volumes-and-storage-classes/#adding-storage-classes). After adding the server, you can use it for storage for your deployments.
Within Rancher, add the NFS server as a [storage volume]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/#adding-a-persistent-volume) and/or [storage class]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/#adding-storage-classes). After adding the server, you can use it for storage for your deployments.
@@ -12,7 +12,7 @@ _Persistent Volume Claims_ (or PVCs) are objects that request storage resources
- Each Rancher project contains a list of PVCs that you've created, available from the **Volumes** tab. You can reuse these PVCs when creating deployments in the future.
>**Prerequisite:**
> You must have a pre-provisioned [persistent volume]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/persistent-volumes-and-storage-classes/#adding-a-persistent-volume) available for use, or you must have a [storage class created]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/persistent-volumes-and-storage-classes/#adding-storage-classes) that dynamically creates a volume upon request from the workload.
> You must have a pre-provisioned [persistent volume]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/#adding-a-persistent-volume) available for use, or you must have a [storage class created]({{< baseurl >}}/rancher/v2.x/en/kubernetes-in-rancher/volumes-and-storage/#adding-storage-classes) that dynamically creates a volume upon request from the workload.
1. From the **Global** view, open the project containing a workload that you want to add a PVC to.
@@ -1,92 +0,0 @@
---
title: Persistent Volumes and Storage Classes
weight: 3051
aliases:
- /rancher/v2.x/en/tasks/clusters/adding-storage/
---
>**Prerequisites:**
>
>- Working with storage requires the `Manage Volumes` [role]({{< baseurl >}}/rancher/v2.x/en/admin-settings/rbac/cluster-project-roles/#project-role-reference).
>- You must have a storage medium provisioned. For more information, see [Provisioning Storage](provisioning-storage).
## Adding a Persistent Volume
Your containers can store data on themselves, but if a container fails, that data is lost. To solve this issue, Kubernetes offers _persistent volumes_, which are external storage disks or file systems that your containers can access. If a container crashes, its replacement container can access the data in a persistent volume without any data loss.
Persistent volumes can either be a disk or file system that you host on premise, or they can be hosted by a vendor, such as Amazon EBS or Azure Disk.
>**Prerequisite:**
>
>- Create a storage volume either on premise or in the cloud, using one of the vendor services listed in [Types of Persistent Volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes).
>- Gather metadata about your storage volume after you create it. You'll need to enter this information into Rancher.
1. From the **Global** view, open the cluster running the containers that you want to add persistent volume storage to.
1. From the main menu, select **Storage > Persistent Volumes**.
1. Click **Add Volume**.
1. Enter a **Name** for the persistent volume.
1. Select the **Volume Plugin** for the disk type or service that you're using.
>**Note:** If the cluster you are adding storage for is a cloud service that also offers cloud storage, you must enable the `cloud provider` option for the cluster, and you must use the service's plug-in to use cloud storage. For example, if you have a Amazon EC2 cluster and you want to use cloud storage for it:
1. You must enable the `cloud provider` option for the EC2 cluster.
2. You must use the `Amazon EBS Disk` volume plugin.
1. Enter the **Capacity** of your volume in gigabytes.
1. Complete the **Plugin Configuration** form. Each plugin type requires information specific to the vendor of disk type. For help regarding each plugin's form and the information that's required, refer to the plug-in's vendor documentation.
1. **Optional:** Complete the **Customize** form. This form features:
- [Access Modes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes):
This options sets how many nodes can access the volume, along with the node read/write permissions. The [Kubernetes Documentation](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes) includes a table that lists which access modes are supported by the plugins available.
- [Mount Options](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options):
Each volume plugin allows you to specify additional command line options during the mounting process. You can enter these options in the **Mount Option** fields. Consult each plugin's vendor documentation for the mount options available.
- **Assign to Storage Class:**
If you later want to automatically provision persistent volumes identical to the volume that you've specified here, assign it a storage class. Later, when you create a workload, you can assign it a persistent volume claim that references the storage class, which will provision a persistent volume identical to the volume you've specified here.
>**Note:** You must [add a storage class](#adding-storage-classes) before you can assign it to a persistent volume.
1. Click **Save**.
**Result:** Your new persistent volume is created.
## Adding Storage Classes
_Storage Classes_ allow you to dynamically provision persistent volumes on demand. Think of storage classes as storage profiles that are created automatically upon a request (which is known as a _persistent volume claim_).
1. From the **Global** view, open the cluster for which you want to dynamically provision persistent storage volumes.
1. From the main menu, select `Storage > Storage Classes`. Click `Add Class`.
1. Enter a `Name` for your storage class.
1. From the `Provisioner` drop-down, select the service that you want to use to dynamically provision storage volumes.
>**Note:** If the cluster you are adding a storage class for is a cloud service that also offers cloud storage, you must enable the `cloud provider` option for the cluster, and you must use the service's plug-in to use cloud storage. For example, if you have a Amazon EC2 cluster and you want to use cloud storage for it:
1. You must enable the `cloud provider` option for the EC2 cluster.
2. You must use the `Amazon EBS Disk` provisioner.
1. From the `Parameters` section, fill out the information required for the service to dynamically provision storage volumes. Each provisioner requires different information to dynamically provision storage volumes. Consult the service's documentation for help on how to obtain this information.
1. Click `Save`.
## What's Next?
Mount Persistent Volumes to workloads so that your applications can store their data. You can mount a either a manually created Persistent Volumes or a dynamically created Persistent Volume, which is created from a a Storage Class.
You can mount Persistent Volumes in one of two contexts:
- During deployment of a workload (recommended if possible). For more information, see [Deploying Workloads](../../workloads/deploy-workloads/).
- Following workload creation. For more information, see [Adding Persistent Volume Claims](../../workloads/add-persistent-volume-claim/).