# Cluster Lifecycle Management

# Start the Kubernetes cluster

# Sealer run command line

One command deploy an entire kubernetes cluster.

sealer run kubernetes:v1.19.8 -m -p password


      --cmd-args strings     set args for image cmd instruction
  -e, --env strings          set custom environment variables
  -h, --help                 help for run
  -m, --masters string       set Count or IPList to masters
  -n, --nodes string         set Count or IPList to nodes
  -p, --passwd string        set cloud provider or baremetal server password
      --pk string            set baremetal server private key (default "/root/.ssh/id_rsa")
      --pk-passwd string     set baremetal server private key password
      --port string          set the sshd service port number for the server (default port: 22) (default "22")
      --provider ALI_CLOUD   set infra provider, example ALI_CLOUD, the local server need ignore this
  -u, --user string          set baremetal server username (default "root")

More examples :

run cloud image on an exists servers

Server ip address ~
server password sealer123

Run the kubernetes cluster on the local server.

sealer run kubernetes:v1.19.8 \
   -m,, \
   -n,, \
   -p sealer123 # ssh passwd

Check the Cluster

[root@iZm5e42unzb79kod55hehvZ ~]# kubectl get node
izm5e42unzb79kod55hehvz Ready master 18h v1.19.8
izm5ehdjw3kru84f0kq7r7z Ready master 18h v1.19.8
izm5ehdjw3kru84f0kq7r8z Ready master 18h v1.19.8
izm5ehdjw3kru84f0kq7r9z Ready <none> 18h v1.19.8
izm5ehdjw3kru84f0kq7raz Ready <none> 18h v1.19.8
izm5ehdjw3kru84f0kq7rbz Ready <none> 18h v1.19.8

# Scale up and down the Kubernetes cluster

Using join command to scale up the local server.

$ sealer join \
   --masters,,, \
# or
$ sealer join --masters --nodes

Using delete command to scale down the local server.

$ sealer delete \
   --masters,,, \
# or
$ sealer delete --masters --nodes

# Upgrade the Kubernetes cluster

Specify which image you want to use for upgrading as well as the cluster name you want to upgrade via a flag "-c".

sealer upgrade registry.cn-beijing.aliyuncs.com/sealer-io/kubernetes:v1.19.9_develop -c my-cluster

if the flag "-c" is missed,sealer will use the default cluster name instead.

# Clean up the Kubernetes cluster

sealer delete --all

Sealer will also remove infrastructure resources if you use cloud mod.