Long:`Create a new containerized k3s node (k3s in docker).`,
Args:cobra.ExactArgs(1),// exactly one name accepted // TODO: if not specified, inherit from cluster that the node shall belong to, if that is specified
Run:func(cmd*cobra.Command,args[]string){
runtime,nodes:=parseCreateNodeCmd(cmd,args)
cluster.CreateNodes(nodes,runtime)
cluster.CreateNodes(parseCreateNodeCmd(cmd,args))
},
}
// add flags
cmd.Flags().Int("replicas",1,"Number of replicas of this node specification.")
cmd.Flags().String("role","worker","Specify node role [master, worker]")
cmd.Flags().StringP("cluster","c","","Select the cluster that the node shall connect to.")
cmd.Flags().String("image",k3d.DefaultK3sImageRepo,"Specify k3s image used for the node(s)")
// done
returncmd
}
// parseCreateNodeCmd parses the command input into variables required to create a cluster