-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathintermittent-downtime-Issue.yml
50 lines (43 loc) · 1.48 KB
/
intermittent-downtime-Issue.yml
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
#Kubernetes-Issue-1
#Issue
#You have a microservice-based application deployed on a Kubernetes cluster.
#One of your services, frontend-service, is experiencing intermittent downtime.
#The issue is due to the lack of resource limits, causing the service
#to consume excessive CPU and memory resources, leading to node instability.
#Solution
#To resolve this issue, you will define resource requests and
#limits for the frontend-service in its Kubernetes deployment YAML file.
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend-service
spec:
replicas: 3
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: frontend
image: frontend-service:latest
ports:
- containerPort: 80
resources:
requests:
memory: "128Mi"
cpu: "250m"
limits:
memory: "256Mi"
cpu: "500m"
#Explanation
#requests: These are the minimum resources required by the container.
#The scheduler uses these values to determine on which node to place the pod.
#limits: These are the maximum resources that the container can use.
#If the container exceeds these values, it will be throttled or terminated.
#By adding these resource requests and limits,
#you can ensure that your frontend-service does not consume excessive resources,
#which should help stabilize your Kubernetes nodes and improve the reliability of your service.