kubeblocks icon indicating copy to clipboard operation
kubeblocks copied to clipboard

How to create a backup pod for each instance

Open CharlesQQ opened this issue 3 months ago • 6 comments

Now, we want to create a backup pod for each instance

bpt is:

  compDefs:
  - ^zookeeper-
  schedules:
  - backupMethod: zk-data-sync
    cronExpression: 0 18 * * 0
    enabled: true
    retentionPeriod: 7d
  serviceKind: Zookeeper
  target:
    fallbackRole: follower
    role: leader
    strategy: All

The bp generated by bpt is as follows:

  target:
    podSelector:
      fallbackLabelSelector:
        matchLabels:
          app.kubernetes.io/instance: momo-zookeeper
          app.kubernetes.io/managed-by: kubeblocks
          apps.kubeblocks.io/component-name: zookeeper
          kubeblocks.io/role: follower
      matchLabels:
        app.kubernetes.io/instance: momo-zookeeper
        app.kubernetes.io/managed-by: kubeblocks
        apps.kubeblocks.io/component-name: zookeeper
        kubeblocks.io/role: leader
      strategy: All
  useKopia: false

As a result, only one backup pod was created. The .spec.target.role field of bpt cannot be empty. Does this mean that backup pods can only be created for some instances?

CharlesQQ avatar Aug 21 '25 10:08 CharlesQQ

It seems the matchLables hits only on pod

      matchLabels:
        app.kubernetes.io/instance: momo-zookeeper
        app.kubernetes.io/managed-by: kubeblocks
        apps.kubeblocks.io/component-name: zookeeper
        kubeblocks.io/role: leader

there should be only one LEADER in your cluster.

You may set 'role: ""' in backup policy template.

shanshanying avatar Aug 21 '25 11:08 shanshanying

it works, However, the backup pod is destroyed at the same time as it is created, so it is not possible to run a backup pod stably for each pod at the same time. Image

Image

CharlesQQ avatar Aug 22 '25 02:08 CharlesQQ

actionSet type is Continuous?

wangyelei avatar Aug 22 '25 02:08 wangyelei

actionSet type is Continuous?

yes

CharlesQQ avatar Aug 22 '25 03:08 CharlesQQ

yes, Continuous backup is not supported yet

wangyelei avatar Aug 22 '25 03:08 wangyelei

This issue has been marked as stale because it has been open for 30 days with no activity

github-actions[bot] avatar Sep 22 '25 00:09 github-actions[bot]