K8s Lab 把当前仓库文档整理成一个可阅读的网页站点

Repository Reading Site

mlmodel-crd.yaml

ml-platform/manifests/mlmodel-crd.yaml

Text Assetml-platform/manifests/mlmodel-crd.yaml2.5 KB2026年4月9日 14:00查看原始内容
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: mlmodels.ml.k8s-lab.io
spec:
  group: ml.k8s-lab.io
  versions:
  - name: v1alpha1
    served: true
    storage: true
    subresources:
      status: {}        # 启用 status 子资源(spec 和 status 分开更新)
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            required: ["modelPath", "version", "replicas"]
            properties:
              modelPath:
                type: string
                description: "NFS 上模型文件的路径"
              version:
                type: string
                description: "模型版本"
              replicas:
                type: integer
                minimum: 1
                maximum: 20
                description: "推理服务副本数"
              modelType:
                type: string
                description: "算法类型 (LinearRegression/RandomForest/etc)"
              minReplicas:
                type: integer
                minimum: 1
              maxReplicas:
                type: integer
                minimum: 1
          status:
            type: object
            properties:
              phase:
                type: string
                enum: ["Pending", "Deploying", "Serving", "Failed"]
              endpoint:
                type: string
              readyReplicas:
                type: integer
              message:
                type: string
              metrics:
                type: object
                properties:
                  mae:
                    type: number
                  rmse:
                    type: number
                  r2Score:
                    type: number
              lastUpdated:
                type: string
                format: date-time
    additionalPrinterColumns:
    - name: Version
      type: string
      jsonPath: .spec.version
    - name: Type
      type: string
      jsonPath: .spec.modelType
    - name: Phase
      type: string
      jsonPath: .status.phase
    - name: Replicas
      type: integer
      jsonPath: .spec.replicas
    - name: Ready
      type: integer
      jsonPath: .status.readyReplicas
    - name: Endpoint
      type: string
      jsonPath: .status.endpoint
    - name: Age
      type: date
      jsonPath: .metadata.creationTimestamp
  scope: Namespaced
  names:
    plural: mlmodels
    singular: mlmodel
    kind: MLModel
    shortNames:
    - mlm