-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8s-examples.yaml
131 lines (127 loc) · 2.53 KB
/
k8s-examples.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# This is the list of manifests for our Kubernetes debugging / triage interview segment.
---
apiVersion: v1
kind: Namespace
metadata:
name: sample-service
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: stressful-deployment
namespace: sample-service
labels:
k8s-app: stressful-service
spec:
replicas: 6
selector:
matchLabels:
k8s-app: stressful-service
template:
metadata:
labels:
k8s-app: stressful-service
spec:
containers:
- command:
- stress
args:
- "--vm"
- "1"
- "--vm-bytes"
- "250M"
- "--vm-hang"
- "1"
name: stressful-pod
image: polinux/stress
resources:
requests:
memory: "100Mi"
limits:
memory: "200Mi"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: mysterious-deployment
namespace: sample-service
labels:
k8s-app: itsamystery
spec:
replicas: 4
selector:
matchLabels:
k8s-app: itsamystery
template:
metadata:
labels:
k8s-app: itsamystery
spec:
tolerations:
- effect: NoSchedule
key: special-nodes
nodeSelector:
medium.engineering/nodes: special-nodes
containers:
- command:
- sleep
args:
- "3600"
name: mystery-pod
image: gcr.io/kubernetes-e2e-test-images/dnsutils:latest
resources:
requests:
cpu: 16
memory: "100Mi"
limits:
memory: "200Mi"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: redis-config
data:
redis-config: |
maxmemory 2mb
maxmemory-policy allkeys-lru
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis-cluster
namespace: sample-service
spec:
serviceName: redis-cluster
replicas: 6
selector:
matchLabels:
k8s-app: redis-cluster
template:
metadata:
labels:
k8s-app: redis-cluster
spec:
containers:
- name: redis
image: redis:6.2.5
command: ["redis-server"]
args: ["/conf/redis.conf"]
env:
- name: REDIS_CLUSTER_ANNOUNCE_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
ports:
- containerPort: 6379
name: client
- containerPort: 16379
name: gossip
volumeMounts:
- mountPath: /conf
name: config
volumes:
- name: data
emptyDir: {}
- name: config
configMap:
name: redis-config