补齐各个服务的k8s配置清单

This commit is contained in:
wwweww
2026-05-02 11:57:07 +08:00
parent 41890ddd33
commit 83fa982749
18 changed files with 2719 additions and 4 deletions
@@ -0,0 +1,117 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: notification-api
namespace: juwan
labels:
app: notification-api
spec:
replicas: 3
revisionHistoryLimit: 5
selector:
matchLabels:
app: notification-api
template:
metadata:
labels:
app: notification-api
spec:
serviceAccountName: find-endpoints
containers:
- name: notification-api
image: notification-api:latest
imagePullPolicy: Always
ports:
- containerPort: 8888
- containerPort: 4001
readinessProbe:
tcpSocket:
port: 8888
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
tcpSocket:
port: 8888
initialDelaySeconds: 15
periodSeconds: 20
resources:
requests:
cpu: 500m
memory: 512Mi
limits:
cpu: 1000m
memory: 1024Mi
volumeMounts:
- name: timezone
mountPath: /etc/localtime
volumes:
- name: timezone
hostPath:
path: /usr/share/zoneinfo/Asia/Shanghai
---
apiVersion: v1
kind: Service
metadata:
name: notification-api-svc
namespace: juwan
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "4001"
prometheus.io/path: "/metrics"
spec:
ports:
- name: http
port: 8888
targetPort: 8888
- name: metrics
port: 4001
targetPort: 4001
selector:
app: notification-api
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: notification-api-hpa-c
namespace: juwan
labels:
app: notification-api-hpa-c
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: notification-api
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: notification-api-hpa-m
namespace: juwan
labels:
app: notification-api-hpa-m
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: notification-api
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80