Better resource management

This commit is contained in:
Paul Warren 2022-08-24 18:39:56 +10:00
parent 6a2d6d713e
commit 684cac8b6f
2 changed files with 12 additions and 2 deletions

View file

@ -2,10 +2,11 @@ apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: desteg name: desteg
namespace: desteg
labels: labels:
app: desteg app: desteg
spec: spec:
replicas: 3 replicas: 1
selector: selector:
matchLabels: matchLabels:
app: desteg app: desteg
@ -19,11 +20,19 @@ spec:
image: dockerhub.kube:5000/desteg:latest image: dockerhub.kube:5000/desteg:latest
ports: ports:
- containerPort: 5002 - containerPort: 5002
resources:
limits:
cpu: '750m'
memory: '4096Mi'
requests:
cpu: '500m'
memory: '2048Mi'
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: desteg name: desteg
namespace: desteg
spec: spec:
selector: selector:
app: desteg app: desteg

View file

@ -2,7 +2,8 @@
apiVersion: autoscaling/v2 apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler kind: HorizontalPodAutoscaler
metadata: metadata:
name: desteg-hpa name: desteg
namespace: desteg
spec: spec:
scaleTargetRef: scaleTargetRef:
apiVersion: apps/v1 apiVersion: apps/v1