# Probes deployment-with-stuff.yaml ```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: nginx:1.20 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: 50m memory: 100Mi limits: cpu: 100m memory: 100Mi ``` Создаем deployment с ресурсами и пробами ```bash kubectl apply -f 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 deployment-with-stuff.yaml kubectl apply -f deployment-with-stuff.yaml ``` Смотрим что получилось ```bash kubectl get pod ``` Видим что pod'ы не переходят в статус `1/1 Running`. Смотрим describe pod'а: ```bash kubectl describe po my-deployment-<TAB> ``` Чистим за собой кластер ```bash kubectl delete deployment --all ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up