{
  "apiVersion": "apiextensions.k8s.io/v1",
  "kind": "CustomResourceDefinition",
  "metadata": {
    "name": "compactbackups.cloud.pingcap.com",
    "labels": {}
  },
  "spec": {
    "conversion": {
      "strategy": "None"
    },
    "group": "cloud.pingcap.com",
    "names": {
      "kind": "CompactBackup",
      "listKind": "CompactBackupList",
      "plural": "compactbackups",
      "shortNames": [
        "cpbk"
      ],
      "singular": "compactbackup"
    },
    "scope": "Namespaced",
    "versions": [
      {
        "name": "v1",
        "schema": {
          "openAPIV3Schema": {
            "description": "CompactBackup is the Schema for the compactbackups API",
            "properties": {
              "apiVersion": {
                "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore 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.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
                "type": "string"
              },
              "metadata": {
                "type": "object"
              },
              "spec": {
                "description": "CompactBackupSpec defines the desired state of CompactBackup",
                "properties": {
                  "cleanPolicy": {
                    "default": "Retain",
                    "description": "CleanPolicy denotes whether to clean compact data when deleted",
                    "type": "string"
                  },
                  "clusterName": {
                    "description": "ClusterName is the name of the TiDB cluster to compact",
                    "type": "string"
                  },
                  "concurrency": {
                    "default": 4,
                    "description": "Concurrency is the concurrency for compact",
                    "format": "int32",
                    "type": "integer"
                  },
                  "configuration": {
                    "description": "Configuration contains compact-specific configurations",
                    "properties": {
                      "baseImage": {
                        "description": "BaseImage of the component",
                        "type": "string"
                      },
                      "config": {
                        "description": "Config is the default configuration of component",
                        "type": "string"
                      },
                      "tag": {
                        "description": "Tag is component image tag",
                        "type": "string"
                      },
                      "tikvImage": {
                        "description": "TiKVImage is the custom TiKV image",
                        "type": "string"
                      },
                      "tikvVersion": {
                        "description": "TiKVVersion is the custom TiKV version",
                        "type": "string"
                      }
                    },
                    "type": "object"
                  },
                  "endTs": {
                    "description": "EndTs is the end timestamp for compact",
                    "type": "string"
                  },
                  "instanceType": {
                    "description": "InstanceType specifies the instance type for compact",
                    "type": "string"
                  },
                  "paused": {
                    "description": "Paused specifies whether to pause the reconciliation loop for CompactBackup CR",
                    "type": "boolean"
                  },
                  "resourceRequirements": {
                    "description": "ResourceRequirements manage resources(cpu,memory) of compact pod",
                    "properties": {
                      "claims": {
                        "description": "Claims lists the names of resources, defined in spec.resourceClaims,\nthat are used by this container.\n\nThis is an alpha field and requires enabling the\nDynamicResourceAllocation feature gate.\n\nThis field is immutable. It can only be set for containers.",
                        "items": {
                          "description": "ResourceClaim references one entry in PodSpec.ResourceClaims.",
                          "properties": {
                            "name": {
                              "description": "Name must match the name of one entry in pod.spec.resourceClaims of\nthe Pod where this field is used. It makes that resource available\ninside a container.",
                              "type": "string"
                            },
                            "request": {
                              "description": "Request is the name chosen for a request in the referenced claim.\nIf empty, everything from the claim is made available, otherwise\nonly the result of this request.",
                              "type": "string"
                            }
                          },
                          "required": [
                            "name"
                          ],
                          "type": "object"
                        },
                        "type": "array",
                        "x-kubernetes-list-map-keys": [
                          "name"
                        ],
                        "x-kubernetes-list-type": "map"
                      },
                      "limits": {
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                          "x-kubernetes-int-or-string": true
                        },
                        "description": "Limits describes the maximum amount of compute resources allowed.\nMore info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/",
                        "type": "object"
                      },
                      "requests": {
                        "additionalProperties": {
                          "anyOf": [
                            {
                              "type": "integer"
                            },
                            {
                              "type": "string"
                            }
                          ],
                          "pattern": "^(\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\\+|-)?(([0-9]+(\\.[0-9]*)?)|(\\.[0-9]+))))?$",
                          "x-kubernetes-int-or-string": true
                        },
                        "description": "Requests describes the minimum amount of compute resources required.\nIf Requests is omitted for a container, it defaults to Limits if that is explicitly specified,\notherwise to an implementation-defined value. Requests cannot exceed Limits.\nMore info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/",
                        "type": "object"
                      }
                    },
                    "type": "object"
                  },
                  "shardCount": {
                    "description": "ShardCount is the number of shards used by sharded compaction.\nRequired when Mode == \"sharded\"; ignored otherwise.",
                    "format": "int32",
                    "minimum": 1,
                    "type": "integer"
                  },
                  "startTs": {
                    "description": "StartTs is the start timestamp for compact",
                    "type": "string"
                  },
                  "storage": {
                    "description": "Storage is the storage URL for compact backup",
                    "type": "string"
                  }
                },
                "required": [
                  "clusterName"
                ],
                "type": "object"
              },
              "status": {
                "description": "CompactBackupStatus defines the observed state of CompactBackup",
                "properties": {
                  "backupPath": {
                    "description": "BackupPath is the location of the compact backup.",
                    "type": "string"
                  },
                  "completionTime": {
                    "description": "CompletionTime is when compact completed",
                    "format": "date-time",
                    "type": "string"
                  },
                  "endTs": {
                    "description": "EndTs is the real endTs processed by compact",
                    "type": "string"
                  },
                  "message": {
                    "description": "Message is the error message",
                    "type": "string"
                  },
                  "phase": {
                    "description": "Phase represents the current phase of compact backup",
                    "type": "string"
                  },
                  "progress": {
                    "description": "Progress is the detailed progress of compact",
                    "type": "string"
                  },
                  "startTime": {
                    "description": "StartTime is when compact started",
                    "format": "date-time",
                    "type": "string"
                  },
                  "state": {
                    "description": "State is the current state of the compact",
                    "type": "string"
                  }
                },
                "type": "object"
              }
            },
            "type": "object"
          }
        },
        "served": true,
        "storage": true,
        "subresources": {
          "status": {}
        }
      }
    ]
  }
}
