mirror of
https://github.com/slurm-personal/school-dev-k8s.git
synced 2026-06-27 13:50:24 +00:00
fix numeration
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
### Resources and Probes
|
||||
|
||||
Создаем deployment с ресурсами и пробами
|
||||
|
||||
```bash
|
||||
kubectl apply -f ~/school-dev-k8s/practice/6.network-abstractions/1.probes/deployment-with-stuff.yaml
|
||||
```
|
||||
|
||||
Смотрим что получилось
|
||||
|
||||
```bash
|
||||
kubectl get pod
|
||||
```
|
||||
|
||||
Должны увидеть что-то типа такого:
|
||||
|
||||
```bash
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
my-deployment-69695544f6-v97jr 1/1 Running 0 20s
|
||||
my-deployment-69695544f6-xcpq9 1/1 Running 0 20s
|
||||
```
|
||||
|
||||
Поменяем специально Readiness Probe на заведомо неверную в манифесте и применим его снова
|
||||
|
||||
```bash
|
||||
vim ~/school-dev-k8s/practice/6.network-abstractions/1.probes/deployment-with-stuff.yaml
|
||||
kubectl apply -f ~/school-dev-k8s/practice/6.network-abstractions/1.probes/deployment-with-stuff.yaml
|
||||
```
|
||||
|
||||
Смотрим что получилось
|
||||
|
||||
```bash
|
||||
kubectl get pod
|
||||
```
|
||||
|
||||
Видим что pod'ы не переходят в статус `1/1 Running`. Смотрим describe pod'а:
|
||||
```bash
|
||||
kubectl describe po my-deployment-845d88fdcf-9bd29
|
||||
```
|
||||
Чистим за собой кластер
|
||||
```bash
|
||||
kubectl delete deployment --all
|
||||
```
|
||||
@@ -0,0 +1,57 @@
|
||||
---
|
||||
# file: practice/1.kube-basics-lecture/4.resources-and-probes/deployment-with-stuff.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: my-deployment
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: my-app
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 1
|
||||
maxUnavailable: 1
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: my-app
|
||||
spec:
|
||||
containers:
|
||||
- image: quay.io/testing-farm/nginx:1.12
|
||||
name: nginx
|
||||
ports:
|
||||
- containerPort: 80
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
initialDelaySeconds: 10
|
||||
startupProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: 80
|
||||
failureThreshold: 30
|
||||
periodSeconds: 10
|
||||
resources:
|
||||
requests:
|
||||
cpu: 10m
|
||||
memory: 100Mi
|
||||
limits:
|
||||
cpu: 100m
|
||||
memory: 100Mi
|
||||
...
|
||||
Reference in New Issue
Block a user