44 lines
921 B
YAML
44 lines
921 B
YAML
|
|
apiVersion: apps/v1
|
|||
|
|
kind: Deployment
|
|||
|
|
metadata:
|
|||
|
|
name: ${APP_NAME}
|
|||
|
|
namespace: default
|
|||
|
|
labels:
|
|||
|
|
app: ${APP_NAME}
|
|||
|
|
spec:
|
|||
|
|
replicas: 1
|
|||
|
|
selector:
|
|||
|
|
matchLabels:
|
|||
|
|
app: ${APP_NAME}
|
|||
|
|
template:
|
|||
|
|
metadata:
|
|||
|
|
labels:
|
|||
|
|
app: ${APP_NAME}
|
|||
|
|
spec:
|
|||
|
|
containers:
|
|||
|
|
- name: ${APP_NAME}
|
|||
|
|
image: ${REGISTRY}/${APP_NAME}:${gitea.sha}
|
|||
|
|
imagePullPolicy: Always
|
|||
|
|
ports:
|
|||
|
|
- containerPort: 80 # 你的项目实际端口(比如前端80、后端8080)
|
|||
|
|
resources:
|
|||
|
|
requests:
|
|||
|
|
cpu: 100m
|
|||
|
|
memory: 128Mi
|
|||
|
|
limits:
|
|||
|
|
cpu: 500m
|
|||
|
|
memory: 512Mi
|
|||
|
|
---
|
|||
|
|
apiVersion: v1
|
|||
|
|
kind: Service
|
|||
|
|
metadata:
|
|||
|
|
name: ${APP_NAME}-service
|
|||
|
|
namespace: default
|
|||
|
|
spec:
|
|||
|
|
type: NodePort
|
|||
|
|
selector:
|
|||
|
|
app: ${APP_NAME}
|
|||
|
|
ports:
|
|||
|
|
- port: 80
|
|||
|
|
targetPort: 80
|
|||
|
|
nodePort: 30001 # 必须在30000-32767之间
|