Restart a cluster.
kubectl apply -f - <<EOF
apiVersion: apps.kubeblocks.io/v1alpha1
kind: OpsRequest
metadata:
name: mycluster-restart
namespace: demo
spec:
clusterName: mycluster
type: Restart
restart:
- componentName: be
EOF
Check the pod and operation status to validate the restarting.
kubectl get pod -n demo
kubectl get ops ops-restart -n demo
During the restarting process, there are two status types for pods.
Configure the values of components
and ttlSecondsAfterSucceed
and run the command below to restart a specified cluster.
kbcli cluster restart mycluster -n demo --components="starrocks" --ttlSecondsAfterSucceed=30
components
describes the component name that needs to be restarted.ttlSecondsAfterSucceed
describes the time to live of an OpsRequest job after the restarting succeeds.Validate the restarting.
Run the command below to check the cluster status to check the restarting status.
kbcli cluster list mycluster -n demo
>
NAME NAMESPACE CLUSTER-DEFINITION VERSION TERMINATION-POLICY STATUS CREATED-TIME
mycluster demo starrocks starrocks-3.1.1 Delete Running Jul 17,2024 19:06 UTC+0800