From 0b399ca527c7f40a47fb1d544fe2b0862cb4eff2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Tue, 5 May 2026 19:17:48 +0000 Subject: [PATCH] modified: README.md --- README.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/README.md b/README.md index db26efb..fdda469 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,11 @@ Kubernetes is an open‑source platform that automates the deployment, scaling, - [Attach to an pod](#attach-to-an-pod) - [Run command on pod](#run-command-on-pod) - [Persistent volumes](#persistent-volumes) + - [create PersistentVolumes - host path](#create-persistentvolumes---host-path) - [find persistent volume used pvc](#find-persistent-volume-used-pvc) - [Patch pv - change to retain policy](#patch-pv---change-to-retain-policy) - [Patch pv - remove finalizers](#patch-pv---remove-finalizers) + - [persistent volume claims](#persistent-volume-claims) - [kubectl](#kubectl) - [Helper pods](#helper-pods) - [network testing](#network-testing) @@ -242,6 +244,24 @@ kubectl exec -it ${POD_NAME} -- ls / ## Persistent volumes +### create PersistentVolumes - host path + +``` yaml +apiVersion: v1 +kind: PersistentVolume +metadata: + name: pv-host-folder +spec: + capacity: + storage: 10Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + hostPath: + path: /path_on_host + type: DirectoryOrCreate +``` + ### find persistent volume used pvc ``` bash @@ -267,6 +287,22 @@ kubectl patch pv $PV_NAME \ -p '{"metadata":{"finalizers": null}}' ``` +### persistent volume claims + +``` yaml +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: pvc-host-folder +spec: + volumeName: pv-host-folder + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +``` + ## kubectl kubectl is the command‑line tool used to interact with Kubernetes clusters. Think of it as the “remote control” for Kubernetes: it lets you deploy applications, inspect resources, and manage cluster operations directly from your terminal.