github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/helm/crds/apps.kubeblocks.io_backuppolicytemplates.yaml (about)

     1  apiVersion: apiextensions.k8s.io/v1
     2  kind: CustomResourceDefinition
     3  metadata:
     4    annotations:
     5      controller-gen.kubebuilder.io/version: v0.12.1
     6    labels:
     7      app.kubernetes.io/name: kubeblocks
     8    name: backuppolicytemplates.apps.kubeblocks.io
     9  spec:
    10    group: apps.kubeblocks.io
    11    names:
    12      categories:
    13      - kubeblocks
    14      kind: BackupPolicyTemplate
    15      listKind: BackupPolicyTemplateList
    16      plural: backuppolicytemplates
    17      shortNames:
    18      - bpt
    19      singular: backuppolicytemplate
    20    scope: Cluster
    21    versions:
    22    - additionalPrinterColumns:
    23      - description: ClusterDefinition referenced by cluster.
    24        jsonPath: .spec.clusterDefinitionRef
    25        name: CLUSTER-DEFINITION
    26        type: string
    27      - jsonPath: .metadata.creationTimestamp
    28        name: AGE
    29        type: date
    30      name: v1alpha1
    31      schema:
    32        openAPIV3Schema:
    33          description: BackupPolicyTemplate is the Schema for the BackupPolicyTemplates
    34            API (defined by provider)
    35          properties:
    36            apiVersion:
    37              description: 'APIVersion defines the versioned schema of this representation
    38                of an object. Servers should convert recognized schemas to the latest
    39                internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
    40              type: string
    41            kind:
    42              description: 'Kind is a string value representing the REST resource this
    43                object represents. Servers may infer this from the endpoint the client
    44                submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
    45              type: string
    46            metadata:
    47              type: object
    48            spec:
    49              description: BackupPolicyTemplateSpec defines the desired state of BackupPolicyTemplate
    50              properties:
    51                backupPolicies:
    52                  description: backupPolicies is a list of backup policy template for
    53                    the specified componentDefinition.
    54                  items:
    55                    properties:
    56                      backupMethods:
    57                        description: backupMethods defines the backup methods.
    58                        items:
    59                          properties:
    60                            actionSetName:
    61                              description: actionSetName refers to the ActionSet object
    62                                that defines the backup actions. For volume snapshot
    63                                backup, the actionSet is not required, the controller
    64                                will use the CSI volume snapshotter to create the snapshot.
    65                              type: string
    66                            env:
    67                              description: env specifies the environment variables for
    68                                the backup workload.
    69                              items:
    70                                description: EnvVar represents an environment variable
    71                                  present in a Container.
    72                                properties:
    73                                  name:
    74                                    description: Name of the environment variable. Must
    75                                      be a C_IDENTIFIER.
    76                                    type: string
    77                                  value:
    78                                    description: 'Variable references $(VAR_NAME) are
    79                                      expanded using the previously defined environment
    80                                      variables in the container and any service environment
    81                                      variables. If a variable cannot be resolved, the
    82                                      reference in the input string will be unchanged.
    83                                      Double $$ are reduced to a single $, which allows
    84                                      for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)"
    85                                      will produce the string literal "$(VAR_NAME)".
    86                                      Escaped references will never be expanded, regardless
    87                                      of whether the variable exists or not. Defaults
    88                                      to "".'
    89                                    type: string
    90                                  valueFrom:
    91                                    description: Source for the environment variable's
    92                                      value. Cannot be used if value is not empty.
    93                                    properties:
    94                                      configMapKeyRef:
    95                                        description: Selects a key of a ConfigMap.
    96                                        properties:
    97                                          key:
    98                                            description: The key to select.
    99                                            type: string
   100                                          name:
   101                                            description: 'Name of the referent. More
   102                                              info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
   103                                              TODO: Add other useful fields. apiVersion,
   104                                              kind, uid?'
   105                                            type: string
   106                                          optional:
   107                                            description: Specify whether the ConfigMap
   108                                              or its key must be defined
   109                                            type: boolean
   110                                        required:
   111                                        - key
   112                                        type: object
   113                                        x-kubernetes-map-type: atomic
   114                                      fieldRef:
   115                                        description: 'Selects a field of the pod: supports
   116                                          metadata.name, metadata.namespace, `metadata.labels[''<KEY>'']`,
   117                                          `metadata.annotations[''<KEY>'']`, spec.nodeName,
   118                                          spec.serviceAccountName, status.hostIP, status.podIP,
   119                                          status.podIPs.'
   120                                        properties:
   121                                          apiVersion:
   122                                            description: Version of the schema the FieldPath
   123                                              is written in terms of, defaults to "v1".
   124                                            type: string
   125                                          fieldPath:
   126                                            description: Path of the field to select
   127                                              in the specified API version.
   128                                            type: string
   129                                        required:
   130                                        - fieldPath
   131                                        type: object
   132                                        x-kubernetes-map-type: atomic
   133                                      resourceFieldRef:
   134                                        description: 'Selects a resource of the container:
   135                                          only resources limits and requests (limits.cpu,
   136                                          limits.memory, limits.ephemeral-storage, requests.cpu,
   137                                          requests.memory and requests.ephemeral-storage)
   138                                          are currently supported.'
   139                                        properties:
   140                                          containerName:
   141                                            description: 'Container name: required for
   142                                              volumes, optional for env vars'
   143                                            type: string
   144                                          divisor:
   145                                            anyOf:
   146                                            - type: integer
   147                                            - type: string
   148                                            description: Specifies the output format
   149                                              of the exposed resources, defaults to
   150                                              "1"
   151                                            pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
   152                                            x-kubernetes-int-or-string: true
   153                                          resource:
   154                                            description: 'Required: resource to select'
   155                                            type: string
   156                                        required:
   157                                        - resource
   158                                        type: object
   159                                        x-kubernetes-map-type: atomic
   160                                      secretKeyRef:
   161                                        description: Selects a key of a secret in the
   162                                          pod's namespace
   163                                        properties:
   164                                          key:
   165                                            description: The key of the secret to select
   166                                              from.  Must be a valid secret key.
   167                                            type: string
   168                                          name:
   169                                            description: 'Name of the referent. More
   170                                              info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
   171                                              TODO: Add other useful fields. apiVersion,
   172                                              kind, uid?'
   173                                            type: string
   174                                          optional:
   175                                            description: Specify whether the Secret
   176                                              or its key must be defined
   177                                            type: boolean
   178                                        required:
   179                                        - key
   180                                        type: object
   181                                        x-kubernetes-map-type: atomic
   182                                    type: object
   183                                required:
   184                                - name
   185                                type: object
   186                              type: array
   187                            envMapping:
   188                              description: envMapping defines the variables of cluster
   189                                mapped to env values' keys.
   190                              items:
   191                                properties:
   192                                  key:
   193                                    description: env key which needs to mapping.
   194                                    type: string
   195                                  valueFrom:
   196                                    description: valueFrom defines source of the env
   197                                      value.
   198                                    properties:
   199                                      clusterVersionRef:
   200                                        description: mapped ClusterVersionRef to env
   201                                          value.
   202                                        items:
   203                                          properties:
   204                                            mappingValue:
   205                                              description: mapping value for the specified
   206                                                ClusterVersion names.
   207                                              type: string
   208                                            names:
   209                                              description: the array of ClusterVersion
   210                                                name which can be mapped to the env
   211                                                value.
   212                                              items:
   213                                                type: string
   214                                              type: array
   215                                          required:
   216                                          - mappingValue
   217                                          - names
   218                                          type: object
   219                                        type: array
   220                                    required:
   221                                    - clusterVersionRef
   222                                    type: object
   223                                required:
   224                                - key
   225                                - valueFrom
   226                                type: object
   227                              type: array
   228                            name:
   229                              description: the name of backup method.
   230                              pattern: ^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$
   231                              type: string
   232                            runtimeSettings:
   233                              description: runtimeSettings specifies runtime settings
   234                                for the backup workload container.
   235                              properties:
   236                                resources:
   237                                  description: 'resources specifies the resource required
   238                                    by container. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
   239                                  properties:
   240                                    claims:
   241                                      description: "Claims lists the names of resources,
   242                                        defined in spec.resourceClaims, that are used
   243                                        by this container. \n This is an alpha field
   244                                        and requires enabling the DynamicResourceAllocation
   245                                        feature gate. \n This field is immutable. It
   246                                        can only be set for containers."
   247                                      items:
   248                                        description: ResourceClaim references one entry
   249                                          in PodSpec.ResourceClaims.
   250                                        properties:
   251                                          name:
   252                                            description: Name must match the name of
   253                                              one entry in pod.spec.resourceClaims of
   254                                              the Pod where this field is used. It makes
   255                                              that resource available inside a container.
   256                                            type: string
   257                                        required:
   258                                        - name
   259                                        type: object
   260                                      type: array
   261                                      x-kubernetes-list-map-keys:
   262                                      - name
   263                                      x-kubernetes-list-type: map
   264                                    limits:
   265                                      additionalProperties:
   266                                        anyOf:
   267                                        - type: integer
   268                                        - type: string
   269                                        pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
   270                                        x-kubernetes-int-or-string: true
   271                                      description: 'Limits describes the maximum amount
   272                                        of compute resources allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
   273                                      type: object
   274                                    requests:
   275                                      additionalProperties:
   276                                        anyOf:
   277                                        - type: integer
   278                                        - type: string
   279                                        pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
   280                                        x-kubernetes-int-or-string: true
   281                                      description: 'Requests describes the minimum amount
   282                                        of compute resources required. If Requests is
   283                                        omitted for a container, it defaults to Limits
   284                                        if that is explicitly specified, otherwise to
   285                                        an implementation-defined value. Requests cannot
   286                                        exceed Limits. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/'
   287                                      type: object
   288                                  type: object
   289                              type: object
   290                            snapshotVolumes:
   291                              default: false
   292                              description: snapshotVolumes specifies whether to take
   293                                snapshots of persistent volumes. if true, the BackupScript
   294                                is not required, the controller will use the CSI volume
   295                                snapshotter to create the snapshot.
   296                              type: boolean
   297                            targetVolumes:
   298                              description: targetVolumes specifies which volumes from
   299                                the target should be mounted in the backup workload.
   300                              properties:
   301                                volumeMounts:
   302                                  description: volumeMounts specifies the mount for
   303                                    the volumes specified in `Volumes` section.
   304                                  items:
   305                                    description: VolumeMount describes a mounting of
   306                                      a Volume within a container.
   307                                    properties:
   308                                      mountPath:
   309                                        description: Path within the container at which
   310                                          the volume should be mounted.  Must not contain
   311                                          ':'.
   312                                        type: string
   313                                      mountPropagation:
   314                                        description: mountPropagation determines how
   315                                          mounts are propagated from the host to container
   316                                          and the other way around. When not set, MountPropagationNone
   317                                          is used. This field is beta in 1.10.
   318                                        type: string
   319                                      name:
   320                                        description: This must match the Name of a Volume.
   321                                        type: string
   322                                      readOnly:
   323                                        description: Mounted read-only if true, read-write
   324                                          otherwise (false or unspecified). Defaults
   325                                          to false.
   326                                        type: boolean
   327                                      subPath:
   328                                        description: Path within the volume from which
   329                                          the container's volume should be mounted.
   330                                          Defaults to "" (volume's root).
   331                                        type: string
   332                                      subPathExpr:
   333                                        description: Expanded path within the volume
   334                                          from which the container's volume should be
   335                                          mounted. Behaves similarly to SubPath but
   336                                          environment variable references $(VAR_NAME)
   337                                          are expanded using the container's environment.
   338                                          Defaults to "" (volume's root). SubPathExpr
   339                                          and SubPath are mutually exclusive.
   340                                        type: string
   341                                    required:
   342                                    - mountPath
   343                                    - name
   344                                    type: object
   345                                  type: array
   346                                volumes:
   347                                  description: Volumes indicates the list of volumes
   348                                    of targeted application that should be mounted on
   349                                    the backup job.
   350                                  items:
   351                                    type: string
   352                                  type: array
   353                              type: object
   354                          required:
   355                          - name
   356                          type: object
   357                        type: array
   358                      componentDefRef:
   359                        description: componentDefRef references componentDef defined
   360                          in ClusterDefinition spec. Need to comply with IANA Service
   361                          Naming rule.
   362                        maxLength: 22
   363                        pattern: ^[a-z]([a-z0-9\-]*[a-z0-9])?$
   364                        type: string
   365                      retentionPeriod:
   366                        default: 7d
   367                        description: "retentionPeriod determines a duration up to which
   368                          the backup should be kept. controller will remove all backups
   369                          that are older than the RetentionPeriod. For example, RetentionPeriod
   370                          of `30d` will keep only the backups of last 30 days. Sample
   371                          duration format: - years: \t2y - months: \t6mo - days: \t\t30d
   372                          - hours: \t12h - minutes: \t30m You can also combine the above
   373                          durations. For example: 30d12h30m"
   374                        type: string
   375                      schedules:
   376                        description: schedule policy for backup.
   377                        items:
   378                          properties:
   379                            backupMethod:
   380                              description: backupMethod specifies the backup method
   381                                name that is defined in backupPolicy.
   382                              type: string
   383                            cronExpression:
   384                              description: the cron expression for schedule, the timezone
   385                                is in UTC. see https://en.wikipedia.org/wiki/Cron.
   386                              type: string
   387                            enabled:
   388                              description: enabled specifies whether the backup schedule
   389                                is enabled or not.
   390                              type: boolean
   391                          required:
   392                          - backupMethod
   393                          - cronExpression
   394                          type: object
   395                        type: array
   396                      target:
   397                        description: target instance for backup.
   398                        properties:
   399                          account:
   400                            description: refer to spec.componentDef.systemAccounts.accounts[*].name
   401                              in ClusterDefinition. the secret created by this account
   402                              will be used to connect the database. if not set, the
   403                              secret created by spec.ConnectionCredential of the ClusterDefinition
   404                              will be used. it will be transformed to a secret for BackupPolicy's
   405                              target secret.
   406                            type: string
   407                          connectionCredentialKey:
   408                            description: connectionCredentialKey defines connection
   409                              credential key in secret which created by spec.ConnectionCredential
   410                              of the ClusterDefinition. it will be ignored when "account"
   411                              is set.
   412                            properties:
   413                              hostKey:
   414                                description: hostKey specifies the map key of the host
   415                                  in the connection credential secret.
   416                                type: string
   417                              passwordKey:
   418                                description: the key of password in the ConnectionCredential
   419                                  secret. if not set, the default key is "password".
   420                                type: string
   421                              portKey:
   422                                default: port
   423                                description: portKey specifies the map key of the port
   424                                  in the connection credential secret.
   425                                type: string
   426                              usernameKey:
   427                                description: the key of username in the ConnectionCredential
   428                                  secret. if not set, the default key is "username".
   429                                type: string
   430                            type: object
   431                          role:
   432                            description: 'select instance of corresponding role for
   433                              backup, role are: - the name of Leader/Follower/Leaner
   434                              for Consensus component. - primary or secondary for Replication
   435                              component. finally, invalid role of the component will
   436                              be ignored. such as if workload type is Replication and
   437                              component''s replicas is 1, the secondary role is invalid.
   438                              and it also will be ignored when component is Stateful/Stateless.
   439                              the role will be transformed to a role LabelSelector for
   440                              BackupPolicy''s target attribute.'
   441                            type: string
   442                        type: object
   443                    required:
   444                    - backupMethods
   445                    - componentDefRef
   446                    type: object
   447                  minItems: 1
   448                  type: array
   449                  x-kubernetes-list-map-keys:
   450                  - componentDefRef
   451                  x-kubernetes-list-type: map
   452                clusterDefinitionRef:
   453                  description: clusterDefinitionRef references ClusterDefinition name,
   454                    this is an immutable attribute.
   455                  pattern: ^[a-z0-9]([a-z0-9\.\-]*[a-z0-9])?$
   456                  type: string
   457                  x-kubernetes-validations:
   458                  - message: clusterDefinitionRef is immutable
   459                    rule: self == oldSelf
   460                identifier:
   461                  description: Identifier is a unique identifier for this BackupPolicyTemplate.
   462                    this identifier will be the suffix of the automatically generated
   463                    backupPolicy name. and must be added when multiple BackupPolicyTemplates
   464                    exist, otherwise the generated backupPolicy override will occur.
   465                  maxLength: 20
   466                  type: string
   467              required:
   468              - backupPolicies
   469              - clusterDefinitionRef
   470              type: object
   471            status:
   472              description: BackupPolicyTemplateStatus defines the observed state of
   473                BackupPolicyTemplate
   474              type: object
   475          type: object
   476      served: true
   477      storage: true
   478      subresources:
   479        status: {}