fix: 重命名 objectStorge 为 objectstory 并修复 service ports 缩进

This commit is contained in:
zetaloop
2026-05-03 07:05:29 +08:00
parent 227f5814df
commit 87bf86a410
2 changed files with 31 additions and 30 deletions
@@ -0,0 +1,120 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: objectstory-api
namespace: juwan
labels:
app: objectstory-api
spec:
replicas: 3
revisionHistoryLimit: 5
selector:
matchLabels:
app: objectstory-api
template:
metadata:
labels:
app: objectstory-api
spec:
serviceAccountName: find-endpoints
containers:
- name: objectstory-api
image: objectstory-api:latest
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: objectstory-api-svc
namespace: juwan
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "4001"
prometheus.io/path: "/metrics"
spec:
ports:
- name: metrics
port: 4001
targetPort: 4001
- name: http
port: 8888
targetPort: 8888
selector:
app: objectstory-api
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: objectstory-api-hpa-c
namespace: juwan
labels:
app: objectstory-api-hpa-c
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: objectstory-api
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 80
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: objectstory-api-hpa-m
namespace: juwan
labels:
app: objectstory-api-hpa-m
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: objectstory-api
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80