-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5c988c2
commit e350f43
Showing
1 changed file
with
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# How to import volumes | ||
|
||
This guide explains how to import an existing Hetzner volume into your Kubernetes cluster with the csi-driver installed. | ||
|
||
1. Detach your volume by running `hcloud volume detach <volume-name>` | ||
2. Find the ID of your volume by running `hcloud volume list` | ||
3. Create a new PersistentVolume and insert the volume ID into the `volumeHandle` | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: PersistentVolume | ||
metadata: | ||
name: imported-data | ||
spec: | ||
storageClassName: hcloud-volumes | ||
capacity: | ||
storage: 10Gi | ||
accessModes: | ||
- ReadWriteOnce | ||
csi: | ||
fsType: ext4 | ||
driver: csi.hetzner.cloud | ||
volumeHandle: "<VOLUME-ID>" | ||
``` | ||
4. Create a new PersistentVolumeClaim and link it to the PersistentVolume via `volumeName` | ||
|
||
```yaml | ||
kind: PersistentVolumeClaim | ||
apiVersion: v1 | ||
metadata: | ||
name: imported-data | ||
spec: | ||
storageClassName: hcloud-volumes | ||
volumeName: imported-data # <-- reference PV name | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 10Gi | ||
``` |