pkg

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KubeConfigLocation         = "/etc/rancher/k3s/k3s.yaml"
	ExternalKubeConfigLocation = "/etc/rancher/k3s/k3s-external.yaml"
	VelaLinkPos                = "/usr/local/bin/vela"
)
View Source
var (
	//go:embed static/k3s
	K3sDirectory embed.FS

	//go:embed static/vela/images
	VelaImages embed.FS
	//go:embed static/vela/charts
	VelaChart embed.FS

	//go:embed static/nginx
	Nginx embed.FS
)

Functions

func AddTpTemp added in v1.3.1

func AddTpTemp(file string)

func Cleanup

func Cleanup() error

func CloseQuietly

func CloseQuietly(d io.Closer)

CloseQuietly closes `io.Closer` quietly. Very handy and helpful for code quality too.

func ConfigureNginx added in v1.3.1

func ConfigureNginx(args LoadBalancerArgs) error

func GenKubeconfig

func GenKubeconfig(bindIP string) error

GenKubeconfig will generate kubeconfig for remote access. This won't modify the origin kubeconfig generated by k3s

func HaveController

func HaveController(controllers string, c string) bool

func IfDeployByPod

func IfDeployByPod(controllers string) bool

func KillNginx added in v1.3.1

func KillNginx() error

func LinkToVela

func LinkToVela()

LinkToVela create soft link to from vela to velad vela

func LoadVelaImages

func LoadVelaImages() error

func NewInstallCmd

func NewInstallCmd(c common.Args, ioStreams cmdutil.IOStreams) *cobra.Command

NewInstallCmd create install cmd

func NewKubeConfigCmd

func NewKubeConfigCmd() *cobra.Command

NewKubeConfigCmd create kubeconfig command for ctrl-plane

func NewLBInstallCmd added in v1.3.1

func NewLBInstallCmd() *cobra.Command

func NewLBUninstallCmd added in v1.3.1

func NewLBUninstallCmd() *cobra.Command

func NewLoadBalancerCmd added in v1.3.1

func NewLoadBalancerCmd() *cobra.Command

func NewTokenCmd

func NewTokenCmd() *cobra.Command

func NewUninstallCmd

func NewUninstallCmd() *cobra.Command

NewUninstallCmd create uninstall command

func NewVeladCommand

func NewVeladCommand() *cobra.Command

NewVeladCommand create velad command

func NewVersionCmd

func NewVersionCmd() *cobra.Command

func PrepareK3sBin

func PrepareK3sBin() error

PrepareK3sBin prepare k3s bin

func PrepareK3sImages

func PrepareK3sImages() error

PrepareK3sImages Write embed images

func PrepareK3sScript

func PrepareK3sScript() (string, error)

PrepareK3sScript Write k3s install script to local

func PrepareVelaChart

func PrepareVelaChart() (string, error)

func PrintKubeConfig added in v1.3.1

func PrintKubeConfig(internal, external bool)

func SaveToTemp

func SaveToTemp(file fs.File, format string) (string, error)

SaveToTemp helps save an embedded file into a temporary file

func SetupK3s

func SetupK3s(cArgs InstallArgs) error

SetupK3s will set up K3s as control plane.

func TransArgsToString

func TransArgsToString(args cli.InstallArgs) []string

func UninstallNginx added in v1.3.1

func UninstallNginx() error

func WarnSaveToken

func WarnSaveToken(token string)

Types

type App

type App struct {
	// contains filtered or unexported fields
}

App is entry of all CLI, created by NewApp

func NewApp

func NewApp() App

NewApp create app

func (App) Run

func (a App) Run()

type InstallArgs added in v1.3.1

type InstallArgs struct {
	BindIP      string
	DBEndpoint  string
	IsStart     bool
	Token       string
	Controllers string
	// InstallArgs is parameters passed to vela install command
	InstallArgs cli.InstallArgs
}

InstallArgs defines arguments for velad install command

type LoadBalancerArgs added in v1.3.1

type LoadBalancerArgs struct {
	Hosts         []string
	Configuration string
}

LoadBalancerArgs defines arguments for load balancer command

Jump to

Keyboard shortcuts

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