feat: 开发测试接口
This commit is contained in:
53
k8s/deployment.yaml
Normal file
53
k8s/deployment.yaml
Normal file
@@ -0,0 +1,53 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: fastapi-demo
|
||||
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fastapi-app
|
||||
namespace: fastapi-demo
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fastapi-app
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fastapi-app
|
||||
spec:
|
||||
containers:
|
||||
- name: app
|
||||
image: registry.plfai.cn/fastapi-demo:latest
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
resources:
|
||||
requests:
|
||||
cpu: 50m
|
||||
memory: 64Mi
|
||||
limits:
|
||||
cpu: 200m
|
||||
memory: 256Mi
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: fastapi-app
|
||||
namespace: fastapi-demo
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: fastapi-app
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 8000
|
||||
5
k8s/kustomization.yaml
Normal file
5
k8s/kustomization.yaml
Normal file
@@ -0,0 +1,5 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- deployment.yaml
|
||||
Reference in New Issue
Block a user