From d6117b2391e55d5883eac28461cfc4be8d2823e4 Mon Sep 17 00:00:00 2001 From: yuyi Date: Mon, 16 Oct 2023 10:15:34 +0800 Subject: [PATCH] chore: update crd.yaml and operator.yaml --- deploy/crd.yaml | 2263 +++++++++++++++++++++++++++++++++++++++--- deploy/operator.yaml | 1749 +++++++++++++++++++++++++++++++- 2 files changed, 3840 insertions(+), 172 deletions(-) diff --git a/deploy/crd.yaml b/deploy/crd.yaml index 84d3d4562..7180747aa 100644 --- a/deploy/crd.yaml +++ b/deploy/crd.yaml @@ -111,7 +111,14 @@ spec: singular: obcluster scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: OBCluster is the Schema for the obclusters API @@ -2123,7 +2130,20 @@ spec: singular: observer scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .status.podIp + name: PodIP + type: string + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.obStatus + name: OBStatus + type: string + name: v1alpha1 schema: openAPIV3Schema: description: OBServer is the Schema for the observers API @@ -3971,6 +3991,8 @@ spec: kind: OBTenantBackupPolicy listKind: OBTenantBackupPolicyList plural: obtenantbackuppolicies + shortNames: + - obtbp singular: obtenantbackuppolicy scope: Namespaced versions: @@ -3978,6 +4000,9 @@ spec: - jsonPath: .status.status name: Status type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date - jsonPath: .spec.tenantName name: TenantName type: string @@ -4020,6 +4045,8 @@ spec: properties: destination: properties: + ossAccessSecret: + type: string path: type: string type: @@ -4055,6 +4082,8 @@ spec: type: boolean destination: properties: + ossAccessSecret: + type: string path: type: string type: @@ -4079,7 +4108,6 @@ spec: - logArchive - obClusterName - tenantName - - tenantSecret type: object status: description: OBTenantBackupPolicyStatus defines the observed state of @@ -4170,7 +4198,6 @@ spec: - piece_switch_interval - round_id - start_scn - - start_scn_display - status - tenant_id - used_piece_id @@ -4367,6 +4394,510 @@ spec: type: object status: type: string + tenantCR: + description: OBTenant is the Schema for the obtenants 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: OBTenantSpec defines the desired state of OBTenant + properties: + charset: + default: utf8mb4 + type: string + collate: + type: string + connectWhiteList: + default: '%' + type: string + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + forceDelete: + default: false + type: boolean + obcluster: + type: string + pools: + items: + properties: + priority: + default: 1 + type: integer + resource: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + zone: + type: string + required: + - resource + - zone + type: object + type: array + source: + description: Source for restoring or creating standby + properties: + restore: + properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + cancel: + type: boolean + description: + type: string + replayLogUntil: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + sourceUri: + type: string + until: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + required: + - until + type: object + tenant: + type: string + type: object + tenantName: + type: string + tenantRole: + default: PRIMARY + type: string + unitNum: + type: integer + required: + - obcluster + - pools + - tenantName + - unitNum + type: object + status: + description: OBTenantStatus defines the observed state of OBTenant + properties: + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + resourcePool: + items: + properties: + priority: + type: integer + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + unitConfig: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + unitNum: + type: integer + units: + items: + properties: + migrate: + properties: + serverIP: + type: string + serverPort: + type: integer + required: + - serverIP + - serverPort + type: object + serverIP: + type: string + serverPort: + type: integer + status: + type: string + unitId: + type: integer + required: + - migrate + - serverIP + - serverPort + - status + - unitId + type: object + type: array + zoneList: + type: string + required: + - type + - unitConfig + - unitNum + - units + - zoneList + type: object + type: array + source: + properties: + restore: + description: OBTenantRestoreStatus defines the observed + state of OBTenantRestore + properties: + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + restoreProgress: + description: RestoreHistory is the history of restore + job, matches view CDB_OB_RESTORE_HISTORY + properties: + backup_cluster_name: + type: string + backup_cluster_version: + type: string + backup_dest: + type: string + backup_piece_list: + type: string + backup_set_list: + type: string + backup_tenant_id: + format: int64 + type: integer + backup_tenant_name: + type: string + description: + type: string + finish_bytes: + format: int64 + type: integer + finish_bytes_display: + type: string + finish_ls_count: + format: int64 + type: integer + finish_tablet_count: + format: int64 + type: integer + finish_timestamp: + type: string + job_id: + format: int64 + type: integer + ls_count: + format: int64 + type: integer + restore_option: + type: string + restore_scn: + format: int64 + type: integer + restore_scn_display: + type: string + restore_tenant_id: + format: int64 + type: integer + restore_tenant_name: + type: string + start_timestamp: + type: string + status: + type: string + tablet_count: + format: int64 + type: integer + tenant_id: + format: int64 + type: integer + total_bytes: + format: int64 + type: integer + total_bytes_display: + type: string + required: + - backup_cluster_name + - backup_cluster_version + - backup_dest + - backup_piece_list + - backup_set_list + - backup_tenant_id + - backup_tenant_name + - finish_ls_count + - finish_tablet_count + - finish_timestamp + - job_id + - ls_count + - restore_option + - restore_scn + - restore_scn_display + - restore_tenant_id + - restore_tenant_name + - start_timestamp + - status + - tablet_count + - tenant_id + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define + observed state of cluster Important: Run "make" + to regenerate code after modifying this file' + type: string + required: + - status + type: object + tenant: + type: string + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "make" to regenerate code + after modifying this file' + type: string + tenantRecordInfo: + properties: + charset: + type: string + collate: + type: string + connectWhiteList: + type: string + locality: + type: string + poolList: + type: string + primaryZone: + type: string + tenantID: + type: integer + unitNum: + type: integer + zoneList: + type: string + required: + - locality + - poolList + - primaryZone + - tenantID + type: object + tenantRole: + type: string + required: + - resourcePool + - status + type: object + type: object tenantInfo: description: OBTenant is the tenant model of OB system properties: @@ -4376,6 +4907,8 @@ spec: type: string create_time: type: string + gmt_create_time: + type: string in_recyclebin: type: string locality: @@ -4401,6 +4934,11 @@ spec: type: integer status: type: string + switchover_epoch: + format: int64 + type: integer + switchover_status: + type: string sync_scn: format: int64 type: integer @@ -4413,10 +4951,14 @@ spec: type: string tenant_type: type: string + unit_num: + format: int64 + type: integer required: - arbitration_service_status - compatibility_mode - create_time + - gmt_create_time - in_recyclebin - locality - locked @@ -4428,11 +4970,14 @@ spec: - recovery_until_scn - replayable_scn - status + - switchover_epoch + - switchover_status - sync_scn - tenant_id - tenant_name - tenant_role - tenant_type + - unit_num type: object required: - status @@ -4607,7 +5152,6 @@ spec: - piece_switch_interval - round_id - start_scn - - start_scn_display - status - tenant_id - used_piece_id @@ -4772,22 +5316,52 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME controller-gen.kubebuilder.io/version: v0.13.0 - name: obtenantrestores.oceanbase.oceanbase.com + name: obtenantoperations.oceanbase.oceanbase.com spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: webhook-service + namespace: system + path: /convert + conversionReviewVersions: + - v1 group: oceanbase.oceanbase.com names: - kind: OBTenantRestore - listKind: OBTenantRestoreList - plural: obtenantrestores - singular: obtenantrestore + kind: OBTenantOperation + listKind: OBTenantOperationList + plural: obtenantoperations + singular: obtenantoperation scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.type + name: Type + type: string + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.primaryTenant.spec.obcluster + name: Cluster + type: string + - jsonPath: .status.primaryTenant.spec.tenantName + name: PrimaryTenant + type: string + - jsonPath: .status.secondaryTenant.spec.tenantName + name: SecondaryTenant + priority: 1 + type: string + name: v1alpha1 schema: openAPIV3Schema: - description: OBTenantRestore is the Schema for the obtenantrestores API An - instance of OBTenantRestore stands for a tenant restore job + description: OBTenantOperation is the Schema for the obtenantoperations API properties: apiVersion: description: 'APIVersion defines the versioned schema of this representation @@ -4802,148 +5376,1224 @@ spec: metadata: type: object spec: - description: OBTenantRestoreSpec defines the desired state of OBTenantRestore + description: OBTenantOperationSpec defines the desired state of OBTenantOperation properties: - obClusterName: - type: string - restoreTenantName: - type: string - sourceUri: - type: string + changePwd: + properties: + secretRef: + type: string + tenant: + type: string + required: + - secretRef + - tenant + type: object + failover: + properties: + standbyTenant: + type: string + required: + - standbyTenant + type: object + switchover: + properties: + primaryTenant: + type: string + standbyTenant: + type: string + required: + - primaryTenant + - standbyTenant + type: object type: type: string - until: - type: string required: - - obClusterName - - restoreTenantName - - sourceUri - type type: object status: - description: OBTenantRestoreStatus defines the observed state of OBTenantRestore + description: OBTenantOperationStatus defines the observed state of OBTenantOperation properties: - jobStatus: - description: JobStatus represents the current state of a Job. + operationContext: properties: - active: - description: The number of pending and running pods. - format: int32 - type: integer - completedIndexes: - description: completedIndexes holds the completed indexes when - .spec.completionMode = "Indexed" in a text format. The indexes - are represented as decimal integers separated by commas. The - numbers are listed in increasing order. Three or more consecutive - numbers are compressed and represented by the first and last - element of the series, separated by a hyphen. For example, if - the completed indexes are 1, 3, 4, 5 and 7, they are represented - as "1,3-5,7". - type: string - completionTime: - description: Represents time when the job was completed. It is - not guaranteed to be set in happens-before order across separate - operations. It is represented in RFC3339 form and is in UTC. - The completion time is only set when the job finishes successfully. - format: date-time - type: string - conditions: - description: 'The latest available observations of an object''s - current state. When a Job fails, one of the conditions will - have type "Failed" and status true. When a Job is suspended, - one of the conditions will have type "Suspended" and status - true; when the Job is resumed, the status of this condition - will become false. When a Job is completed, one of the conditions - will have type "Complete" and status true. More info: https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/' - items: - description: JobCondition describes current state of a job. - properties: - lastProbeTime: - description: Last time the condition was checked. - format: date-time - type: string - lastTransitionTime: - description: Last time the condition transit from one status - to another. - format: date-time - type: string - message: - description: Human readable message indicating details about - last transition. - type: string - reason: - description: (brief) reason for the condition's last transition. - type: string - status: - description: Status of the condition, one of True, False, - Unknown. - type: string - type: - description: Type of job condition, Complete or Failed. - type: string - required: - - status - - type - type: object - type: array - x-kubernetes-list-type: atomic - failed: - description: The number of pods which reached phase Failed. - format: int32 - type: integer - ready: - description: "The number of pods which have a Ready condition. - \n This field is beta-level. The job controller populates the - field when the feature gate JobReadyPods is enabled (enabled - by default)." - format: int32 - type: integer - startTime: - description: Represents time when the job controller started processing - a job. When a Job is created in the suspended state, this field - is not set until the first time it is resumed. This field is - reset every time a Job is resumed from suspension. It is represented - in RFC3339 form and is in UTC. - format: date-time - type: string - succeeded: - description: The number of pods which reached phase Succeeded. - format: int32 + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: type: integer - uncountedTerminatedPods: - description: "uncountedTerminatedPods holds the UIDs of Pods that - have terminated but the job controller hasn't yet accounted - for in the status counters. \n The job controller creates pods - with a finalizer. When a pod terminates (succeeded or failed), - the controller does three steps to account for it in the job - status: \n 1. Add the pod UID to the arrays in this field. 2. - Remove the pod finalizer. 3. Remove the pod UID from the arrays - while increasing the corresponding counter. \n Old jobs might - not be tracked using this field, in which case the field remains - null." + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + primaryTenant: + description: OBTenant is the Schema for the obtenants 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: OBTenantSpec defines the desired state of OBTenant + properties: + charset: + default: utf8mb4 + type: string + collate: + type: string + connectWhiteList: + default: '%' + type: string + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + forceDelete: + default: false + type: boolean + obcluster: + type: string + pools: + items: + properties: + priority: + default: 1 + type: integer + resource: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + zone: + type: string + required: + - resource + - zone + type: object + type: array + source: + description: Source for restoring or creating standby + properties: + restore: + properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + cancel: + type: boolean + description: + type: string + replayLogUntil: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + sourceUri: + type: string + until: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + required: + - until + type: object + tenant: + type: string + type: object + tenantName: + type: string + tenantRole: + default: PRIMARY + type: string + unitNum: + type: integer + required: + - obcluster + - pools + - tenantName + - unitNum + type: object + status: + description: OBTenantStatus defines the observed state of OBTenant + properties: + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + resourcePool: + items: + properties: + priority: + type: integer + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + unitConfig: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + unitNum: + type: integer + units: + items: + properties: + migrate: + properties: + serverIP: + type: string + serverPort: + type: integer + required: + - serverIP + - serverPort + type: object + serverIP: + type: string + serverPort: + type: integer + status: + type: string + unitId: + type: integer + required: + - migrate + - serverIP + - serverPort + - status + - unitId + type: object + type: array + zoneList: + type: string + required: + - type + - unitConfig + - unitNum + - units + - zoneList + type: object + type: array + source: + properties: + restore: + description: OBTenantRestoreStatus defines the observed + state of OBTenantRestore + properties: + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + restoreProgress: + description: RestoreHistory is the history of restore + job, matches view CDB_OB_RESTORE_HISTORY + properties: + backup_cluster_name: + type: string + backup_cluster_version: + type: string + backup_dest: + type: string + backup_piece_list: + type: string + backup_set_list: + type: string + backup_tenant_id: + format: int64 + type: integer + backup_tenant_name: + type: string + description: + type: string + finish_bytes: + format: int64 + type: integer + finish_bytes_display: + type: string + finish_ls_count: + format: int64 + type: integer + finish_tablet_count: + format: int64 + type: integer + finish_timestamp: + type: string + job_id: + format: int64 + type: integer + ls_count: + format: int64 + type: integer + restore_option: + type: string + restore_scn: + format: int64 + type: integer + restore_scn_display: + type: string + restore_tenant_id: + format: int64 + type: integer + restore_tenant_name: + type: string + start_timestamp: + type: string + status: + type: string + tablet_count: + format: int64 + type: integer + tenant_id: + format: int64 + type: integer + total_bytes: + format: int64 + type: integer + total_bytes_display: + type: string + required: + - backup_cluster_name + - backup_cluster_version + - backup_dest + - backup_piece_list + - backup_set_list + - backup_tenant_id + - backup_tenant_name + - finish_ls_count + - finish_tablet_count + - finish_timestamp + - job_id + - ls_count + - restore_option + - restore_scn + - restore_scn_display + - restore_tenant_id + - restore_tenant_name + - start_timestamp + - status + - tablet_count + - tenant_id + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define + observed state of cluster Important: Run "make" + to regenerate code after modifying this file' + type: string + required: + - status + type: object + tenant: + type: string + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "make" to regenerate code + after modifying this file' + type: string + tenantRecordInfo: + properties: + charset: + type: string + collate: + type: string + connectWhiteList: + type: string + locality: + type: string + poolList: + type: string + primaryZone: + type: string + tenantID: + type: integer + unitNum: + type: integer + zoneList: + type: string + required: + - locality + - poolList + - primaryZone + - tenantID + type: object + tenantRole: + type: string + required: + - resourcePool + - status + type: object + type: object + secondaryTenant: + description: OBTenant is the Schema for the obtenants 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: OBTenantSpec defines the desired state of OBTenant + properties: + charset: + default: utf8mb4 + type: string + collate: + type: string + connectWhiteList: + default: '%' + type: string + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + forceDelete: + default: false + type: boolean + obcluster: + type: string + pools: + items: + properties: + priority: + default: 1 + type: integer + resource: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + zone: + type: string + required: + - resource + - zone + type: object + type: array + source: + description: Source for restoring or creating standby + properties: + restore: + properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + cancel: + type: boolean + description: + type: string + replayLogUntil: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + sourceUri: + type: string + until: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + required: + - until + type: object + tenant: + type: string + type: object + tenantName: + type: string + tenantRole: + default: PRIMARY + type: string + unitNum: + type: integer + required: + - obcluster + - pools + - tenantName + - unitNum + type: object + status: + description: OBTenantStatus defines the observed state of OBTenant + properties: + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + resourcePool: + items: + properties: + priority: + type: integer + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + unitConfig: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + unitNum: + type: integer + units: + items: + properties: + migrate: + properties: + serverIP: + type: string + serverPort: + type: integer + required: + - serverIP + - serverPort + type: object + serverIP: + type: string + serverPort: + type: integer + status: + type: string + unitId: + type: integer + required: + - migrate + - serverIP + - serverPort + - status + - unitId + type: object + type: array + zoneList: + type: string + required: + - type + - unitConfig + - unitNum + - units + - zoneList + type: object + type: array + source: + properties: + restore: + description: OBTenantRestoreStatus defines the observed + state of OBTenantRestore + properties: + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + restoreProgress: + description: RestoreHistory is the history of restore + job, matches view CDB_OB_RESTORE_HISTORY + properties: + backup_cluster_name: + type: string + backup_cluster_version: + type: string + backup_dest: + type: string + backup_piece_list: + type: string + backup_set_list: + type: string + backup_tenant_id: + format: int64 + type: integer + backup_tenant_name: + type: string + description: + type: string + finish_bytes: + format: int64 + type: integer + finish_bytes_display: + type: string + finish_ls_count: + format: int64 + type: integer + finish_tablet_count: + format: int64 + type: integer + finish_timestamp: + type: string + job_id: + format: int64 + type: integer + ls_count: + format: int64 + type: integer + restore_option: + type: string + restore_scn: + format: int64 + type: integer + restore_scn_display: + type: string + restore_tenant_id: + format: int64 + type: integer + restore_tenant_name: + type: string + start_timestamp: + type: string + status: + type: string + tablet_count: + format: int64 + type: integer + tenant_id: + format: int64 + type: integer + total_bytes: + format: int64 + type: integer + total_bytes_display: + type: string + required: + - backup_cluster_name + - backup_cluster_version + - backup_dest + - backup_piece_list + - backup_set_list + - backup_tenant_id + - backup_tenant_name + - finish_ls_count + - finish_tablet_count + - finish_timestamp + - job_id + - ls_count + - restore_option + - restore_scn + - restore_scn_display + - restore_tenant_id + - restore_tenant_name + - start_timestamp + - status + - tablet_count + - tenant_id + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define + observed state of cluster Important: Run "make" + to regenerate code after modifying this file' + type: string + required: + - status + type: object + tenant: + type: string + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "make" to regenerate code + after modifying this file' + type: string + tenantRecordInfo: + properties: + charset: + type: string + collate: + type: string + connectWhiteList: + type: string + locality: + type: string + poolList: + type: string + primaryZone: + type: string + tenantID: + type: integer + unitNum: + type: integer + zoneList: + type: string + required: + - locality + - poolList + - primaryZone + - tenantID + type: object + tenantRole: + type: string + required: + - resourcePool + - status + type: object + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "make" to regenerate code after modifying + this file' + type: string + required: + - status + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.13.0 + name: obtenantrestores.oceanbase.oceanbase.com +spec: + group: oceanbase.oceanbase.com + names: + kind: OBTenantRestore + listKind: OBTenantRestoreList + plural: obtenantrestores + singular: obtenantrestore + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.targetTenant + name: TargetTenant + type: string + - jsonPath: .spec.targetCluster + name: TargetCluster + type: string + - jsonPath: .spec.restoreRole + name: RestoreRole + type: string + - jsonPath: .status.restoreProgress.status + name: StatusInDB + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: OBTenantRestore is the Schema for the obtenantrestores API An + instance of OBTenantRestore stands for a tenant restore job + 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: OBTenantRestoreSpec defines the desired state of OBTenantRestore + properties: + primaryTenant: + type: string + restoreOption: + type: string + restoreRole: + type: string + source: + properties: + archiveSource: properties: - failed: - description: failed holds UIDs of failed Pods. - items: - description: UID is a type that holds unique ID values, - including UUIDs. Because we don't ONLY use UUIDs, this - is an alias to string. Being a type captures intent and - helps make sure that UIDs and names do not get conflated. - type: string - type: array - x-kubernetes-list-type: set - succeeded: - description: succeeded holds UIDs of succeeded Pods. - items: - description: UID is a type that holds unique ID values, - including UUIDs. Because we don't ONLY use UUIDs, this - is an alias to string. Being a type captures intent and - helps make sure that UIDs and names do not get conflated. - type: string - type: array - x-kubernetes-list-type: set + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + cancel: + type: boolean + description: + type: string + replayLogUntil: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + sourceUri: + type: string + until: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean type: object + required: + - until type: object + targetCluster: + type: string + targetTenant: + type: string + required: + - restoreOption + - restoreRole + - source + - targetCluster + - targetTenant + type: object + status: + description: OBTenantRestoreStatus defines the observed state of OBTenantRestore + properties: operationContext: properties: failureRule: @@ -4981,16 +6631,102 @@ spec: - taskStatus - tasks type: object - progress: - type: string + restoreProgress: + description: RestoreHistory is the history of restore job, matches + view CDB_OB_RESTORE_HISTORY + properties: + backup_cluster_name: + type: string + backup_cluster_version: + type: string + backup_dest: + type: string + backup_piece_list: + type: string + backup_set_list: + type: string + backup_tenant_id: + format: int64 + type: integer + backup_tenant_name: + type: string + description: + type: string + finish_bytes: + format: int64 + type: integer + finish_bytes_display: + type: string + finish_ls_count: + format: int64 + type: integer + finish_tablet_count: + format: int64 + type: integer + finish_timestamp: + type: string + job_id: + format: int64 + type: integer + ls_count: + format: int64 + type: integer + restore_option: + type: string + restore_scn: + format: int64 + type: integer + restore_scn_display: + type: string + restore_tenant_id: + format: int64 + type: integer + restore_tenant_name: + type: string + start_timestamp: + type: string + status: + type: string + tablet_count: + format: int64 + type: integer + tenant_id: + format: int64 + type: integer + total_bytes: + format: int64 + type: integer + total_bytes_display: + type: string + required: + - backup_cluster_name + - backup_cluster_version + - backup_dest + - backup_piece_list + - backup_set_list + - backup_tenant_id + - backup_tenant_name + - finish_ls_count + - finish_tablet_count + - finish_timestamp + - job_id + - ls_count + - restore_option + - restore_scn + - restore_scn_display + - restore_tenant_id + - restore_tenant_name + - start_timestamp + - status + - tablet_count + - tenant_id + type: object status: description: 'INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run "make" to regenerate code after modifying this file' type: string required: - - jobStatus - - progress - status type: object type: object @@ -5003,9 +6739,20 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: + cert-manager.io/inject-ca-from: CERTIFICATE_NAMESPACE/CERTIFICATE_NAME controller-gen.kubebuilder.io/version: v0.13.0 name: obtenants.oceanbase.oceanbase.com spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: webhook-service + namespace: system + path: /convert + conversionReviewVersions: + - v1 group: oceanbase.oceanbase.com names: kind: OBTenant @@ -5018,7 +6765,13 @@ spec: - jsonPath: .status.status name: status type: string - - jsonPath: .spec.clusterName + - jsonPath: .spec.tenantName + name: tenantName + type: string + - jsonPath: .status.tenantRole + name: tenantRole + type: string + - jsonPath: .spec.obcluster name: clusterName type: string - jsonPath: .metadata.creationTimestamp @@ -5068,6 +6821,13 @@ spec: connectWhiteList: default: '%' type: string + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object forceDelete: default: false type: boolean @@ -5141,8 +6901,64 @@ spec: - zone type: object type: array + source: + description: Source for restoring or creating standby + properties: + restore: + properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + cancel: + type: boolean + description: + type: string + replayLogUntil: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + sourceUri: + type: string + until: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + required: + - until + type: object + tenant: + type: string + type: object tenantName: type: string + tenantRole: + default: PRIMARY + type: string unitNum: type: integer required: @@ -5154,6 +6970,13 @@ spec: status: description: OBTenantStatus defines the observed state of OBTenant properties: + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object operationContext: properties: failureRule: @@ -5292,6 +7115,150 @@ spec: - zoneList type: object type: array + source: + properties: + restore: + description: OBTenantRestoreStatus defines the observed state + of OBTenantRestore + properties: + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + restoreProgress: + description: RestoreHistory is the history of restore job, + matches view CDB_OB_RESTORE_HISTORY + properties: + backup_cluster_name: + type: string + backup_cluster_version: + type: string + backup_dest: + type: string + backup_piece_list: + type: string + backup_set_list: + type: string + backup_tenant_id: + format: int64 + type: integer + backup_tenant_name: + type: string + description: + type: string + finish_bytes: + format: int64 + type: integer + finish_bytes_display: + type: string + finish_ls_count: + format: int64 + type: integer + finish_tablet_count: + format: int64 + type: integer + finish_timestamp: + type: string + job_id: + format: int64 + type: integer + ls_count: + format: int64 + type: integer + restore_option: + type: string + restore_scn: + format: int64 + type: integer + restore_scn_display: + type: string + restore_tenant_id: + format: int64 + type: integer + restore_tenant_name: + type: string + start_timestamp: + type: string + status: + type: string + tablet_count: + format: int64 + type: integer + tenant_id: + format: int64 + type: integer + total_bytes: + format: int64 + type: integer + total_bytes_display: + type: string + required: + - backup_cluster_name + - backup_cluster_version + - backup_dest + - backup_piece_list + - backup_set_list + - backup_tenant_id + - backup_tenant_name + - finish_ls_count + - finish_tablet_count + - finish_timestamp + - job_id + - ls_count + - restore_option + - restore_scn + - restore_scn_display + - restore_tenant_id + - restore_tenant_name + - start_timestamp + - status + - tablet_count + - tenant_id + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "make" to regenerate code + after modifying this file' + type: string + required: + - status + type: object + tenant: + type: string + type: object status: description: 'INSERT ADDITIONAL STATUS FIELD - define observed state of cluster Important: Run "make" to regenerate code after modifying @@ -5323,6 +7290,8 @@ spec: - primaryZone - tenantID type: object + tenantRole: + type: string required: - resourcePool - status diff --git a/deploy/operator.yaml b/deploy/operator.yaml index 369051976..ba2443484 100644 --- a/deploy/operator.yaml +++ b/deploy/operator.yaml @@ -127,7 +127,14 @@ spec: singular: obcluster scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + name: v1alpha1 schema: openAPIV3Schema: description: OBCluster is the Schema for the obclusters API @@ -2141,7 +2148,20 @@ spec: singular: observer scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .status.podIp + name: PodIP + type: string + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.obStatus + name: OBStatus + type: string + name: v1alpha1 schema: openAPIV3Schema: description: OBServer is the Schema for the observers API @@ -3989,6 +4009,8 @@ spec: kind: OBTenantBackupPolicy listKind: OBTenantBackupPolicyList plural: obtenantbackuppolicies + shortNames: + - obtbp singular: obtenantbackuppolicy scope: Namespaced versions: @@ -3996,6 +4018,9 @@ spec: - jsonPath: .status.status name: Status type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date - jsonPath: .spec.tenantName name: TenantName type: string @@ -4038,6 +4063,8 @@ spec: properties: destination: properties: + ossAccessSecret: + type: string path: type: string type: @@ -4073,6 +4100,8 @@ spec: type: boolean destination: properties: + ossAccessSecret: + type: string path: type: string type: @@ -4097,7 +4126,6 @@ spec: - logArchive - obClusterName - tenantName - - tenantSecret type: object status: description: OBTenantBackupPolicyStatus defines the observed state of @@ -4384,6 +4412,510 @@ spec: type: object status: type: string + tenantCR: + description: OBTenant is the Schema for the obtenants 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: OBTenantSpec defines the desired state of OBTenant + properties: + charset: + default: utf8mb4 + type: string + collate: + type: string + connectWhiteList: + default: '%' + type: string + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + forceDelete: + default: false + type: boolean + obcluster: + type: string + pools: + items: + properties: + priority: + default: 1 + type: integer + resource: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + zone: + type: string + required: + - resource + - zone + type: object + type: array + source: + description: Source for restoring or creating standby + properties: + restore: + properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + cancel: + type: boolean + description: + type: string + replayLogUntil: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + sourceUri: + type: string + until: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + required: + - until + type: object + tenant: + type: string + type: object + tenantName: + type: string + tenantRole: + default: PRIMARY + type: string + unitNum: + type: integer + required: + - obcluster + - pools + - tenantName + - unitNum + type: object + status: + description: OBTenantStatus defines the observed state of OBTenant + properties: + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + resourcePool: + items: + properties: + priority: + type: integer + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + unitConfig: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + unitNum: + type: integer + units: + items: + properties: + migrate: + properties: + serverIP: + type: string + serverPort: + type: integer + required: + - serverIP + - serverPort + type: object + serverIP: + type: string + serverPort: + type: integer + status: + type: string + unitId: + type: integer + required: + - migrate + - serverIP + - serverPort + - status + - unitId + type: object + type: array + zoneList: + type: string + required: + - type + - unitConfig + - unitNum + - units + - zoneList + type: object + type: array + source: + properties: + restore: + description: OBTenantRestoreStatus defines the observed + state of OBTenantRestore + properties: + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + restoreProgress: + description: RestoreHistory is the history of restore + job, matches view CDB_OB_RESTORE_HISTORY + properties: + backup_cluster_name: + type: string + backup_cluster_version: + type: string + backup_dest: + type: string + backup_piece_list: + type: string + backup_set_list: + type: string + backup_tenant_id: + format: int64 + type: integer + backup_tenant_name: + type: string + description: + type: string + finish_bytes: + format: int64 + type: integer + finish_bytes_display: + type: string + finish_ls_count: + format: int64 + type: integer + finish_tablet_count: + format: int64 + type: integer + finish_timestamp: + type: string + job_id: + format: int64 + type: integer + ls_count: + format: int64 + type: integer + restore_option: + type: string + restore_scn: + format: int64 + type: integer + restore_scn_display: + type: string + restore_tenant_id: + format: int64 + type: integer + restore_tenant_name: + type: string + start_timestamp: + type: string + status: + type: string + tablet_count: + format: int64 + type: integer + tenant_id: + format: int64 + type: integer + total_bytes: + format: int64 + type: integer + total_bytes_display: + type: string + required: + - backup_cluster_name + - backup_cluster_version + - backup_dest + - backup_piece_list + - backup_set_list + - backup_tenant_id + - backup_tenant_name + - finish_ls_count + - finish_tablet_count + - finish_timestamp + - job_id + - ls_count + - restore_option + - restore_scn + - restore_scn_display + - restore_tenant_id + - restore_tenant_name + - start_timestamp + - status + - tablet_count + - tenant_id + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define + observed state of cluster Important: Run "make" + to regenerate code after modifying this file' + type: string + required: + - status + type: object + tenant: + type: string + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "make" to regenerate code + after modifying this file' + type: string + tenantRecordInfo: + properties: + charset: + type: string + collate: + type: string + connectWhiteList: + type: string + locality: + type: string + poolList: + type: string + primaryZone: + type: string + tenantID: + type: integer + unitNum: + type: integer + zoneList: + type: string + required: + - locality + - poolList + - primaryZone + - tenantID + type: object + tenantRole: + type: string + required: + - resourcePool + - status + type: object + type: object tenantInfo: description: OBTenant is the tenant model of OB system properties: @@ -4393,6 +4925,8 @@ spec: type: string create_time: type: string + gmt_create_time: + type: string in_recyclebin: type: string locality: @@ -4418,6 +4952,11 @@ spec: type: integer status: type: string + switchover_epoch: + format: int64 + type: integer + switchover_status: + type: string sync_scn: format: int64 type: integer @@ -4430,10 +4969,14 @@ spec: type: string tenant_type: type: string + unit_num: + format: int64 + type: integer required: - arbitration_service_status - compatibility_mode - create_time + - gmt_create_time - in_recyclebin - locality - locked @@ -4445,11 +4988,14 @@ spec: - recovery_until_scn - replayable_scn - status + - switchover_epoch + - switchover_status - sync_scn - tenant_id - tenant_name - tenant_role - tenant_type + - unit_num type: object required: - status @@ -4793,6 +5339,16 @@ metadata: controller-gen.kubebuilder.io/version: v0.13.0 name: obtenantoperations.oceanbase.oceanbase.com spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: oceanbase-webhook-service + namespace: oceanbase-system + path: /convert + conversionReviewVersions: + - v1 group: oceanbase.oceanbase.com names: kind: OBTenantOperation @@ -4801,7 +5357,27 @@ spec: singular: obtenantoperation scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .spec.type + name: Type + type: string + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .status.primaryTenant.spec.obcluster + name: Cluster + type: string + - jsonPath: .status.primaryTenant.spec.tenantName + name: PrimaryTenant + type: string + - jsonPath: .status.secondaryTenant.spec.tenantName + name: SecondaryTenant + priority: 1 + type: string + name: v1alpha1 schema: openAPIV3Schema: description: OBTenantOperation is the Schema for the obtenantoperations API @@ -4893,24 +5469,1032 @@ spec: - taskStatus - tasks type: object - status: - description: 'INSERT ADDITIONAL STATUS FIELD - define observed state - of cluster Important: Run "make" to regenerate code after modifying - this file' - type: string - required: - - status - type: object - type: object - served: true - storage: true - subresources: - status: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: + primaryTenant: + description: OBTenant is the Schema for the obtenants 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: OBTenantSpec defines the desired state of OBTenant + properties: + charset: + default: utf8mb4 + type: string + collate: + type: string + connectWhiteList: + default: '%' + type: string + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + forceDelete: + default: false + type: boolean + obcluster: + type: string + pools: + items: + properties: + priority: + default: 1 + type: integer + resource: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + zone: + type: string + required: + - resource + - zone + type: object + type: array + source: + description: Source for restoring or creating standby + properties: + restore: + properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + cancel: + type: boolean + description: + type: string + replayLogUntil: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + sourceUri: + type: string + until: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + required: + - until + type: object + tenant: + type: string + type: object + tenantName: + type: string + tenantRole: + default: PRIMARY + type: string + unitNum: + type: integer + required: + - obcluster + - pools + - tenantName + - unitNum + type: object + status: + description: OBTenantStatus defines the observed state of OBTenant + properties: + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + resourcePool: + items: + properties: + priority: + type: integer + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + unitConfig: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + unitNum: + type: integer + units: + items: + properties: + migrate: + properties: + serverIP: + type: string + serverPort: + type: integer + required: + - serverIP + - serverPort + type: object + serverIP: + type: string + serverPort: + type: integer + status: + type: string + unitId: + type: integer + required: + - migrate + - serverIP + - serverPort + - status + - unitId + type: object + type: array + zoneList: + type: string + required: + - type + - unitConfig + - unitNum + - units + - zoneList + type: object + type: array + source: + properties: + restore: + description: OBTenantRestoreStatus defines the observed + state of OBTenantRestore + properties: + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + restoreProgress: + description: RestoreHistory is the history of restore + job, matches view CDB_OB_RESTORE_HISTORY + properties: + backup_cluster_name: + type: string + backup_cluster_version: + type: string + backup_dest: + type: string + backup_piece_list: + type: string + backup_set_list: + type: string + backup_tenant_id: + format: int64 + type: integer + backup_tenant_name: + type: string + description: + type: string + finish_bytes: + format: int64 + type: integer + finish_bytes_display: + type: string + finish_ls_count: + format: int64 + type: integer + finish_tablet_count: + format: int64 + type: integer + finish_timestamp: + type: string + job_id: + format: int64 + type: integer + ls_count: + format: int64 + type: integer + restore_option: + type: string + restore_scn: + format: int64 + type: integer + restore_scn_display: + type: string + restore_tenant_id: + format: int64 + type: integer + restore_tenant_name: + type: string + start_timestamp: + type: string + status: + type: string + tablet_count: + format: int64 + type: integer + tenant_id: + format: int64 + type: integer + total_bytes: + format: int64 + type: integer + total_bytes_display: + type: string + required: + - backup_cluster_name + - backup_cluster_version + - backup_dest + - backup_piece_list + - backup_set_list + - backup_tenant_id + - backup_tenant_name + - finish_ls_count + - finish_tablet_count + - finish_timestamp + - job_id + - ls_count + - restore_option + - restore_scn + - restore_scn_display + - restore_tenant_id + - restore_tenant_name + - start_timestamp + - status + - tablet_count + - tenant_id + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define + observed state of cluster Important: Run "make" + to regenerate code after modifying this file' + type: string + required: + - status + type: object + tenant: + type: string + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "make" to regenerate code + after modifying this file' + type: string + tenantRecordInfo: + properties: + charset: + type: string + collate: + type: string + connectWhiteList: + type: string + locality: + type: string + poolList: + type: string + primaryZone: + type: string + tenantID: + type: integer + unitNum: + type: integer + zoneList: + type: string + required: + - locality + - poolList + - primaryZone + - tenantID + type: object + tenantRole: + type: string + required: + - resourcePool + - status + type: object + type: object + secondaryTenant: + description: OBTenant is the Schema for the obtenants 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: OBTenantSpec defines the desired state of OBTenant + properties: + charset: + default: utf8mb4 + type: string + collate: + type: string + connectWhiteList: + default: '%' + type: string + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + forceDelete: + default: false + type: boolean + obcluster: + type: string + pools: + items: + properties: + priority: + default: 1 + type: integer + resource: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + zone: + type: string + required: + - resource + - zone + type: object + type: array + source: + description: Source for restoring or creating standby + properties: + restore: + properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + cancel: + type: boolean + description: + type: string + replayLogUntil: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + sourceUri: + type: string + until: + properties: + scn: + type: string + timestamp: + type: string + unlimited: + type: boolean + type: object + required: + - until + type: object + tenant: + type: string + type: object + tenantName: + type: string + tenantRole: + default: PRIMARY + type: string + unitNum: + type: integer + required: + - obcluster + - pools + - tenantName + - unitNum + type: object + status: + description: OBTenantStatus defines the observed state of OBTenant + properties: + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + resourcePool: + items: + properties: + priority: + type: integer + type: + description: TODO Split LocalityType struct to SpecLocalityType + and StatusLocalityType + properties: + isActive: + description: TODO move isActive to ResourcePoolSpec + And ResourcePoolStatus + type: boolean + name: + type: string + replica: + type: integer + required: + - isActive + - name + - replica + type: object + unitConfig: + description: TODO Split UnitConfig struct to SpecUnitConfig + and StatusUnitConfig + properties: + iopsWeight: + type: integer + logDiskSize: + 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 + maxCPU: + 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 + maxIops: + type: integer + memorySize: + 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 + minCPU: + 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 + minIops: + type: integer + required: + - maxCPU + - memorySize + type: object + unitNum: + type: integer + units: + items: + properties: + migrate: + properties: + serverIP: + type: string + serverPort: + type: integer + required: + - serverIP + - serverPort + type: object + serverIP: + type: string + serverPort: + type: integer + status: + type: string + unitId: + type: integer + required: + - migrate + - serverIP + - serverPort + - status + - unitId + type: object + type: array + zoneList: + type: string + required: + - type + - unitConfig + - unitNum + - units + - zoneList + type: object + type: array + source: + properties: + restore: + description: OBTenantRestoreStatus defines the observed + state of OBTenantRestore + properties: + operationContext: + properties: + failureRule: + properties: + failureStatus: + type: string + failureStrategy: + type: string + required: + - failureStatus + - failureStrategy + type: object + idx: + type: integer + name: + type: string + targetStatus: + type: string + task: + type: string + taskId: + type: string + taskStatus: + type: string + tasks: + items: + type: string + type: array + required: + - idx + - name + - targetStatus + - task + - taskId + - taskStatus + - tasks + type: object + restoreProgress: + description: RestoreHistory is the history of restore + job, matches view CDB_OB_RESTORE_HISTORY + properties: + backup_cluster_name: + type: string + backup_cluster_version: + type: string + backup_dest: + type: string + backup_piece_list: + type: string + backup_set_list: + type: string + backup_tenant_id: + format: int64 + type: integer + backup_tenant_name: + type: string + description: + type: string + finish_bytes: + format: int64 + type: integer + finish_bytes_display: + type: string + finish_ls_count: + format: int64 + type: integer + finish_tablet_count: + format: int64 + type: integer + finish_timestamp: + type: string + job_id: + format: int64 + type: integer + ls_count: + format: int64 + type: integer + restore_option: + type: string + restore_scn: + format: int64 + type: integer + restore_scn_display: + type: string + restore_tenant_id: + format: int64 + type: integer + restore_tenant_name: + type: string + start_timestamp: + type: string + status: + type: string + tablet_count: + format: int64 + type: integer + tenant_id: + format: int64 + type: integer + total_bytes: + format: int64 + type: integer + total_bytes_display: + type: string + required: + - backup_cluster_name + - backup_cluster_version + - backup_dest + - backup_piece_list + - backup_set_list + - backup_tenant_id + - backup_tenant_name + - finish_ls_count + - finish_tablet_count + - finish_timestamp + - job_id + - ls_count + - restore_option + - restore_scn + - restore_scn_display + - restore_tenant_id + - restore_tenant_name + - start_timestamp + - status + - tablet_count + - tenant_id + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define + observed state of cluster Important: Run "make" + to regenerate code after modifying this file' + type: string + required: + - status + type: object + tenant: + type: string + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed + state of cluster Important: Run "make" to regenerate code + after modifying this file' + type: string + tenantRecordInfo: + properties: + charset: + type: string + collate: + type: string + connectWhiteList: + type: string + locality: + type: string + poolList: + type: string + primaryZone: + type: string + tenantID: + type: integer + unitNum: + type: integer + zoneList: + type: string + required: + - locality + - poolList + - primaryZone + - tenantID + type: object + tenantRole: + type: string + required: + - resourcePool + - status + type: object + type: object + status: + description: 'INSERT ADDITIONAL STATUS FIELD - define observed state + of cluster Important: Run "make" to regenerate code after modifying + this file' + type: string + required: + - status + type: object + type: object + served: true + storage: true + subresources: + status: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: cert-manager.io/inject-ca-from: oceanbase-system/oceanbase-serving-cert controller-gen.kubebuilder.io/version: v0.13.0 name: obtenantrestores.oceanbase.oceanbase.com @@ -4923,7 +6507,26 @@ spec: singular: obtenantrestore scope: Namespaced versions: - - name: v1alpha1 + - additionalPrinterColumns: + - jsonPath: .status.status + name: Status + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.targetTenant + name: TargetTenant + type: string + - jsonPath: .spec.targetCluster + name: TargetCluster + type: string + - jsonPath: .spec.restoreRole + name: RestoreRole + type: string + - jsonPath: .status.restoreProgress.status + name: StatusInDB + type: string + name: v1alpha1 schema: openAPIV3Schema: description: OBTenantRestore is the Schema for the obtenantrestores API An @@ -4944,12 +6547,32 @@ spec: spec: description: OBTenantRestoreSpec defines the desired state of OBTenantRestore properties: + primaryTenant: + type: string restoreOption: type: string restoreRole: type: string source: properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object cancel: type: boolean description: @@ -4975,7 +6598,6 @@ spec: type: boolean type: object required: - - sourceUri - until type: object targetCluster: @@ -5141,6 +6763,16 @@ metadata: controller-gen.kubebuilder.io/version: v0.13.0 name: obtenants.oceanbase.oceanbase.com spec: + conversion: + strategy: Webhook + webhook: + clientConfig: + service: + name: oceanbase-webhook-service + namespace: oceanbase-system + path: /convert + conversionReviewVersions: + - v1 group: oceanbase.oceanbase.com names: kind: OBTenant @@ -5156,6 +6788,9 @@ spec: - jsonPath: .spec.tenantName name: tenantName type: string + - jsonPath: .status.tenantRole + name: tenantRole + type: string - jsonPath: .spec.obcluster name: clusterName type: string @@ -5291,6 +6926,24 @@ spec: properties: restore: properties: + archiveSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object + bakDataSource: + properties: + ossAccessSecret: + type: string + path: + type: string + type: + type: string + type: object cancel: type: boolean description: @@ -5316,7 +6969,6 @@ spec: type: boolean type: object required: - - sourceUri - until type: object tenant: @@ -5338,6 +6990,13 @@ spec: status: description: OBTenantStatus defines the observed state of OBTenant properties: + credentials: + properties: + root: + type: string + standbyRo: + type: string + type: object operationContext: properties: failureRule: @@ -8492,6 +10151,26 @@ webhooks: resources: - obtenantbackuppolicies sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: oceanbase-webhook-service + namespace: oceanbase-system + path: /mutate-oceanbase-oceanbase-com-v1alpha1-obtenantoperation + failurePolicy: Fail + name: mobtenantoperation.kb.io + rules: + - apiGroups: + - oceanbase.oceanbase.com + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - obtenantoperations + sideEffects: None --- apiVersion: admissionregistration.k8s.io/v1 kind: ValidatingWebhookConfiguration @@ -8547,3 +10226,23 @@ webhooks: resources: - obtenantbackuppolicies sideEffects: None +- admissionReviewVersions: + - v1 + clientConfig: + service: + name: oceanbase-webhook-service + namespace: oceanbase-system + path: /validate-oceanbase-oceanbase-com-v1alpha1-obtenantoperation + failurePolicy: Fail + name: vobtenantoperation.kb.io + rules: + - apiGroups: + - oceanbase.oceanbase.com + apiVersions: + - v1alpha1 + operations: + - CREATE + - UPDATE + resources: + - obtenantoperations + sideEffects: None