code: func RunDeploy(dockerCli *KubeCli, opts options.Deploy, cfg *composetypes.Config) error {
  	cmdOut := dockerCli.Out()
  
  	// Initialize clients
  	composeClient, err := dockerCli.composeClient()
  	if err != nil {
  		return err
  	}
  	stacks, err := composeClient.Stacks(false)
  	if err != nil {
  		return err
  	}
  
  	stack, err := stacks.FromCompose(dockerCli.Err(), opts.Namespace, cfg)
  	if err != nil {
  		return err
  	}
  
  	configMaps := composeClient.ConfigMaps()
  	secrets := composeClient.Secrets()
  	services := composeClient.Services()
  
  	if err := stacks.IsColliding(services, stack); err != nil {
  		return err
  	}
  
  	if err := createResources(stack, stacks, configMaps, secrets); err != nil {
  		return err
  	}
  
  	fmt.Fprintln(cmdOut, "Waiting for the stack to be stable and running...")
  	v1beta1Cli, err := dockerCli.stacksv1beta1()
  	if err != nil {
  		return err
  	}
  
  	pods := composeClient.Pods()
  	watcher := &deployWatcher{
  		stacks: v1beta1Cli,
  		pods:   pods,
  	}
  	statusUpdates := make(chan serviceStatus)
  	displayDone := make(chan struct{})
  	go func() {
  		defer close(displayDone)
  		display := newStatusDisplay(dockerCli.Out())
  		for status := range statusUpdates {
  			display.OnStatus(status)
  		}
  	}()
  
  	err = watcher.Watch(stack.Name, stack.getServices(), statusUpdates)
  	close(statusUpdates)
  	<-displayDone
  	if err != nil {
  		return err
  	}
  	fmt.Fprintf(cmdOut, "\nStack %s is stable and running\n\n", stack.Name)
  	return nil
  
  }
docs: // RunDeploy is the kubernetes implementation of docker stack deploy