mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-03 02:24:36 +00:00
feat : 创建 Kubernetes 部署清单文件
This commit is contained in:
parent
3cc783b708
commit
9fdb14a049
2 changed files with 81 additions and 0 deletions
65
scanner/manifests/deployment.yaml
Normal file
65
scanner/manifests/deployment.yaml
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: skillhub-scanner
|
||||
labels:
|
||||
app: skillhub-scanner
|
||||
version: v1
|
||||
spec:
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app: skillhub-scanner
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: skillhub-scanner
|
||||
version: v1
|
||||
spec:
|
||||
containers:
|
||||
- name: scanner
|
||||
image: ${IMAGE}
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 8000
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: TZ
|
||||
value: "Asia/Shanghai"
|
||||
- name: PYTHONUNBUFFERED
|
||||
value: "1"
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 3
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 3
|
||||
successThreshold: 1
|
||||
failureThreshold: 3
|
||||
securityContext:
|
||||
runAsNonRoot: true
|
||||
runAsUser: 1000
|
||||
allowPrivilegeEscalation: false
|
||||
readOnlyRootFilesystem: false
|
||||
restartPolicy: Always
|
||||
terminationGracePeriodSeconds: 30
|
||||
16
scanner/manifests/service.yaml
Normal file
16
scanner/manifests/service.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: skillhub-scanner
|
||||
labels:
|
||||
app: skillhub-scanner
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: skillhub-scanner
|
||||
ports:
|
||||
- name: http
|
||||
port: 8000
|
||||
targetPort: 8000
|
||||
protocol: TCP
|
||||
sessionAffinity: None
|
||||
Loading…
Add table
Reference in a new issue