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]HscaleOfflineInstances is always in running status when scaleIn component that only has 1 replicas #8737

Open
tianyue86 opened this issue Jan 3, 2025 · 1 comment · May be fixed by #8834
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@tianyue86
Copy link

Describe the env
Kubernetes: v1.31.1-aliyun.1
KubeBlocks: 1.0.0-beta.21
kbcli: 1.0.0-beta.8

To Reproduce
Steps to reproduce the behavior:

  1. Create pulsar cluster with 1 broker
- name: broker
      componentDef: pulsar-broker
      replicas: 1
  1. scaleIn the component broker that only has 1 replicas
apiVersion: operations.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
  generateName: pulsar-vzrjek-hscaleoffinstance-
  labels:
    app.kubernetes.io/instance: pulsar-vzrjek
    app.kubernetes.io/managed-by: kubeblocks
  namespace: default
spec:
  type: HorizontalScaling
  clusterName: pulsar-vzrjek
  force: true
  horizontalScaling:
  - componentName: broker
    scaleIn:
      onlineInstancesToOffline:
      - pulsar-vzrjek-broker-0  

      `kubectl create -f test_ops_cluster_pulsar-vzrjek.yaml`
  1. check the ops status
kbcli cluster list-ops pulsar-vzrjek --status all  --namespace default
NAME                                    NAMESPACE   TYPE                CLUSTER         COMPONENT   STATUS    PROGRESS   CREATED-TIME                 
pulsar-vzrjek-hscaleoffinstance-ftvw4   default     HorizontalScaling   pulsar-vzrjek   broker      Running   0/1        Jan 03,2025 14:21 UTC+0800
  1. describe ops
k describe opsrequest pulsar-vzrjek-hscaleoffinstance-ftvw4
Events:
  Type    Reason                    Age   From                    Message
  ----    ------                    ----  ----                    -------
  Normal  WaitForProgressing        12m   ops-request-controller  wait for the controller to process the OpsRequest: pulsar-vzrjek-hscaleoffinstance-ftvw4 in Cluster: pulsar-vzrjek
  Normal  ValidateOpsRequestPassed  12m   ops-request-controller  OpsRequest: pulsar-vzrjek-hscaleoffinstance-ftvw4 is validated
  Normal  HorizontalScalingStarted  12m   ops-request-controller  Start to horizontal scale replicas in Cluster: pulsar-vzrjek
  1. further testing
    HscaleOfflineInstances works well when scaleIn component that has more than 1 replicas

Expected behavior
turn the ops to failed if this ops is invalid

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 Jan 3, 2025
@tianyue86 tianyue86 added this to the Release 1.0.0 milestone Jan 3, 2025
@github-actions github-actions bot modified the milestones: Release 1.0.0, Release 0.9.3 Jan 14, 2025
@shanshanying
Copy link
Contributor

It is illegal to offline the ONLY instance left in cluster. we should reject such operations.
@yipeng1030 could pls help raise the constraint in Ops. /cc @wangyelei

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

Successfully merging a pull request may close this issue.

2 participants