apply

package
v0.0.0-...-f24e75c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2022 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Copyright © 2022 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

View Source
var ApplyCmd = &cobra.Command{
	Use:   "apply",
	Short: "Create Kubernetes cluster",
	Run: func(cmd *cobra.Command, args []string) {

		hclient := hcloud.NewClient(hcloud.WithToken(viper.GetString("hetzner_token")))
		masters := createServers(hclient, true)

		setupK3s(masters)

		kubeconfig, err := saveKubeconfig(masters[0])
		if err != nil {
			log.Println(err)
		}

		config, err := clientcmd.RESTConfigFromKubeConfig(kubeconfig)
		if err != nil {
			fmt.Println(err)
			return
		}

		clientset, err := kubernetes.NewForConfig(config)
		if err != nil {
			fmt.Println(err)
			return
		}

		deployCloudController(clientset)

		log.Println("Cluster setup is complete")

	},
}

var host string serversCmd represents the servers command

Functions

This section is empty.

Types

type CommandResult

type CommandResult struct {
	StdOut []byte
	StdErr []byte
}

type UserData

type UserData struct {
	PackageUpdate  bool     `yaml:"package_update"`
	PackageUpgrade bool     `yaml:"package_upgrade"`
	Packages       []string `yaml:"packages"`
	Runcmd         []string `yaml:"runcmd"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL