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.19k stars 182 forks source link

[BUG]1.0 create clickhouse cluster failed without status #8403

Closed tianyue86 closed 2 weeks ago

tianyue86 commented 2 weeks ago

Describe the bug

Kubernetes: v1.30.4+k3s1
KubeBlocks: 1.0.0-beta.0
kbcli: 1.0.0-alpha.0
clickhouse                     1.0.0-alpha.0   community   Enabled    true
clickhouse-24-1.0.0-alpha.0               clickhouse             24.8.3            Available     5h8m
eks and local have the same problem

To Reproduce Steps to reproduce the behavior:

  1. Get the latest yaml
    apiVersion: apps.kubeblocks.io/v1
    kind: Cluster
    metadata:
    name: chclu02
    namespace: default
    labels:
    helm.sh/chart: clickhouse-cluster-1.0.0-alpha.0
    app.kubernetes.io/version: "24.8.3"
    app.kubernetes.io/instance: chclu02
    spec:
    terminationPolicy: DoNotTerminate
    clusterDef: clickhouse
    topology: cluster
    componentSpecs:
    - name: ch-keeper
      componentDef: ch-keeper-24
      replicas: 1
      resources:
        limits:
          cpu: "1"
          memory: "2Gi"
        requests:
          cpu: "1"
          memory: "2Gi"
      systemAccounts:
        - name: admin
          passwordConfig:
            length: 10
            numDigits: 5
            numSymbols: 0
            letterCase: MixedCases
            seed: chclu02
      volumeClaimTemplates:
        - name: data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 10Gi 
      tls: false
    - name: clickhouse
      componentDef: clickhouse-24
      replicas: 2
      disableExporter: false
      serviceAccountName: kb-chclu02
      systemAccounts:
        - name: admin
          passwordConfig:
            length: 10
            numDigits: 5
            numSymbols: 0
            letterCase: MixedCases
            seed: chclu02 
      resources:
        limits:
          cpu: "1"
          memory: "2Gi"
        requests:
          cpu: "1"
          memory: "2Gi" 
      volumeClaimTemplates:
        - name: data # ref clusterDefinition components.containers.volumeMounts.name
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 10Gi 
      tls: false
  2. Create cluster by applying the above yaml
  3. Check the cluster status
    NAME                     DEFINITION                      SERVICE-VERSION   STATUS     AGE
    pgcluster02-postgresql   postgresql-16-1.0.0-alpha.0     16.4.0                       125m
  4. Describe the cluster
    tianyue@apeclouds-MacBook-Pro kbcli % k describe cluster chclu02
    Name:         chclu02
    Namespace:    default
    Labels:       app.kubernetes.io/instance=chclu02
              app.kubernetes.io/version=24.8.3
              clusterdefinition.kubeblocks.io/name=clickhouse
              helm.sh/chart=clickhouse-cluster-1.0.0-alpha.0
    Annotations:  <none>
    API Version:  apps.kubeblocks.io/v1
    Kind:         Cluster
    Metadata:
    Creation Timestamp:  2024-11-05T08:51:05Z
    Finalizers:
    cluster.kubeblocks.io/finalizer
    Generation:        1
    Resource Version:  42683
    UID:               f2815510-786a-4fa4-9c5a-0a8989d587ba
    Spec:
    Cluster Def:  clickhouse
    Component Specs:
    Component Def:  ch-keeper-24
    Name:           ch-keeper
    Replicas:       1
    Resources:
      Limits:
        Cpu:     1
        Memory:  2Gi
      Requests:
        Cpu:     1
        Memory:  2Gi
    System Accounts:
      Name:  admin
      Password Config:
        Length:       10
        Letter Case:  MixedCases
        Num Digits:   5
        Num Symbols:  0
        Seed:         chclu02
    Tls:              false
    Volume Claim Templates:
      Name:  data
      Spec:
        Access Modes:
          ReadWriteOnce
        Resources:
          Requests:
            Storage:   10Gi
    Component Def:     clickhouse-24
    Disable Exporter:  false
    Name:              clickhouse
    Replicas:          2
    Resources:
      Limits:
        Cpu:     1
        Memory:  2Gi
      Requests:
        Cpu:               1
        Memory:            2Gi
    Service Account Name:  kb-chclu02
    System Accounts:
      Name:  admin
      Password Config:
        Length:       10
        Letter Case:  MixedCases
        Num Digits:   5
        Num Symbols:  0
        Seed:         chclu02
    Tls:              false
    Volume Claim Templates:
      Name:  data
      Spec:
        Access Modes:
          ReadWriteOnce
        Resources:
          Requests:
            Storage:   10Gi
    Termination Policy:  DoNotTerminate
    Topology:            cluster
    Status:
    Conditions:
    Last Transition Time:  2024-11-05T08:51:05Z
    Message:               the referenced ClusterDefinition is unavailable: clickhouse
    Reason:                PreCheckFailed
    Status:                False
    Type:                  ProvisioningStarted
    Events:                    <none>
  5. no pod when executing k get pod cmd

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

shanshanying commented 2 weeks ago

Hi @tianyue86

It reports the referenced ClusterDefinition is unavailable: clickhouse. Pls check the status of the ClusterDefinition. Have you ever upgrade the Clickhouse Addon using helm upgrade ?

tianyue86 commented 2 weeks ago

error: there is no matched definitions found for the component ch-keeper tianyue@apeclouds-MacBook-Pro kbcli % k describe clusterdefinition clickhouse Name: clickhouse Namespace:
Labels: app.kubernetes.io/instance=kb-addon-clickhouse app.kubernetes.io/managed-by=Helm app.kubernetes.io/name=clickhouse app.kubernetes.io/version=24.8.3 helm.sh/chart=clickhouse-1.0.0-alpha.0 Annotations: meta.helm.sh/release-name: kb-addon-clickhouse meta.helm.sh/release-namespace: kb-system API Version: apps.kubeblocks.io/v1 Kind: ClusterDefinition Metadata: Creation Timestamp: 2024-11-01T11:10:48Z Finalizers: clusterdefinition.kubeblocks.io/finalizer Generation: 1 Resource Version: 37057352 UID: e9456482-ad4c-4736-b9ff-66b306cd4877 Spec: Topologies: Components: Comp Def: ^clickhouse-24. Name: clickhouse Name: standalone Components: Comp Def: ^clickhouse-24. Name: clickhouse Comp Def: ^clickhouse-keeper-24.* Name: ch-keeper Name: cluster Orders: Provision: ch-keeper clickhouse Status: Message: there is no matched definitions found for the component ch-keeper Observed Generation: 1 Phase: Unavailable Topologies: cluster,standalone Events:

loomts commented 2 weeks ago

Thinks for providing this log, I will try to fix it :D

tianyue86 commented 2 weeks ago

Verified and fixed. Thanks!