mirror of
https://github.com/slurm-personal/school-dev-k8s.git
synced 2026-06-27 13:50:24 +00:00
Add basic info
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# EmptyDir
|
||||
|
||||
1) Применяем манифест
|
||||
|
||||
```bash
|
||||
kubectl apply -f ~/slurm/practice/4.saving-data/2.emptydir/
|
||||
```
|
||||
|
||||
2) Заходим в под и создаем файлик на томе empty dir
|
||||
|
||||
```bash
|
||||
kubectl exec -it my-deployment-<TAB> -- sh -c 'echo "Some data" > /files/data.txt'
|
||||
|
||||
kubectl exec -it my-deployment-<TAB> -- cat /files/data.txt
|
||||
```
|
||||
|
||||
3) Удаляем под и ищем данные
|
||||
|
||||
```bash
|
||||
kubectl delete pod my-deployment-<TAB>
|
||||
```
|
||||
|
||||
```bash
|
||||
kubectl exec -it my-deployment-<TAB> -- cat /files/data.txt
|
||||
```
|
||||
|
||||
4) Очищаем
|
||||
|
||||
```bash
|
||||
kubectl delete deployment my-deployment
|
||||
```
|
||||
@@ -0,0 +1,39 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: my-deployment
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: my-app
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 1
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: my-app
|
||||
spec:
|
||||
containers:
|
||||
- image: nginx:1.12
|
||||
name: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /files
|
||||
volumes:
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
...
|
||||
Reference in New Issue
Block a user