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]mysql syncer mode cluster created failed: KB_WORKLOAD_TYPE ENV not set #8667

Closed
tianyue86 opened this issue Dec 19, 2024 · 0 comments · Fixed by apecloud/kubeblocks-addons#1344
Assignees
Labels
kind/bug Something isn't working severity/major Great chance user will encounter the same problem
Milestone

Comments

@tianyue86
Copy link

Describe the env
Kubernetes: v1.31.1-aliyun.1
KubeBlocks: 1.0.0-beta.18
kbcli: 1.0.0-beta.7

To Reproduce
Steps to reproduce the behavior:

  1. Get mysql cluster by helm template
helm template mysqlc02 ./addons-cluster/mysql --version 1.0.0-alpha.0
---
# Source: mysql-cluster/templates/cluster.yaml
apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: mysqlc02
  labels:
    helm.sh/chart: mysql-cluster-1.0.0-alpha.0
    app.kubernetes.io/version: "8.0.33"
    app.kubernetes.io/instance: mysqlc02
  namespace: default
  annotations:
spec:
  terminationPolicy: Delete
  clusterDef: mysql
  topology: server
  componentSpecs:
    - name: mysql
      serviceVersion: 8.0.39     
      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 this yaml to create cluster
  2. check cluster status
k get cluster -A
NAMESPACE   NAME             CLUSTER-DEFINITION   TERMINATION-POLICY   STATUS   AGE
default     mysqlc02         mysql                Delete               Failed   16m

k get pod
NAME                     READY   STATUS             RESTARTS         AGE
mysqlc02-mysql-0         3/4     CrashLoopBackOff   8 (41s ago)      17m

k describe pod mysqlc02-mysql-0
Events:
  Type     Reason                  Age                   From                     Message
  ----     ------                  ----                  ----                     -------
  Normal   Scheduled               17m                   default-scheduler        Successfully assigned default/mysqlc02-mysql-0 to cn-zhangjiakou.10.0.0.128
  Normal   SuccessfulAttachVolume  17m                   attachdetach-controller  AttachVolume.Attach succeeded for volume "d-8vb9k9qiyn9pxnkrqbb9"
  Normal   AllocIPSucceed          17m                   terway-daemon            Alloc IP 10.0.0.78/24 took 32.87738ms
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/mysql_audit_log:8.0.33" already present on machine
  Normal   Created                 17m                   kubelet                  Created container init-data
  Normal   Started                 17m                   kubelet                  Started container init-data
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/xtrabackup:8.0" already present on machine
  Normal   Created                 17m                   kubelet                  Created container init-xtrabackup
  Normal   Started                 17m                   kubelet                  Started container init-xtrabackup
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/jemalloc:5.3.0" already present on machine
  Normal   Created                 17m                   kubelet                  Created container init-jemalloc
  Normal   Started                 17m                   kubelet                  Started container init-jemalloc
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/syncer:0.3.8" already present on machine
  Normal   Created                 17m                   kubelet                  Created container init-syncer
  Normal   Started                 17m                   kubelet                  Started container init-syncer
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/dbctl:0.1.5" already present on machine
  Normal   Created                 17m                   kubelet                  Created container init-dbctl
  Normal   Started                 17m                   kubelet                  Started container init-dbctl
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-tools:1.0.0-beta.18" already present on machine
  Normal   Created                 17m                   kubelet                  Created container kbagent-worker
  Normal   Started                 17m                   kubelet                  Started container kbagent-worker
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/mysql:8.0.39" already present on machine
  Normal   Created                 17m                   kubelet                  Created container mysql
  Normal   Started                 17m                   kubelet                  Started container mysql
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/mysqld-exporter:0.15.1" already present on machine
  Normal   Created                 17m                   kubelet                  Created container mysql-exporter
  Normal   Started                 17m                   kubelet                  Started container mysql-exporter
  Normal   Pulled                  17m                   kubelet                  Container image "apecloud-registry.cn-zhangjiakou.cr.aliyuncs.com/apecloud/kubeblocks-tools:1.0.0-beta.18" already present on machine
  Warning  BackOff                 2m25s (x72 over 17m)  kubelet                  Back-off restarting failed container mysql in pod mysqlc02-mysql-0_default(b39e3de8-68c8-4eea-a44e-4ecbced4ab85)

Pod logs:
2024-12-19T05:16:01Z DEBUG Starting syncer {"version": "63a1b2d644fed9116141acb54260394dd730909b"}
2024-12-19T05:16:01Z INFO Initialize DB manager
2024-12-19T05:16:01Z DEBUG KB_WORKLOAD_TYPE ENV not set
panic: DCS initialize failed: KB_CLUSTER_NAME must be set

goroutine 1 [running]:
main.main()
/src/cmd/syncer/main.go:51 +0x2e5

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):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@tianyue86 tianyue86 added the kind/bug Something isn't working label Dec 19, 2024
@tianyue86 tianyue86 added this to the Release 1.0.0 milestone Dec 19, 2024
@tianyue86 tianyue86 added the severity/major Great chance user will encounter the same problem label Dec 19, 2024
@xuriwuyun xuriwuyun linked a pull request Dec 19, 2024 that will close this issue
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 severity/major Great chance user will encounter the same problem
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants