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] A Cluster stuck in Creating status cannot be deleted #8815

Open
weicao opened this issue Jan 16, 2025 · 1 comment
Open

[BUG] A Cluster stuck in Creating status cannot be deleted #8815

weicao opened this issue Jan 16, 2025 · 1 comment
Assignees
Labels
kind/bug Something isn't working

Comments

@weicao
Copy link
Contributor

weicao commented Jan 16, 2025

Describe the bug

I created a Cluster, it stuck in Creating status.

example-semisync-mysql-and-orc        mysql                Delete               Creating   46h

the logs show:

2025-01-16T00:39:16.821Z	INFO	build error: the required var is not found in ServiceRef object orchestrator	{"controller": "component", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Component", "Component": {"name":"example-semisync-mysql-and-orc-mysql","namespace":"demo"}, "namespace": "demo", "name": "example-semisync-mysql-and-orc-mysql", "reconcileID": "26c30b0a-6f75-42a9-ac34-c30796751784", "component": {"name":"example-semisync-mysql-and-orc-mysql","namespace":"demo"}}

Then I deleted it, however, it stuck in Deleting status:

example-semisync-mysql-and-orc        mysql                Delete               Deleting   2d8h

the logs show:

2025-01-16T00:40:38.515Z	INFO	wait for the components and shardings to be deleted: map[mysql:{}]	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "Cluster": {"name":"example-semisync-mysql-and-orc","namespace":"demo"}, "namespace": "demo", "name": "example-semisync-mysql-and-orc", "reconcileID": "59a23f3d-2c71-454e-b8c3-31127e72f49e", "cluster": {"name":"example-semisync-mysql-and-orc","namespace":"demo"}}
2025-01-16T00:40:38.526Z	INFO	unexpected cluster status: Deleting	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "Cluster": {"name":"example-semisync-mysql-and-orc","namespace":"demo"}, "namespace": "demo", "name": "example-semisync-mysql-and-orc", "reconcileID": "59a23f3d-2c71-454e-b8c3-31127e72f49e", "cluster": {"name":"example-semisync-mysql-and-orc","namespace":"demo"}}
2025-01-16T00:40:38.526Z	ERROR	Reconciler error	{"controller": "cluster", "controllerGroup": "apps.kubeblocks.io", "controllerKind": "Cluster", "Cluster": {"name":"example-semisync-mysql-and-orc","namespace":"demo"}, "namespace": "demo", "name": "example-semisync-mysql-and-orc", "reconcileID": "59a23f3d-2c71-454e-b8c3-31127e72f49e", "error": "unexpected cluster status: Deleting"}
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:329
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:266
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2
	/go/pkg/mod/sigs.k8s.io/[email protected]/pkg/internal/controller/controller.go:227

To Reproduce
Here are my CRs:

apiVersion: apps.kubeblocks.io/v1
kind: Cluster
metadata:
  name: example-semisync-mysql-and-orc
  namespace: demo
spec:
  clusterDef: mysql
  topology: server-with-orc
  terminationPolicy: Delete
  componentSpecs:
    - name: mysql
      serviceVersion: 8.0.35
      replicas: 2
      serviceRefs:
        - name: orchestrator
          namespace: demo
          clusterServiceSelector:
            cluster: example-orc
            service:
              component: orchestrator
              service: orchestrator
              port: http
      resources:
        limits:
          cpu: '0.5'
          memory: 0.5Gi
        requests:
          cpu: '0.5'
          memory: 0.5Gi
      volumeClaimTemplates:
        - name: data
          spec:
            storageClassName: ""
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
---
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: example-orc
  namespace: demo
  annotations:
    "kubeblocks.io/extra-env": '{"ORC_TOPOLOGY_PASSWORD":"orchestrator","ORC_META_PASSWORD":"orchestrator","ORC_META_DATABASE":"orchestrator"}'
spec:
  terminationPolicy: Delete
  componentSpecs:
    - name: orchestrator
      componentDef: orchestrator-raft
      disableExporter: true
      replicas: 3
      resources:
        requests:
          cpu: '0.5'
          memory: 0.5Gi
        limits:
          cpu: '0.5'
          memory: 0.5Gi
      volumeClaimTemplates:
        - name: data
          spec:
            accessModes:
              - ReadWriteOnce
            resources:
              requests:
                storage: 20Gi
  1. First, create the clusters.
  2. Then,kubectl delete cluster example-semisync-mysql-and-orc -n demo

Additional context

KubeBlocks: 1.0.0-beta.22

kb-addon-mysql kb-system 1 2025-01-11 16:15:30.780811362 +0000 UTC deployed mysql-1.0.0-alpha.0 5.7.44

kb-addon-orc kb-system 1 2025-01-14 10:57:02.253543 +0800 CST deployed orchestrator-1.0.0-alpha.0 3.2.6

@weicao weicao added the kind/bug Something isn't working label Jan 16, 2025
@leon-inf leon-inf self-assigned this Jan 16, 2025
@shanshanying
Copy link
Contributor

shanshanying commented Jan 16, 2025

pls check if the seviceRef info used in mysql cluster matches that of orchestrator cluster

          clusterServiceSelector:
            cluster: example-orc
            service:
              component: orchestrator
              service: orchestrator # svc name of that of orc cmpd
              port: http  # port name 

Verify the setting aginst that of the Orchestrator CMPD deployed in your K8s:

 k get cmpd orchestrator-raft -oyaml | yq '.spec.services'

Check the output and make sure service and port specifed in above fragment are valid.

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