This commit is contained in:
KIENTZ Alexandre 2026-03-25 18:38:26 +00:00
parent 96695e51dd
commit 4c449231dd
5 changed files with 69 additions and 0 deletions

View File

@ -0,0 +1,3 @@
# DOCS
https://notes.leskientz.ovh/doc/k3s-installation-deploiement-auto-scaling-ORYYqZiQPb

22
deployment.yaml Normal file
View File

@ -0,0 +1,22 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 1
selector:
matchLabels:
app: web
template:
metadata:
labels:
app: web
spec:
containers:
- name: web
image: nginx
resources:
requests:
cpu: "100m"
limits:
cpu: "500m"

18
hpa.yaml Normal file
View File

@ -0,0 +1,18 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: web-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: web
minReplicas: 1
maxReplicas: 5
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 50

16
ingress.yaml Normal file
View File

@ -0,0 +1,16 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web
spec:
rules:
- host: web.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 80

10
service.yaml Normal file
View File

@ -0,0 +1,10 @@
apiVersion: v1
kind: Service
metadata:
name: web
spec:
selector:
app: web
ports:
- port: 80
targetPort: 80