apecloud / kubeblocks

KubeBlocks is an open-source control plane software that runs and manages databases, message queues and other stateful applications on K8s.
https://kubeblocks.io
GNU Affero General Public License v3.0
2.05k stars 167 forks source link

[Features] support volume mount during lifeCycleAction #7875

Open loomts opened 1 month ago

loomts commented 1 month ago

What is the user interaction of your feature Developer can customize volume mount during lifeCycleAction.

Is your feature request related to a problem? Please describe. etcd-addon need to check if tls enable in each lifeCycleAction, such as roleProbe and switchover, roleProbe action can attach target pod and use lorry container mount data and tls volumes, but switchover will startup a job pod which cannot mount exist volume right now.

Describe the solution you'd like Maybe we can adapt componentdefinition.yaml like this:

spec:
  lifecycleActions:
    switchover:
      withCandidate:
          container: xxx // method1: refactor each action and use the same volumeMount as the existing container
          targetVolumes: // method2: custom volume and volumeMount if exist (like backuppolicytemplate.yaml)
            volumes:
            - tls
            - data
            volumeMounts:
            - name: tls
              mountPath: {{ .Values.tlsMountPath }}
            - name: data
              mountPath: {{ .Values.dataMountPath }}
          exec:
            ...
nayutah commented 1 month ago

@leon-inf can kb agent solve such problem ?

leon-inf commented 1 month ago

It seems to be an implementation issue about some actions, they should follow the same behavior as role probes for example.

nayutah commented 1 month ago

It is good for supporting Action for uploading files, such as PostrgreSQL extension dynamic creation, and plugin creation for other databases.

leon-inf commented 3 weeks ago

@loomts The container field in Action has been supported by kb-agent, and the switchover action has been migrated to kb-agent too, you can try it again.