Kubectl Plugin

    1. You can simply download the binary from the releases page. Currently linux, darwin(OS X), windows with x86_64 and arm64 are provided. If you are using some other systems or architectures, you have to download the source code and execute make build to build the binary.

    2. Extract and move it to system PATH.

    1. Then you can use it with kubectl-kruise or kubectl kruise.
    1. $ kubectl-kruise --help
    2. $ kubectl kruise --help

    Usage

    scale

    Set a new size for a Deployment, ReplicaSet, CloneSet, or Advanced StatefulSet.

    1. $ kubectl kruise scale --replicas=3 cloneset nginx

    It equals to kubectl scale --replicas=3 cloneset nginx.

    set

    Available commands: , image, resources, selector, serviceaccount, subject.

    1. $ kubectl kruise set env cloneset/nginx STORAGE_DIR=/local
    2. $ kubectl kruise set image cloneset/nginx busybox=busybox nginx=nginx:1.9.1

    Currently it supports migrate from Deployment to CloneSet.

    scaledown

    1. # Scale down 2 with selective pods

    It will decrease replicas=replicas-2 of this cloneset and delete the specified pods.