Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]apecloud-mysql cluster created failed with the latest cluster yaml #8474

Open
tianyue86 opened this issue Nov 18, 2024 · 0 comments
Open
Assignees
Labels
kind/bug Something isn't working

Comments

@tianyue86
Copy link

Describe the env
Kubernetes: v1.30.4-eks-a737599
KubeBlocks: 1.0.0-beta.2
kbcli: 1.0.0-alpha.1
apecloud-mysql-1.0.0-alpha.0 mysql 8.0.30 Available 3d1h
apecloud-mysql 1.0.0-alpha.0 apecloud Enabled true

To Reproduce
Steps to reproduce the behavior:

  1. Get the latest apecloud-mysql cluster yaml
helm template mysql3c2 ./addons-cluster/apecloud-mysql --version 1.0.0-alpha.0
---
# Source: apecloud-mysql-cluster/templates/cluster.yaml
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: mysql3c2
  namespace: default
  labels:
   
    helm.sh/chart: apecloud-mysql-cluster-1.0.0-alpha.0
    app.kubernetes.io/version: "8.0.30"
    app.kubernetes.io/instance: mysql3c2
    auditLogEnabled: "false"
spec:
  terminationPolicy: Delete
  clusterDef: apecloud-mysql # ref clusterdefinition.name
  topology: apecloud-mysql
  componentSpecs:
    - name: mysql     
      disableExporter: true     
       
      replicas: 1     
      resources:
        limits:
          cpu: "0.5"
          memory: "0.5Gi"
        requests:
          cpu: "0.5"
          memory: "0.5Gi"     
      volumeClaimTemplates:
        - name: data # ref clusterDefinition components.containers.volumeMounts.name
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
  1. Apply the yaml to create cluster
  2. Check the cluster status ===> no status
k get cluster -A
NAMESPACE   NAME             CLUSTER-DEFINITION   TERMINATION-POLICY   STATUS     AGE
default             mysql3c2         apecloud-mysql              Delete                                                 13m
  1. k get cmp
NAME                               DEFINITION                                     SERVICE-VERSION   STATUS     AGE
mysql3c2-mysql              apecloud-mysql-1.0.0-alpha.0       8.0.30                                          29m
  1. describe cmp
k describe cmp mysql3c2-mysql
Name:         mysql3c2-mysql
Namespace:    default
Labels:       app.kubernetes.io/component=apecloud-mysql-1.0.0-alpha.0
              app.kubernetes.io/instance=mysql3c2
              app.kubernetes.io/managed-by=kubeblocks
              apps.kubeblocks.io/component-name=mysql
              componentdefinition.kubeblocks.io/name=apecloud-mysql-1.0.0-alpha.0
Annotations:  apps.kubeblocks.io/cluster-uid: 77dc293e-3266-4796-abcd-cf2ef880f275
              kubeblocks.io/generation: 2
API Version:  apps.kubeblocks.io/v1
Kind:         Component
Metadata:
  Creation Timestamp:  2024-11-18T06:44:38Z
  Finalizers:
    cluster.kubeblocks.io/finalizer
    component.kubeblocks.io/finalizer
  Generation:  1
  Owner References:
    API Version:           apps.kubeblocks.io/v1
    Block Owner Deletion:  true
    Controller:            true
    Kind:                  Cluster
    Name:                  mysql3c2
    UID:                   77dc293e-3266-4796-abcd-cf2ef880f275
  Resource Version:        50091384
  UID:                     36568305-f7f9-4ded-81b4-95bb782a170c
Spec:
  Comp Def:          apecloud-mysql-1.0.0-alpha.0
  Disable Exporter:  true
  Replicas:          1
  Resources:
    Limits:
      Cpu:     500m
      Memory:  512Mi
    Requests:
      Cpu:     500m
      Memory:  512Mi
  Scheduling Policy:
    Affinity:
      Node Affinity:
        Preferred During Scheduling Ignored During Execution:
          Preference:
            Match Expressions:
              Key:       kb-data
              Operator:  In
              Values:
                true
          Weight:  100
      Pod Anti Affinity:
        Preferred During Scheduling Ignored During Execution:
          Pod Affinity Term:
            Label Selector:
              Match Labels:
                app.kubernetes.io/instance:         mysql3c2
                apps.kubeblocks.io/component-name:  mysql
            Topology Key:                           kubernetes.io/hostname
          Weight:                                   100
        Required During Scheduling Ignored During Execution:
          Label Selector:
            Match Labels:
              app.kubernetes.io/instance:         mysql3c2
              apps.kubeblocks.io/component-name:  mysql
          Topology Key:                           kubernetes.io/hostname
    Tolerations:
      Effect:       NoSchedule
      Key:          kb-data
      Operator:     Equal
      Value:        true
  Service Version:  8.0.30
  Volume Claim Templates:
    Name:  data
    Spec:
      Access Modes:
        ReadWriteOnce
      Resources:
        Requests:
          Storage:  20Gi
Status:
  Conditions:
    Last Transition Time:  2024-11-18T06:44:39Z
    Message:               The operator has started the provisioning of Cluster: mysql3c2-mysql
    Observed Generation:   1
    Reason:                PreCheckSucceed
    Status:                True
    Type:                  ProvisioningStarted
Events:
  Type     Reason   Age                 From                  Message
  ----     ------   ----                ----                  -------
  Warning  Warning  15s (x20 over 27m)  component-controller  failed to render configmap: [failed to render configuration template[cm:mysql8.0-config-template][key:my.cnf], error: [template: mysql8.0-config-template:108:11: executing "mysql8.0-config-template" at <$.cluster.metadata.labels.auditLogEnabled>: map has no entry for key "auditLogEnabled"]]

Further testing ===> old version yaml create cluster successfully

check component definition
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: mysql-ninaym
  namespace: default
  labels: 
    auditLogEnabled: "false"
spec:
  terminationPolicy: Delete
  componentSpecs:
    - name: mysql
      componentDef: apecloud-mysql-1.0.0-alpha.0
      replicas: 3
      resources:
        requests:
          cpu: 100m
          memory: 0.5Gi
        limits:
          cpu: 100m
          memory: 0.5Gi
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 1Gi

      `kubectl apply -f test_create_mysql-ninaym.yaml`
    
cluster.apps.kubeblocks.io/mysql-ninaym created
apply test_create_mysql-ninaym.yaml Success

      `rm -rf test_create_mysql-ninaym.yaml`
    
check cluster status

      `kbcli cluster list mysql-ninaym --show-labels  --namespace default `
    
NAME           NAMESPACE   CLUSTER-DEFINITION   VERSION   TERMINATION-POLICY   STATUS     CREATED-TIME                 LABELS                  
mysql-ninaym   default                                    Delete               Creating   Nov 18,2024 11:48 UTC+0800   auditLogEnabled=false   
cluster_status:Creating
cluster_status:Running
@tianyue86 tianyue86 added the kind/bug Something isn't working label Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants