kubeblocks icon indicating copy to clipboard operation
kubeblocks copied to clipboard

[BUG] redis cluster do ops failed components: [shard-fdw] not found

Open JashBook opened this issue 1 year ago • 1 comments

Describe the bug A clear and concise description of what the bug is.

kbcli version
Kubernetes: v1.26.3
KubeBlocks: 0.8.2-beta.8
kbcli: 0.8.2-beta.1

To Reproduce Steps to reproduce the behavior:

  1. create cluster
apiVersion: apps.kubeblocks.io/v1alpha1
kind: Cluster
metadata:
  name: redisc-nmqygs
  namespace: default
spec:
  clusterDefinitionRef: redis
  clusterVersionRef: redis-7.0.6
  terminationPolicy: WipeOut
  shardingSpecs:
    - name: shard
      shards: 3
      template:
        name: redis
        componentDef: redis-cluster
        replicas: 1
        switchPolicy:
          type: Noop
        resources:
          limits:
            cpu: 100m
            memory: 0.5Gi
          requests:
            cpu: 100m
            memory: 0.5Gi
        volumeClaimTemplates:
          - name: data
            spec:
              accessModes:
                - ReadWriteOnce
              resources:
                 requests:
                  storage: 1Gi
  1. list-componets no found resources
 kubectl get cluster 
NAME            CLUSTER-DEFINITION   VERSION       TERMINATION-POLICY   STATUS    AGE
redisc-nmqygs   redis                redis-7.0.6   WipeOut              Running   23m
➜  ~ 
➜  ~ kubectl get component
NAME                      COMPONENT-DEFINITION   STATUS    AGE
redisc-nmqygs-shard-fdw   redis-cluster          Running   23m
redisc-nmqygs-shard-tdf   redis-cluster          Running   23m
redisc-nmqygs-shard-wm7   redis-cluster          Running   23m
➜  ~ 
➜  ~ kbcli cluster list-components redisc-nmqygs
NAME   NAMESPACE   CLUSTER   TYPE   IMAGE   
  1. describe cluster
kbcli cluster describe redisc-nmqygs 
Name: redisc-nmqygs	 Created Time: Feb 20,2024 17:11 UTC+0800
NAMESPACE   CLUSTER-DEFINITION   VERSION       STATUS    TERMINATION-POLICY   
default     redis                redis-7.0.6   Running   WipeOut              

Endpoints:
COMPONENT   MODE   INTERNAL   EXTERNAL   

Topology:
COMPONENT   INSTANCE                    ROLE      STATUS    AZ       NODE                    CREATED-TIME                 
shard-fdw   redisc-nmqygs-shard-fdw-0   primary   Running   <none>   minikube/192.168.49.2   Feb 20,2024 17:11 UTC+0800   
shard-tdf   redisc-nmqygs-shard-tdf-0   primary   Running   <none>   minikube/192.168.49.2   Feb 20,2024 17:11 UTC+0800   
shard-wm7   redisc-nmqygs-shard-wm7-0   primary   Running   <none>   minikube/192.168.49.2   Feb 20,2024 17:11 UTC+0800   

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

Images:
COMPONENT   TYPE   IMAGE   

Show cluster events: kbcli cluster list-events -n default redisc-nmqygs
  1. restart ops
kbcli cluster restart redisc-nmqygs --components shard-fdw --auto-approve 

kubectl get ops
NAME                          TYPE      CLUSTER         STATUS   PROGRESS   AGE
redisc-nmqygs-restart-qmljn   Restart   redisc-nmqygs   Failed   -/-        14s

describe ops

kubectl describe ops redisc-nmqygs-restart-qmljn 
Name:         redisc-nmqygs-restart-qmljn
Namespace:    default
Labels:       app.kubernetes.io/instance=redisc-nmqygs
              app.kubernetes.io/managed-by=kubeblocks
              ops.kubeblocks.io/ops-type=Restart
Annotations:  <none>
API Version:  apps.kubeblocks.io/v1alpha1
Kind:         OpsRequest
Metadata:
  Creation Timestamp:  2024-02-20T09:36:46Z
  Finalizers:
    opsrequest.kubeblocks.io/finalizer
  Generate Name:  redisc-nmqygs-restart-
  Generation:     2
  Managed Fields:
    API Version:  apps.kubeblocks.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:generateName:
        f:labels:
          .:
          f:app.kubernetes.io/instance:
          f:app.kubernetes.io/managed-by:
      f:spec:
        .:
        f:clusterRef:
        f:restart:
          .:
          k:{"componentName":"shard-fdw"}:
            .:
            f:componentName:
        f:ttlSecondsBeforeAbort:
        f:type:
    Manager:      kbcli
    Operation:    Update
    Time:         2024-02-20T09:36:46Z
    API Version:  apps.kubeblocks.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:metadata:
        f:finalizers:
          .:
          v:"opsrequest.kubeblocks.io/finalizer":
        f:labels:
          f:ops.kubeblocks.io/ops-type:
        f:ownerReferences:
          .:
          k:{"uid":"1fdc7826-0bab-46fa-8d9e-e7ef61de3876"}:
    Manager:      manager
    Operation:    Update
    Time:         2024-02-20T09:36:46Z
    API Version:  apps.kubeblocks.io/v1alpha1
    Fields Type:  FieldsV1
    fieldsV1:
      f:status:
        .:
        f:completionTimestamp:
        f:conditions:
          .:
          k:{"type":"Validated"}:
            .:
            f:lastTransitionTime:
            f:message:
            f:reason:
            f:status:
            f:type:
          k:{"type":"WaitForProgressing"}:
            .:
            f:lastTransitionTime:
            f:message:
            f:reason:
            f:status:
            f:type:
        f:phase:
        f:progress:
    Manager:      manager
    Operation:    Update
    Subresource:  status
    Time:         2024-02-20T09:36:46Z
  Owner References:
    API Version:     apps.kubeblocks.io/v1alpha1
    Kind:            Cluster
    Name:            redisc-nmqygs
    UID:             1fdc7826-0bab-46fa-8d9e-e7ef61de3876
  Resource Version:  1204013
  UID:               3cd31dfd-c7d7-4db7-a9b7-0cae8e9b83ec
Spec:
  Cluster Ref:  redisc-nmqygs
  Restart:
    Component Name:          shard-fdw
  Ttl Seconds Before Abort:  0
  Type:                      Restart
Status:
  Completion Timestamp:  2024-02-20T09:36:46Z
  Conditions:
    Last Transition Time:  2024-02-20T09:36:46Z
    Message:               wait for the controller to process the OpsRequest: redisc-nmqygs-restart-qmljn in Cluster: redisc-nmqygs
    Reason:                WaitForProgressing
    Status:                True
    Type:                  WaitForProgressing
    Last Transition Time:  2024-02-20T09:36:46Z
    Message:               components: [shard-fdw] not found, you can view the components by command: kbcli cluster describe redisc-nmqygs -n default
    Reason:                ValidateFailed
    Status:                False
    Type:                  Validated
  Phase:                   Failed
  Progress:                -/-
Events:
  Type     Reason              Age   From                    Message
  ----     ------              ----  ----                    -------
  Normal   WaitForProgressing  30s   ops-request-controller  wait for the controller to process the OpsRequest: redisc-nmqygs-restart-qmljn in Cluster: redisc-nmqygs
  Warning  ValidateFailed      30s   ops-request-controller  components: [shard-fdw] not found, you can view the components by command: kbcli cluster describe redisc-nmqygs -n default

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.

JashBook avatar Feb 20 '24 09:02 JashBook

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

github-actions[bot] avatar Mar 25 '24 00:03 github-actions[bot]

ops has supported sharding restart

Y-Rookie avatar Jun 27 '24 03:06 Y-Rookie