kubeblocks icon indicating copy to clipboard operation
kubeblocks copied to clipboard

[Improvement] ComponentVersion needs to support managing image versions used by lifecycle actions.

Open iziang opened this issue 1 year ago • 1 comments

Is your improvement request related to a problem? Please describe.

ComponentVersion currently only supports managing image versions used by containers and init containers, and it also needs to support image versions used by lifecycle actions, such as those used by StarRocks for memberLeave and actionProvision.

apiVersion: apps.kubeblocks.io/v1alpha1
kind: ComponentDefinition
metadata:
  annotations:
    meta.helm.sh/release-name: kb-addon-starrocks
    meta.helm.sh/release-namespace: kb-system
  creationTimestamp: "2024-07-15T02:59:07Z"
  finalizers:
  - componentdefinition.kubeblocks.io/finalizer
  generation: 2
  labels:
    app.kubernetes.io/instance: kb-addon-starrocks
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: starrocks
    app.kubernetes.io/version: 3.3.0
    config.kubeblocks.io/constraints-starrocks-fe-config-constraints: starrocks-fe-config-constraints
    config.kubeblocks.io/tpl-fe-cm: starrocks-fe-sd-cm
    config.kubeblocks.io/tpl-scripts: starrocks-scripts
    helm.sh/chart: starrocks-0.9.0
  name: starrocks-fe-sd
  resourceVersion: "6916382"
  uid: 7e1676aa-df18-494c-83e8-b604c9e6843b
spec:
  configs:
  - constraintRef: starrocks-fe-config-constraints
    name: fe-cm
    namespace: kb-system
    templateRef: starrocks-fe-sd-cm
    volumeName: fe-cm
  description: A StarRocks FE v3.2.2 component definition for Kubernetes
  lifecycleActions:
    accountProvision:
      customHandler:
        exec:
          command:
          - sh
          - -c
          - |
            mysql -P9030 -h127.0.0.1 -uroot -e "SET PASSWORD = PASSWORD('${STARROCKS_PASSWORD}')"
        image: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/fe-ubuntu:3.2.2
        timeoutSeconds: 0
    memberLeave:
      customHandler:
        container: fe
        exec:
          command:
          - /bin/bash
          - -c
          - |
            {{- .Files.Get "scripts/fe-member-leave.sh" | nindent 10 }}
        image: infracreate-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/fe-ubuntu:3.2.2
...

If this is a new function, please describe the motivation and goals. A clear and concise description of why you want to happen, link the design doc if possible

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or functions you've considered.

Additional context Add any other context or screenshots about the improvement request here.

iziang avatar Jul 15 '24 04:07 iziang

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

github-actions[bot] avatar Aug 19 '24 00:08 github-actions[bot]