Skip to content

Conversation

@redscholar
Copy link
Contributor

@redscholar redscholar commented Sep 23, 2025

What type of PR is this?

/kind feature

What this PR does / why we need it:

Should support etcd scaling:

  • scaling up etcd:
  1. Define the etcd nodes in inventory.yaml.
apiVersion: kubekey.kubesphere.io/v1
kind: Inventory
metadata:
  name: default
spec:
  hosts: # your can set all nodes here. or set nodes on special groups.
    node1:
      connector:
        host: 172.16.66.7
      internal_ipv4: 172.16.66.7
    node2:
      connector:
        host: 172.16.66.3
      internal_ipv4: 172.16.66.3
    node3:
      connector:
        host: 172.16.66.4
      internal_ipv4: 172.16.66.4
  groups:
    # all kubernetes nodes.
    k8s_cluster:
      groups:
        - kube_control_plane
        - kube_worker
    # control_plane nodes
    kube_control_plane:
      hosts:
        - node1
    # worker nodes
    kube_worker:
      hosts:
        - node1
    # etcd nodes when etcd_deployment_type is external
    etcd:
      hosts:
        - node1
  1. Create cluster by this inventory.yaml
    kk create cluster -i inventory.yaml
  2. Add etcd node in inventory.yaml
apiVersion: kubekey.kubesphere.io/v1
kind: Inventory
metadata:
  name: default
spec:
  hosts: # your can set all nodes here. or set nodes on special groups.
    node1:
      connector:
        host: 172.16.66.7
      internal_ipv4: 172.16.66.7
    node2:
      connector:
        host: 172.16.66.3
      internal_ipv4: 172.16.66.3
    node3:
      connector:
        host: 172.16.66.4
      internal_ipv4: 172.16.66.4
  groups:
    # all kubernetes nodes.
    k8s_cluster:
      groups:
        - kube_control_plane
        - kube_worker
    # control_plane nodes
    kube_control_plane:
      hosts:
        - node1
        - node2
        - node3
    # worker nodes
    kube_worker:
      hosts:
        - node1
        - node2
        - node3
    # etcd nodes when etcd_deployment_type is external
    etcd:
      hosts:
        - node1
        - node2
        - node3
  1. Scaling up etcd.
    kk add nodes -i inventory.yaml
  • scaling down etcd:
  1. Define the etcd nodes in inventory.yaml.
apiVersion: kubekey.kubesphere.io/v1
kind: Inventory
metadata:
  name: default
spec:
  hosts: # your can set all nodes here. or set nodes on special groups.
    node1:
      connector:
        host: 172.16.66.7
      internal_ipv4: 172.16.66.7
    node2:
      connector:
        host: 172.16.66.3
      internal_ipv4: 172.16.66.3
    node3:
      connector:
        host: 172.16.66.4
      internal_ipv4: 172.16.66.4
  groups:
    # all kubernetes nodes.
    k8s_cluster:
      groups:
        - kube_control_plane
        - kube_worker
    # control_plane nodes
    kube_control_plane:
      hosts:
        - node1
        - node2
        - node3
    # worker nodes
    kube_worker:
      hosts:
        - node1
        - node2
        - node3
    # etcd nodes when etcd_deployment_type is external
    etcd:
      hosts:
        - node1
        - node2
        - node3
  1. Create cluster by this inventory.yaml
    kk create cluster -i inventory.yaml
  2. Scaling down etcd
    kk delete nodes -i inventory.yaml node2 node3

test results

Which issue(s) this PR fixes:

Fixes #
#2728
#2742

Special notes for reviewers:

Does this PR introduced a user-facing change?

fix: support scaling down etcd

Additional documentation, usage docs, etc.:


@kubesphere-prow kubesphere-prow bot added release-note kind/feature Categorizes issue or PR as related to a new feature. labels Sep 23, 2025
@kubesphere-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: redscholar

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubesphere-prow kubesphere-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 23, 2025
@redscholar redscholar changed the title fix: scaling down etcd fix: support scaling down etcd Sep 23, 2025
@kubesphere-prow kubesphere-prow bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 23, 2025
@redscholar redscholar force-pushed the feature branch 8 times, most recently from 31f9dd6 to 4a52909 Compare September 25, 2025 08:30
@redscholar redscholar changed the title fix: support scaling down etcd fix: support scaling up/down etcd Sep 25, 2025
@redscholar redscholar force-pushed the feature branch 6 times, most recently from 1f37627 to d9ed341 Compare September 26, 2025 08:53
@redscholar redscholar force-pushed the feature branch 5 times, most recently from 8bed8b8 to d4b84be Compare September 26, 2025 12:03
@redscholar redscholar force-pushed the feature branch 4 times, most recently from a823bca to 6f36cb8 Compare September 29, 2025 06:49
@ks-ci-bot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Signed-off-by: redscholar <blacktiledhouse@gmail.com>
@kubesphere-prow kubesphere-prow bot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 29, 2025
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot

See analysis details on SonarQube Cloud

@redscholar redscholar force-pushed the feature-gitops branch 11 times, most recently from a2305d2 to 3af5e91 Compare October 20, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/hold kind/feature Categorizes issue or PR as related to a new feature. needs-rebase release-note size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants