Files
juwan-backend/deploy/k8s/service/email/email-mq.yaml
T
2026-02-26 02:17:07 +08:00

110 lines
2.2 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: email-consumer
namespace: juwan
labels:
app: email-consumer
spec:
replicas: 3
revisionHistoryLimit: 5
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0
maxUnavailable: 1
selector:
matchLabels:
app: email-consumer
template:
metadata:
labels:
app: email-consumer
spec:
serviceAccountName: find-endpoints
containers:
- name: email-consumer
image: 103.236.53.208:4418/library/email-mq@sha256:a9f76e8f4a17d1c00cefc429962037550e17feebb5cf38b28d360c91c8ba3e68
ports:
- containerPort: 4001
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
volumeMounts:
- name: timezone
mountPath: /etc/localtime
volumes:
- name: timezone
hostPath:
path: /usr/share/zoneinfo/Asia/Shanghai
---
apiVersion: v1
kind: Service
metadata:
name: email-consumer-svc
namespace: juwan
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "4001"
prometheus.io/path: "/metrics"
spec:
ports:
# - port: 8080
# targetPort: 8080
- name: metrics
port: 4001
targetPort: 4001
selector:
app: email-consumer
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: email-consumer-hpa-c
namespace: juwan
labels:
app: email-consumer-hpa-c
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: email-consumer
minReplicas: 1
maxReplicas: 3
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: email-consumer-hpa-m
namespace: juwan
labels:
app: email-consumer-hpa-m
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: email-consumer
minReplicas: 1
maxReplicas: 3
metrics:
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80