Files
admin-ui/deploy.yaml
张斌 a8fb18a3e5
Some checks failed
全局K3s部署 / deploy (push) Failing after 1s
dockerfile
2026-05-23 17:11:40 +08:00

45 lines
939 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: nginx:latest
imagePullPolicy: Always
ports:
- containerPort: 80
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区间内的端口