Files
Airtep/gig-poc/infrastructure/k8s/web.yaml
2026-04-01 14:19:25 +08:00

62 lines
1.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: gig-poc-web
namespace: gig-poc
spec:
replicas: 2
selector:
matchLabels:
app: gig-poc-web
template:
metadata:
labels:
app: gig-poc-web
spec:
containers:
- name: web
image: gig-poc-web:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
resources:
requests:
cpu: "200m"
memory: "256Mi"
limits:
cpu: "1"
memory: "1Gi"
---
apiVersion: v1
kind: Service
metadata:
name: gig-poc-web
namespace: gig-poc
spec:
selector:
app: gig-poc-web
ports:
- name: http
port: 80
targetPort: 80
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: gig-poc-web-hpa
namespace: gig-poc
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: gig-poc-web
minReplicas: 2
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70