From e350f435164e40d725c201c7abbe8f47a9a49a51 Mon Sep 17 00:00:00 2001 From: lukasmetzner Date: Wed, 22 Jan 2025 13:09:44 +0100 Subject: [PATCH 1/7] docs: how to import volumes --- docs/kubernetes/how-to-import-volumes.md | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 docs/kubernetes/how-to-import-volumes.md diff --git a/docs/kubernetes/how-to-import-volumes.md b/docs/kubernetes/how-to-import-volumes.md new file mode 100644 index 00000000..e6bb55ea --- /dev/null +++ b/docs/kubernetes/how-to-import-volumes.md @@ -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 ` +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: "" +``` + +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 +``` From 6d944270ec0fb165cd61c410f9098479cd41f291 Mon Sep 17 00:00:00 2001 From: lukasmetzner Date: Wed, 22 Jan 2025 13:35:45 +0100 Subject: [PATCH 2/7] docs: updated import volumes guide --- docs/kubernetes/how-to-import-volumes.md | 26 ++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/docs/kubernetes/how-to-import-volumes.md b/docs/kubernetes/how-to-import-volumes.md index e6bb55ea..778fd8bc 100644 --- a/docs/kubernetes/how-to-import-volumes.md +++ b/docs/kubernetes/how-to-import-volumes.md @@ -1,10 +1,20 @@ # How to import volumes -This guide explains how to import an existing Hetzner volume into your Kubernetes cluster with the csi-driver installed. +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 ` -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` +1. Detach your volume by running + +```bash +hcloud volume detach +``` + +2. Find the ID of your volume by running + +```bash +hcloud volume describe +``` + +3. Create a new PersistentVolume and insert the volume ID into the `` and your volume location into `" + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: csi.hetzner.cloud/location + operator: In + values: + - ``` 4. Create a new PersistentVolumeClaim and link it to the PersistentVolume via `volumeName` From 8bbb706d28689f2a7db1017f6ae826519abe3e0d Mon Sep 17 00:00:00 2001 From: Lukas Metzner Date: Thu, 23 Jan 2025 14:34:03 +0100 Subject: [PATCH 3/7] docs: update docs/kubernetes/how-to-import-volumes.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Julian Tölle --- docs/kubernetes/how-to-import-volumes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kubernetes/how-to-import-volumes.md b/docs/kubernetes/how-to-import-volumes.md index 778fd8bc..e413f2ff 100644 --- a/docs/kubernetes/how-to-import-volumes.md +++ b/docs/kubernetes/how-to-import-volumes.md @@ -14,7 +14,7 @@ hcloud volume detach hcloud volume describe ``` -3. Create a new PersistentVolume and insert the volume ID into the `` and your volume location into `` and your volume location into ``. This ensures that the topology constraints are set up correctly. ```yaml apiVersion: v1 From 42900af8fd7fb8741697acc23341e80942e50c16 Mon Sep 17 00:00:00 2001 From: Lukas Metzner Date: Tue, 28 Jan 2025 09:16:33 +0100 Subject: [PATCH 4/7] docs: update docs/kubernetes/how-to-import-volumes.md Co-authored-by: Jonas L. --- docs/kubernetes/how-to-import-volumes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kubernetes/how-to-import-volumes.md b/docs/kubernetes/how-to-import-volumes.md index e413f2ff..eca1a470 100644 --- a/docs/kubernetes/how-to-import-volumes.md +++ b/docs/kubernetes/how-to-import-volumes.md @@ -2,7 +2,7 @@ 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 +1. Detach your volume by running: ```bash hcloud volume detach From 09a25eb0380410eb588d52df430b248c9dc31287 Mon Sep 17 00:00:00 2001 From: Lukas Metzner Date: Tue, 28 Jan 2025 09:16:42 +0100 Subject: [PATCH 5/7] docs: update docs/kubernetes/how-to-import-volumes.md Co-authored-by: Jonas L. --- docs/kubernetes/how-to-import-volumes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kubernetes/how-to-import-volumes.md b/docs/kubernetes/how-to-import-volumes.md index eca1a470..766180e1 100644 --- a/docs/kubernetes/how-to-import-volumes.md +++ b/docs/kubernetes/how-to-import-volumes.md @@ -8,7 +8,7 @@ This guide explains how to import an existing Hetzner Volume into your Kubernete hcloud volume detach ``` -2. Find the ID of your volume by running +2. Find the ID of your volume by running: ```bash hcloud volume describe From 3e75d07360f85204b66ded68da628f120772eccc Mon Sep 17 00:00:00 2001 From: Lukas Metzner Date: Tue, 28 Jan 2025 09:16:49 +0100 Subject: [PATCH 6/7] docs: update docs/kubernetes/how-to-import-volumes.md Co-authored-by: Jonas L. --- docs/kubernetes/how-to-import-volumes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kubernetes/how-to-import-volumes.md b/docs/kubernetes/how-to-import-volumes.md index 766180e1..7fc41906 100644 --- a/docs/kubernetes/how-to-import-volumes.md +++ b/docs/kubernetes/how-to-import-volumes.md @@ -14,7 +14,7 @@ hcloud volume detach hcloud volume describe ``` -3. Create a new PersistentVolume and insert the volume ID into the `` and your volume location into ``. This ensures that the topology constraints are set up correctly. +3. Create a new `PersistentVolume` and insert the volume ID into the `` and your volume location into ``. This ensures that the topology constraints are set up correctly. ```yaml apiVersion: v1 From 4ee90b614e3ee71a170a24182c1aa1d51b3e600c Mon Sep 17 00:00:00 2001 From: Lukas Metzner Date: Tue, 28 Jan 2025 09:17:02 +0100 Subject: [PATCH 7/7] docs: update docs/kubernetes/how-to-import-volumes.md Co-authored-by: Jonas L. --- docs/kubernetes/how-to-import-volumes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/kubernetes/how-to-import-volumes.md b/docs/kubernetes/how-to-import-volumes.md index 7fc41906..d0ec542e 100644 --- a/docs/kubernetes/how-to-import-volumes.md +++ b/docs/kubernetes/how-to-import-volumes.md @@ -41,7 +41,7 @@ spec: - ``` -4. Create a new PersistentVolumeClaim and link it to the PersistentVolume via `volumeName` +4. Create a new `PersistentVolumeClaim` and link it to the `PersistentVolume` via `volumeName`: ```yaml kind: PersistentVolumeClaim