From 4c449231ddcc3f8be12499583dfde65d81d3bcb7 Mon Sep 17 00:00:00 2001 From: Alexandre KIENTZ Date: Wed, 25 Mar 2026 18:38:26 +0000 Subject: [PATCH] add file --- README.md | 3 +++ deployment.yaml | 22 ++++++++++++++++++++++ hpa.yaml | 18 ++++++++++++++++++ ingress.yaml | 16 ++++++++++++++++ service.yaml | 10 ++++++++++ 5 files changed, 69 insertions(+) create mode 100644 deployment.yaml create mode 100644 hpa.yaml create mode 100644 ingress.yaml create mode 100644 service.yaml diff --git a/README.md b/README.md index e69de29..e32bfde 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,3 @@ +# DOCS + +https://notes.leskientz.ovh/doc/k3s-installation-deploiement-auto-scaling-ORYYqZiQPb diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..160b726 --- /dev/null +++ b/deployment.yaml @@ -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" diff --git a/hpa.yaml b/hpa.yaml new file mode 100644 index 0000000..71f7b15 --- /dev/null +++ b/hpa.yaml @@ -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 diff --git a/ingress.yaml b/ingress.yaml new file mode 100644 index 0000000..64726c1 --- /dev/null +++ b/ingress.yaml @@ -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 diff --git a/service.yaml b/service.yaml new file mode 100644 index 0000000..56c6121 --- /dev/null +++ b/service.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Service +metadata: + name: web +spec: + selector: + app: web + ports: + - port: 80 + targetPort: 80