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.12k stars 175 forks source link

[BUG] create pg cluster fail: component postgresql's PrimaryIndex cannot be nil when workloadType is Replication. #1780

Closed JashBook closed 1 year ago

JashBook commented 1 year ago

Describe the bug create pg cluster fail: component postgresql's PrimaryIndex cannot be nil when workloadType is Replication. helm chart package from branch main

kbcli version
Kubernetes: v1.23.8+k3s1
KubeBlocks: 0.4.0-refactor-release
kbcli: 0.4.0-beta.5

To Reproduce Steps to reproduce the behavior:

  1. install kubeblocks
    kbcli kubeblocks install --version 0.4.0-refactor-release
  2. creste pg cluster
    kbcli cluster create pg-cluster --termination-policy=WipeOut --cluster-definition=postgresql
  3. See error
    
    kbcli cluster describe pg-cluster 
    Name: pg-cluster     Created Time: Mar 06,2023 11:31 UTC+0800
    NAMESPACE   CLUSTER-DEFINITION   VERSION             STATUS            TERMINATION-POLICY   
    default     postgresql           postgresql-15.1.0   ConditionsError   WipeOut              

Endpoints: COMPONENT MODE INTERNAL EXTERNAL

Topology: COMPONENT INSTANCE ROLE STATUS AZ NODE CREATED-TIME

Resources Allocation: COMPONENT DEDICATED CPU(REQUEST/LIMIT) MEMORY(REQUEST/LIMIT) STORAGE-SIZE STORAGE-CLASS

Images: COMPONENT TYPE IMAGE

Events(last 5 warnings, see more:kbcli cluster list-events -n default pg-cluster): TIME TYPE REASON OBJECT MESSAGE
Mar 06,2023 11:31 UTC+0800 Warning PreCheckFailed Cluster/pg-cluster component postgresql's PrimaryIndex cannot be nil when workloadType is Replication.

4. get cd yaml

kubectl get cd postgresql -oyaml
apiVersion: apps.kubeblocks.io/v1alpha1 kind: ClusterDefinition metadata: annotations: meta.helm.sh/release-name: kubeblocks meta.helm.sh/release-namespace: default creationTimestamp: "2023-03-06T03:30:10Z" finalizers:

Expected behavior create pg cluster success.

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.

lynnleelhl commented 1 year ago

https://github.com/apecloud/kubeblocks/pull/1794 fixed it