modified: README.md
This commit is contained in:
@@ -13,9 +13,11 @@ Kubernetes is an open‑source platform that automates the deployment, scaling,
|
|||||||
- [Attach to an pod](#attach-to-an-pod)
|
- [Attach to an pod](#attach-to-an-pod)
|
||||||
- [Run command on pod](#run-command-on-pod)
|
- [Run command on pod](#run-command-on-pod)
|
||||||
- [Persistent volumes](#persistent-volumes)
|
- [Persistent volumes](#persistent-volumes)
|
||||||
|
- [create PersistentVolumes - host path](#create-persistentvolumes---host-path)
|
||||||
- [find persistent volume used pvc](#find-persistent-volume-used-pvc)
|
- [find persistent volume used pvc](#find-persistent-volume-used-pvc)
|
||||||
- [Patch pv - change to retain policy](#patch-pv---change-to-retain-policy)
|
- [Patch pv - change to retain policy](#patch-pv---change-to-retain-policy)
|
||||||
- [Patch pv - remove finalizers](#patch-pv---remove-finalizers)
|
- [Patch pv - remove finalizers](#patch-pv---remove-finalizers)
|
||||||
|
- [persistent volume claims](#persistent-volume-claims)
|
||||||
- [kubectl](#kubectl)
|
- [kubectl](#kubectl)
|
||||||
- [Helper pods](#helper-pods)
|
- [Helper pods](#helper-pods)
|
||||||
- [network testing](#network-testing)
|
- [network testing](#network-testing)
|
||||||
@@ -242,6 +244,24 @@ kubectl exec -it ${POD_NAME} -- ls /
|
|||||||
|
|
||||||
## Persistent volumes
|
## 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
|
### find persistent volume used pvc
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
@@ -267,6 +287,22 @@ kubectl patch pv $PV_NAME \
|
|||||||
-p '{"metadata":{"finalizers": null}}'
|
-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
|
||||||
|
|
||||||
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.
|
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.
|
||||||
|
|||||||
Reference in New Issue
Block a user