apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: localvolumereplicas.hwameistor.io
spec:
  group: hwameistor.io
  names:
    kind: LocalVolumeReplica
    listKind: LocalVolumeReplicaList
    plural: localvolumereplicas
    shortNames:
    - lvr
    singular: localvolumereplica
  scope: Cluster
  versions:
  - additionalPrinterColumns:
    - description: Required capacity of the volume replica
      jsonPath: .spec.requiredCapacityBytes
      name: capacity
      type: integer
    - description: Node name where the volume replica is located at
      jsonPath: .spec.nodeName
      name: node
      type: string
    - description: State of the volume replica
      jsonPath: .status.state
      name: state
      type: string
    - description: Sync status of the volume replica
      jsonPath: .status.synced
      name: synced
      type: boolean
    - description: Device path of the volume replica
      jsonPath: .status.devPath
      name: device
      type: string
    - jsonPath: .metadata.creationTimestamp
      name: age
      type: date
    name: v1alpha1
    schema:
      openAPIV3Schema:
        description: LocalVolumeReplica is the Schema for the volumereplicas API
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation
              of an object. Servers should convert recognized schemas to the latest
              internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this
              object represents. Servers may infer this from the endpoint the client
              submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: LocalVolumeReplicaSpec defines the desired state of LocalVolumeReplica
            properties:
              delete:
                default: false
                description: Delete is to indicate where the replica should be deleted
                  or not. It's different from the regular resource delete interface
                  in Kubernetes. The purpose is to protect it from any mistakes
                type: boolean
              nodeName:
                description: NodeName is the assigned node where the volume replica
                  is located
                type: string
              poolName:
                description: PoolName is the name of the storage pool, e.g. LocalStorage_PoolHDD,
                  LocalStorage_PoolSSD, etc..
                type: string
              requiredCapacityBytes:
                format: int64
                minimum: 4194304
                type: integer
              volumeName:
                description: VolumeName is the name of the volume, e.g. pvc-fbf3ffc3-66db-4dae-9032-bda3c61b8f85
                type: string
            type: object
          status:
            description: LocalVolumeReplicaStatus defines the observed state of LocalVolumeReplica
            properties:
              allocatedCapacityBytes:
                description: AllocatedCapacityBytes is the real allocated capacity
                  in bytes
                format: int64
                type: integer
              devPath:
                description: DevicePath is a link path of the StoragePath of the volume
                  replica, e.g. /dev/LocalStorage_PoolHDD/pvc-fbf3ffc3-66db-4dae-9032-bda3c61b8f85
                type: string
              disks:
                description: Disks is a list of physical disks where the volume replica
                  is spread cross, especially for striped LVM volume replica
                items:
                  type: string
                type: array
              haState:
                description: HAState is state for ha replica, replica.Status.State
                  == Ready only when HAState is Consistent of nil
                properties:
                  reason:
                    description: Reason is why this state happened
                    type: string
                  state:
                    description: Consistent, Inconsistent, replica is ready only when
                      consistent
                    type: string
                required:
                - state
                type: object
              inuse:
                default: false
                description: InUse is one of volume replica's states, which indicates
                  the replica is used by a Pod or not
                type: boolean
              state:
                description: State is the phase of volume replica, e.g. Creating,
                  Ready, NotReady, ToBeDeleted, Deleted
                type: string
              storagePath:
                description: StoragePath is a real path of the volume replica, like
                  /dev/sdg.
                type: string
              synced:
                default: false
                description: Synced is the sync state of the volume replica, which
                  is important in HA volume
                type: boolean
            type: object
        type: object
    served: true
    storage: true
    subresources:
      status: {}
