mirror of
https://github.com/slurm-personal/school-dev-k8s.git
synced 2026-06-27 13:50:24 +00:00
reduce resource usage
This commit is contained in:
+3
-3
@@ -41,8 +41,8 @@ spec:
|
|||||||
cpu: 1000m
|
cpu: 1000m
|
||||||
memory: 1024Mi
|
memory: 1024Mi
|
||||||
requests:
|
requests:
|
||||||
cpu: 250m
|
cpu: 10m
|
||||||
memory: 512Mi
|
memory: 256Mi
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
exec:
|
exec:
|
||||||
command: ["rabbitmqctl", "status"]
|
command: ["rabbitmqctl", "status"]
|
||||||
@@ -89,4 +89,4 @@ spec:
|
|||||||
accessModes: ["ReadWriteOnce"]
|
accessModes: ["ReadWriteOnce"]
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 1Gi
|
storage: 20Mi
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 100m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
Для этого выполним команду:
|
Для этого выполним команду:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/3.saving-configurations/1.env/deployment-with-env.yaml
|
kubectl apply -f ~/slurm/practice/4.saving-configurations/1.env/deployment-with-env.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
2) Проверяем результат
|
2) Проверяем результат
|
||||||
@@ -26,8 +26,8 @@ Environment:
|
|||||||
3) Создаем configmap
|
3) Создаем configmap
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/3.saving-configurations/1.env/configmap.yaml
|
kubectl apply -f ~/slurm/practice/4.saving-configurations/1.env/configmap.yaml
|
||||||
kubectl apply -f ~/slurm/practice/3.saving-configurations/1.env/deployment-with-env-cm.yaml
|
kubectl apply -f ~/slurm/practice/4.saving-configurations/1.env/deployment-with-env-cm.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
4) Проверяем результат
|
4) Проверяем результат
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ kubectl get secret test -o yaml
|
|||||||
Для этого выполним команду:
|
Для этого выполним команду:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/3.saving-configurations/2.secret/deployment-with-secret.yaml
|
kubectl apply -f ~/slurm/practice/4.saving-configurations/2.secret/deployment-with-secret.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
3) Проверяем результат
|
3) Проверяем результат
|
||||||
@@ -37,7 +37,7 @@ Environment:
|
|||||||
4) Применяем манифест с секретом
|
4) Применяем манифест с секретом
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/3.saving-configurations/2.secret/secret.yaml
|
kubectl apply -f ~/slurm/practice/4.saving-configurations/2.secret/secret.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
5) Проверяем что в секрете
|
5) Проверяем что в секрете
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
Для этого выполним команду:
|
Для этого выполним команду:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/3.saving-configurations/3.configmap/
|
kubectl apply -f ~/slurm/practice/4.saving-configurations/3.configmap/
|
||||||
```
|
```
|
||||||
|
|
||||||
2) Проверяем
|
2) Проверяем
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
Для этого выполним команду:
|
Для этого выполним команду:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/3.saving-configurations/4.downward/
|
kubectl apply -f ~/slurm/practice/4.saving-configurations/4.downward/
|
||||||
```
|
```
|
||||||
|
|
||||||
2) Смотрим переменные окружения в контейнере
|
2) Смотрим переменные окружения в контейнере
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
1) Применяем манифест
|
1) Применяем манифест
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/4.saving-data/1.hostpath/
|
kubectl apply -f ~/slurm/practice/5.saving-data/1.hostpath/
|
||||||
|
|
||||||
kubectl get pod
|
kubectl get pod
|
||||||
kubectl get all
|
kubectl get all
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
1) Применяем манифест
|
1) Применяем манифест
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/4.saving-data/2.emptydir/
|
kubectl apply -f ~/slurm/practice/5.saving-data/2.emptydir/
|
||||||
```
|
```
|
||||||
|
|
||||||
2) Заходим в под и создаем файлик на томе empty dir
|
2) Заходим в под и создаем файлик на томе empty dir
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
1) Применяем манифест pvc.yml
|
1) Применяем манифест pvc.yml
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/4.saving-data/3.pvc/pvc.yaml
|
kubectl apply -f ~/slurm/practice/5.saving-data/3.pvc/pvc.yaml
|
||||||
|
|
||||||
kubectl get pvc
|
kubectl get pvc
|
||||||
kubectl get pv
|
kubectl get pv
|
||||||
@@ -12,7 +12,7 @@ kubectl get pv
|
|||||||
2) Запустим приложение, использующее PV
|
2) Запустим приложение, использующее PV
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl apply -f ~/slurm/practice/4.saving-data/3.pvc/
|
kubectl apply -f ~/slurm/practice/5.saving-data/3.pvc/
|
||||||
```
|
```
|
||||||
|
|
||||||
3) Посмотрим describe и смонтированные тома в контейнере
|
3) Посмотрим describe и смонтированные тома в контейнере
|
||||||
@@ -25,5 +25,5 @@ kubectl exec -it fileshare-<TAB> -- df -h
|
|||||||
4) Очищаем
|
4) Очищаем
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
kubectl delete -f ~/slurm/practice/4.saving-data/3.pvc/
|
kubectl delete -f ~/slurm/practice/5.saving-data/3.pvc/
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ spec:
|
|||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
@@ -8,4 +8,4 @@ spec:
|
|||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 1Gi
|
storage: 10Mi
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ spec:
|
|||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 50m
|
cpu: 10m
|
||||||
memory: 100Mi
|
memory: 100Mi
|
||||||
limits:
|
limits:
|
||||||
cpu: 100m
|
cpu: 100m
|
||||||
|
|||||||
Reference in New Issue
Block a user