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