forked from canonical/k8s-snap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add storage how-to documentation (canonical#164)
* add storage how-to documenation Provides a step by step guide on how to enable, configure and disable the storage component.
- Loading branch information
1 parent
bbc03a7
commit 30c6ec7
Showing
2 changed files
with
66 additions
and
0 deletions.
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
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,65 @@ | ||
# Use default storage in Canonical Kubernetes | ||
|
||
Canonical Kubernetes offers a local storage option to quickly set up and run a | ||
cluster, especially for single-node support. This guide walks you through | ||
enabling and configuring this feature. | ||
|
||
## What you'll need | ||
|
||
This guide assumes the following: | ||
|
||
- You have root or sudo access to the machine | ||
- You have a bootstraped Canonical Kubernetes cluster (see the | ||
[getting-started-guide]). | ||
|
||
|
||
## Enable Storage | ||
When bootstrapping the snap, the storage functionality is not enabled by | ||
default. To enable it, execute the following command: | ||
|
||
```sh | ||
sudo k8s enable storage | ||
``` | ||
|
||
## Configure Storage | ||
While the storage option comes with sensible defaults, you can customise it to | ||
meet your requirements. Obtain the current configuration by running: | ||
|
||
```sh | ||
sudo k8s get storage | ||
``` | ||
|
||
You can modify the configuration using the `set` command. For example, to | ||
change the local storage path: | ||
|
||
```sh | ||
sudo k8s set storage.local-path=/path/to/new/folder | ||
``` | ||
|
||
The storage functionality provides the following configuration options: | ||
|
||
- **local-path**: path where the local files will be created. | ||
- **reclaim-policy**: set the reclaim policy of the persistent volumes | ||
provisioned. It should be one of "Retain", "Recycle", or "Delete". | ||
- **set-default**: set the local-storage storage class to be the default. If | ||
this flag is not set and the cluster has already a default storage class it | ||
is not changed. If this flag is not set and the cluster does not have a | ||
default class set then the class from the local-storage becomes the default | ||
one. | ||
|
||
## Disable Storage | ||
The local storage option is suitable for single-node clusters and development | ||
environments, but it has inherent limitations. For a production environment you | ||
typically want a more sophisticated storage solution. To disable the storage | ||
functionality, run: | ||
|
||
``` | ||
sudo k8s disable storage | ||
``` | ||
|
||
Note that this will only remove the CSI driver. The persististent volume claim | ||
will still be there and your data remain on disk. | ||
|
||
|
||
<!-- LINKS --> | ||
[getting-started-guide]: ../tutorial/getting-started.md |