-
Notifications
You must be signed in to change notification settings - Fork 139
/
deployment-stress.yaml
89 lines (85 loc) · 2.44 KB
/
deployment-stress.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#
# Author: Hari Sekhon
# Date: 2020-08-19 14:58:06 +0100 (Wed, 19 Aug 2020)
#
# vim:ts=2:sts=2:sw=2:et
# lint: k8s
#
# https://github.com/HariSekhon/Kubernetes-configs
#
# License: see accompanying Hari Sekhon LICENSE file
#
# If you're using my code you're welcome to connect with me on LinkedIn
# and optionally send me feedback to help improve or steer this or other code I publish
#
# https://www.linkedin.com/in/HariSekhon
#
# ============================================================================ #
# D e p l o y m e n t S t r e s s
# ============================================================================ #
# https://kubernetes.io/docs/concepts/workloads/controllers/deployment/
# Deployment for stressing out your resources to test namespace resource limits
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: stress
namespace: NAMESPACE
annotations:
deployment.kubernetes.io/revision: "1"
#datree.skip/DEPLOYMENT_INCORRECT_REPLICAS_VALUE: replicas not relevant for this deployment
#datree.skip/CONTAINERS_MISSING_READINESSPROBE_KEY: readiness probe is not relevant for this deployment
#datree.skip/CONTAINERS_MISSING_LIVENESSPROBE_KEY: liveness probe is not relevant for this deployment
labels:
app: stress
spec:
progressDeadlineSeconds: 600
#replicas: 1
revisionHistoryLimit: 10
selector:
matchLabels:
app: stress
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: stress
spec:
containers:
- image: vish/stress
imagePullPolicy: Always
name: stress
args:
- -cpus
- "2"
- -mem-total
- 950Mi
- -mem-alloc-size
- 100Mi
- -mem-alloc-sleep
- 1s
readinessProbe:
exec:
command:
- pgrep -f stress
livenessProbe:
exec:
command:
- pgrep -f stress
resources:
requests:
cpu: 0.5
memory: 2500Mi
limits:
cpu: "1"
memory: 4Gi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
terminationGracePeriodSeconds: 30