Refactor Kubernetes deployment process to use manifest files and environment variable substitution

This commit is contained in:
2025-10-01 14:45:51 +08:00
parent b7b024ca66
commit e64a396633
4 changed files with 74 additions and 61 deletions

29
k8s/deployment.yaml Normal file
View File

@@ -0,0 +1,29 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${APP_NAME}
namespace: ${NAMESPACE}
labels:
app: ${APP_NAME}
spec:
replicas: 2
selector:
matchLabels:
app: ${APP_NAME}
template:
metadata:
labels:
app: ${APP_NAME}
spec:
containers:
- name: ${APP_NAME}
image: ${REGISTRY}/${IMAGE_NAME}:${IMAGE_TAG}
ports:
- containerPort: 5173
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"