From 9fdb14a0496db229b65bf8cc396b817793a4460f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BF=9F=E4=BA=8C=E8=BF=9C?= Date: Fri, 3 Apr 2026 22:54:02 +0800 Subject: [PATCH] =?UTF-8?q?feat=20:=20=E5=88=9B=E5=BB=BA=20Kubernetes=20?= =?UTF-8?q?=E9=83=A8=E7=BD=B2=E6=B8=85=E5=8D=95=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scanner/manifests/deployment.yaml | 65 +++++++++++++++++++++++++++++++ scanner/manifests/service.yaml | 16 ++++++++ 2 files changed, 81 insertions(+) create mode 100644 scanner/manifests/deployment.yaml create mode 100644 scanner/manifests/service.yaml diff --git a/scanner/manifests/deployment.yaml b/scanner/manifests/deployment.yaml new file mode 100644 index 00000000..66dc5354 --- /dev/null +++ b/scanner/manifests/deployment.yaml @@ -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 diff --git a/scanner/manifests/service.yaml b/scanner/manifests/service.yaml new file mode 100644 index 00000000..f4e9c6e3 --- /dev/null +++ b/scanner/manifests/service.yaml @@ -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