apiVersion: v1 kind: PersistentVolumeClaim metadata: name: text-classification-pvc namespace: ecosystem spec: accessModes: - ReadWriteMany resources: requests: storage: 2Gi --- apiVersion: apps/v1 kind: Deployment metadata: name: text-classification namespace: ecosystem spec: selector: matchLabels: app: text-classification tier: backend template: metadata: labels: app: text-classification tier: backend spec: volumes: - name: text-classification-models persistentVolumeClaim: claimName: text-classification-pvc containers: - name: text-classification image: leafdev.top/ecosystem/zero-shot-classification:v0.0.4 env: - name: HF_DATASETS_CACHE value: "/app/models" - name: HF_HOME value: "/app/models" - name: HUGGINGFACE_HUB_CACHE value: "/app/models" - name: TRANSFORMERS_CACHE value: "/app/models" - name: HF_ENDPOINT value: "https://hf-mirror.com" - name: GPU_DEVICE value: "-1" # - name: CUDA_VISIBLE_DEVICES # value: "1" ports: - containerPort: 80 protocol: TCP name: http # resources: # requests: # cpu: 1000m # memory: 1024Mi volumeMounts: - mountPath: /app/models name: text-classification-models --- apiVersion: v1 kind: Service metadata: name: text-classification namespace: ecosystem spec: selector: app: text-classification tier: backend type: ClusterIP ports: - port: 80 targetPort: 80 protocol: TCP name: http --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: zero-shot-classification-http namespace: ecosystem spec: hostnames: - text-classification-api-testing.leaflow.cn parentRefs: - name: http-gw namespace: networking rules: - backendRefs: - name: text-classification port: 80