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.11k stars 174 forks source link

[BUG]ob created with ob-ce-repl-host failed #7218

Closed ahjing99 closed 4 months ago

ahjing99 commented 6 months ago

kbcli version Kubernetes: v1.28.7-gke.1026000 KubeBlocks: 0.9.0-beta.17 kbcli: 0.9.0-beta.4

# Enable oceanbase 
helm upgrade -i oceanbase-ce kubeblocks-addons/oceanbase-ce --version 0.9.0 -n kb-system  

create cluster kubectl apply -f cluster-repl.yaml

apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: oceanbase-cluster
  namespace: default
  annotations:
    #Specify how many clusters to create with-in one ob cluster, set to 2 when creating a primary and secondary cluster
    "kubeblocks.io/extra-env": "{\"TENANT_NAME\":\"obtenant\",\"ZONE_COUNT\":\"1\",\"OB_CLUSTERS_COUNT\":\"2\",\"TENANT_CPU\":\"2\",\"TENANT_MEMORY\":\"2G\",\"TENANT_DISK\":\"5G\"}"
spec:
  # Specifies the behavior when a Cluster is deleted.
  # - `DoNotTerminate`: Prevents deletion of the Cluster. This policy ensures that all resources remain intact.
  # - `Halt`: Deletes Cluster resources like Pods and Services but retains Persistent Volume Claims (PVCs), allowing for data preservation while stopping other operations.
  # - `Delete`: Extends the `Halt` policy by also removing PVCs, leading to a thorough cleanup while removing all persistent data.
  # - `WipeOut`: An aggressive policy that deletes all Cluster resources, including volume snapshots and backups in external storage. This results in complete data removal and should be used cautiously, primarily in non-production environments to avoid irreversible data loss.
  terminationPolicy: Delete
  # Defines a set of node affinity scheduling rules for the Cluster's Pods. This field helps control the placement of Pods on nodes within the cluster.
  affinity:
   # Specifies the anti-affinity level of Pods within a Component. It determines how pods should be spread across nodes to improve availability and performance.
    podAntiAffinity: Preferred
    # Represents the key of node labels used to define the topology domain for Pod anti-affinity and Pod spread constraints. 
    topologyKeys:
    - kubernetes.io/hostname
    # Determines the level of resource isolation between Pods. It can have the following values: `SharedNode` and `DedicatedNode`. 
    # - SharedNode: Allow that multiple Pods may share the same node, which is the default behavior of K8s. 
    # - DedicatedNode: Each Pod runs on a dedicated node, ensuring that no two Pods share the same node. 
    tenancy: SharedNode
  # An array that specifies tolerations attached to the Cluster's Pods, allowing them to be scheduled onto nodes with matching taints.
  tolerations:
    - key: kb-data
      operator: Equal
      value: "true"
      effect: NoSchedule
  # Specifies a list of ClusterComponentSpec objects used to define the individual components that make up a Cluster. This field allows for detailed configuration of each component within the Cluster. Note: `shardingSpecs` and `componentSpecs` cannot both be empty; at least one must be defined to configure a cluster. ClusterComponentSpec defines the specifications for a Component in a Cluster.
  componentSpecs:
  - name: ob-ce-0
    componentDef: ob-ce-repl-host
    replicas: 1
    resources:
      limits:
        cpu: '3'
        memory: 8Gi
      requests:
        cpu: '3'
        memory: 8Gi
    volumeClaimTemplates:
    - name: data-file
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 50Gi
    - name: data-log
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 50Gi
    - name: log
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
    - name: workdir
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi
  - name: ob-ce-1
    componentDef: ob-ce-repl-host
    replicas: 1
    resources:
      limits:
        cpu: '3'
        memory: 8Gi
      requests:
        cpu: '3'
        memory: 8Gi
    volumeClaimTemplates:
    - name: data-file
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 50Gi
    - name: data-log
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 50Gi
    - name: log
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 10Gi
    - name: workdir
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 20Gi

cluster create failed

 k get cmp
NAME                        DEFINITION        SERVICE-VERSION   STATUS   AGE
oceanbase-cluster-ob-ce-0   ob-ce-repl-host   4.2.0                      7m57s
oceanbase-cluster-ob-ce-1   ob-ce-repl-host   4.2.0                      7m57s

k describe cmp oceanbase-cluster-ob-ce-0
Name:         oceanbase-cluster-ob-ce-0
Namespace:    default
Labels:       app.kubernetes.io/instance=oceanbase-cluster
              app.kubernetes.io/managed-by=kubeblocks
              apps.kubeblocks.io/cluster-uid=40ec3ebd-0957-4a51-9e03-d9c56520b874
              apps.kubeblocks.io/component-name=ob-ce-0
              componentdefinition.kubeblocks.io/name=ob-ce-repl-host
Annotations:  apps.kubeblocks.io/multi-cluster-placement:
              kubeblocks.io/extra-env:
                {"TENANT_NAME":"obtenant","ZONE_COUNT":"1","OB_CLUSTERS_COUNT":"2","TENANT_CPU":"2","TENANT_MEMORY":"2G","TENANT_DISK":"5G"}
              kubeblocks.io/generation: 2
API Version:  apps.kubeblocks.io/v1alpha1
Kind:         Component
Metadata:
  Creation Timestamp:  2024-04-30T04:06:37Z
  Finalizers:
    cluster.kubeblocks.io/finalizer
    component.kubeblocks.io/finalizer
  Generation:  1
  Managed Fields:
    API Version:  apps.kubeblocks.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:annotations:
          .:
          f:apps.kubeblocks.io/multi-cluster-placement:
          f:kubeblocks.io/extra-env:
          f:kubeblocks.io/generation:
          f:kubectl.kubernetes.io/last-applied-configuration:
        f:finalizers:
          .:
          v:"cluster.kubeblocks.io/finalizer":
          v:"component.kubeblocks.io/finalizer":
        f:labels:
          .:
          f:app.kubernetes.io/instance:
          f:app.kubernetes.io/managed-by:
          f:apps.kubeblocks.io/cluster-uid:
          f:apps.kubeblocks.io/component-name:
          f:componentdefinition.kubeblocks.io/name:
        f:ownerReferences:
          .:
          k:{"uid":"40ec3ebd-0957-4a51-9e03-d9c56520b874"}:
      f:spec:
        .:
        f:affinity:
          .:
          f:podAntiAffinity:
          f:tenancy:
          f:topologyKeys:
            .:
            v:"kubernetes.io/hostname":
        f:compDef:
        f:replicas:
        f:resources:
          .:
          f:limits:
            .:
            f:cpu:
            f:memory:
          f:requests:
            .:
            f:cpu:
            f:memory:
        f:serviceVersion:
        f:tolerations:
        f:volumeClaimTemplates:
    Manager:      manager
    Operation:    Update
    Time:         2024-04-30T04:06:37Z
    API Version:  apps.kubeblocks.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        .:
        f:conditions:
    Manager:      manager
    Operation:    Update
    Subresource:  status
    Time:         2024-04-30T04:06:38Z
  Owner References:
    API Version:           apps.kubeblocks.io/v1alpha1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  Cluster
    Name:                  oceanbase-cluster
    UID:                   40ec3ebd-0957-4a51-9e03-d9c56520b874
  Resource Version:        57984
  UID:                     4ce65915-01c2-4f1e-9a38-d66502796e33
Spec:
  Affinity:
    Pod Anti Affinity:  Preferred
    Tenancy:            SharedNode
    Topology Keys:
      kubernetes.io/hostname
  Comp Def:  ob-ce-repl-host
  Replicas:  1
  Resources:
    Limits:
      Cpu:     3
      Memory:  8Gi
    Requests:
      Cpu:          3
      Memory:       8Gi
  Service Version:  4.2.0
  Tolerations:
    Effect:    NoSchedule
    Key:       kb-data
    Operator:  Equal
    Value:     true
    Effect:    NoSchedule
    Key:       kb-data
    Operator:  Equal
    Value:     true
  Volume Claim Templates:
    Name:  data-file
    Spec:
      Access Modes:
        ReadWriteOnce
      Resources:
        Requests:
          Storage:  50Gi
    Name:           data-log
    Spec:
      Access Modes:
        ReadWriteOnce
      Resources:
        Requests:
          Storage:  50Gi
    Name:           log
    Spec:
      Access Modes:
        ReadWriteOnce
      Resources:
        Requests:
          Storage:  10Gi
    Name:           workdir
    Spec:
      Access Modes:
        ReadWriteOnce
      Resources:
        Requests:
          Storage:  20Gi
Status:
  Conditions:
    Last Transition Time:  2024-04-30T04:06:37Z
    Message:               The operator has started the provisioning of Cluster: oceanbase-cluster-ob-ce-0
    Observed Generation:   1
    Reason:                PreCheckSucceed
    Status:                True
    Type:                  ProvisioningStarted
Events:
  Type     Reason   Age                     From                  Message
  ----     ------   ----                    ----                  -------
  Warning  Warning  2m46s (x16 over 8m14s)  component-controller  failed to validate configmap: [failed to render cue template configure: [configuration.rpc_port: invalid value 99 (out of bound >=1024):
    36:18]]
github-actions[bot] commented 5 months ago

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

ahjing99 commented 4 months ago

closing as this does not fail anymore on 0.9.0-beta.36