Skip to content

Commit

Permalink
Add storage how-to documentation (canonical#164)
Browse files Browse the repository at this point in the history
* add storage how-to documenation

Provides a step by step guide on how to enable, configure and disable
the storage component.
  • Loading branch information
bschimke95 authored Feb 29, 2024
1 parent bbc03a7 commit 30c6ec7
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/src/howto/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Overview <self>
:titlesonly:
install/index
/howto/storage
/howto/contribute
/howto/support
/howto/networking/default-dns
Expand Down
65 changes: 65 additions & 0 deletions docs/src/howto/storage.md
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

0 comments on commit 30c6ec7

Please sign in to comment.