- Популярные видео
- Авто
- Видео-блоги
- ДТП, аварии
- Для маленьких
- Еда, напитки
- Животные
- Закон и право
- Знаменитости
- Игры
- Искусство
- Комедии
- Красота, мода
- Кулинария, рецепты
- Люди
- Мото
- Музыка
- Мультфильмы
- Наука, технологии
- Новости
- Образование
- Политика
- Праздники
- Приколы
- Природа
- Происшествия
- Путешествия
- Развлечения
- Ржач
- Семья
- Сериалы
- Спорт
- Стиль жизни
- ТВ передачи
- Танцы
- Технологии
- Товары
- Ужасы
- Фильмы
- Шоу-бизнес
- Юмор
Kubernetes Day -13 (Empty Directory, HostPath and LoadBalancer Labs)
Empty Directory, Hostpath and LoadBalancer Labs.
https://kubernetes.io/docs/concepts/storage/volumes/
EMPTY DIRECTORY
_______________
apiVersion: v1
kind: Pod
metadata:
name: empty-dir-example
spec:
containers:
- name: app
image: ubuntu
command: ["sleep", "3600"]
volumeMounts:
- mountPath: /tmp/cache
name: cache-volume
volumes:
- name: cache-volume
emptyDir: {}
------------
apiVersion: v1
kind: Pod
metadata:
name: emptydir-2gi-demo
spec:
containers:
- name: app
image: busybox
command: ["sleep", "3600"]
volumeMounts:
- mountPath: /cache
name: cache-volume
volumes:
- name: cache-volume
emptyDir:
sizeLimit: 2Gi
------------------
apiVersion: v1
kind: Pod
metadata:
name: emptydir-50mi-demo
spec:
containers:
- name: app
image: busybox
command: ["sleep", "3600"]
volumeMounts:
- mountPath: /scratch
name: scratch-volume
volumes:
- name: scratch-volume
emptyDir:
sizeLimit: 50Mi
____________________
HOSTPATH
apiVersion: v1
kind: Pod
metadata:
name: hostpath-demo
spec:
containers:
- name: busybox
image: busybox
command: ["sleep", "3600"]
volumeMounts:
- name: host-volume
mountPath: /data/host
volumes:
- name: host-volume
hostPath:
path: /mnt/data
type: DirectoryOrCreate
/home/docker/VOLUME
---------------------------------------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: hostpath-demo
spec:
replicas: 1
selector:
matchLabels:
app: hostpath-demo
template:
metadata:
labels:
app: hostpath-demo
spec:
containers:
- name: demo-container
image: nginx
volumeMounts:
- name: host-volume
mountPath: /usr/share/nginx/html
volumes:
- name: host-volume
hostPath:
path: /data/html
type: DirectoryOrCreate
persistent volumes
-------------------
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-demo
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /mnt/data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-demo
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
___________________
EBS
apiVersion: v1
kind: PersistentVolume
metadata:
name: ebs-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
awsElasticBlockStore:
volumeID: vol-0abcd1234efgh5678
fsType: ext4
CLAIM
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ebs-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
--------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: pvc-demo
spec:
replicas: 1
selector:
matchLabels:
app: pvc-demo
template:
metadata:
labels:
app: pvc-demo
spec:
containers:
- name: demo-container
image: nginx
volumeMounts:
- name: storage
mountPath: /usr/share/nginx/html
volumes:
- name: storage
persistentVolumeClaim:
claimName: app-pvc
------------
Видео Kubernetes Day -13 (Empty Directory, HostPath and LoadBalancer Labs) канала Global DevOps Lab
https://kubernetes.io/docs/concepts/storage/volumes/
EMPTY DIRECTORY
_______________
apiVersion: v1
kind: Pod
metadata:
name: empty-dir-example
spec:
containers:
- name: app
image: ubuntu
command: ["sleep", "3600"]
volumeMounts:
- mountPath: /tmp/cache
name: cache-volume
volumes:
- name: cache-volume
emptyDir: {}
------------
apiVersion: v1
kind: Pod
metadata:
name: emptydir-2gi-demo
spec:
containers:
- name: app
image: busybox
command: ["sleep", "3600"]
volumeMounts:
- mountPath: /cache
name: cache-volume
volumes:
- name: cache-volume
emptyDir:
sizeLimit: 2Gi
------------------
apiVersion: v1
kind: Pod
metadata:
name: emptydir-50mi-demo
spec:
containers:
- name: app
image: busybox
command: ["sleep", "3600"]
volumeMounts:
- mountPath: /scratch
name: scratch-volume
volumes:
- name: scratch-volume
emptyDir:
sizeLimit: 50Mi
____________________
HOSTPATH
apiVersion: v1
kind: Pod
metadata:
name: hostpath-demo
spec:
containers:
- name: busybox
image: busybox
command: ["sleep", "3600"]
volumeMounts:
- name: host-volume
mountPath: /data/host
volumes:
- name: host-volume
hostPath:
path: /mnt/data
type: DirectoryOrCreate
/home/docker/VOLUME
---------------------------------------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: hostpath-demo
spec:
replicas: 1
selector:
matchLabels:
app: hostpath-demo
template:
metadata:
labels:
app: hostpath-demo
spec:
containers:
- name: demo-container
image: nginx
volumeMounts:
- name: host-volume
mountPath: /usr/share/nginx/html
volumes:
- name: host-volume
hostPath:
path: /data/html
type: DirectoryOrCreate
persistent volumes
-------------------
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv-demo
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
hostPath:
path: /mnt/data
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pvc-demo
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
___________________
EBS
apiVersion: v1
kind: PersistentVolume
metadata:
name: ebs-pv
spec:
capacity:
storage: 10Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
awsElasticBlockStore:
volumeID: vol-0abcd1234efgh5678
fsType: ext4
CLAIM
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ebs-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
--------------
apiVersion: apps/v1
kind: Deployment
metadata:
name: pvc-demo
spec:
replicas: 1
selector:
matchLabels:
app: pvc-demo
template:
metadata:
labels:
app: pvc-demo
spec:
containers:
- name: demo-container
image: nginx
volumeMounts:
- name: storage
mountPath: /usr/share/nginx/html
volumes:
- name: storage
persistentVolumeClaim:
claimName: app-pvc
------------
Видео Kubernetes Day -13 (Empty Directory, HostPath and LoadBalancer Labs) канала Global DevOps Lab
VolumeMounts Data Persistence: Ephemeral Volumes: Persistent Volumes (PVs): Persistent Volumes (PV) and Persistent Volume Claims (PVC) StorageClass CSI ephemeral volumes Static Provisioning: Sharing Data across Containers: emptyDir: hostPath Why volumes are important How volumes work awsElasticBlockStore downwardAPI Where are Kubernetes volumes stored? What are Kubernetes volumes? Kubernetes Persistent Volumes – Tutorial and Examples The lifecycle of PVs and PVCs
Комментарии отсутствуют
Информация о видео
4 сентября 2025 г. 12:32:11
00:42:29
Другие видео канала




















