Repository Reading Site
mlmodel-crd.yaml
ml-platform/manifests/mlmodel-crd.yaml
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