appmanager

package
v0.0.0-...-420457a Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdFileExist

func CmdFileExist(node, path string) bool

func CmdWorkSpace

func CmdWorkSpace(node, cmd, workdir string)

func DeleteApp

func DeleteApp(flag *DeleteFlags, cfgFile string) error

func GetcoreFlags

func GetcoreFlags(appURL string) *coreFlags

func NewDeleteCommands

func NewDeleteCommands(cmds []Command) (Runner, Runner)

return command run on every nodes and run only on master node

func NewcoreCommands

func NewcoreCommands(cmds []Command) (Runner, Runner)

return command run on every nodes and run only on master node

func ReadFromStdin

func ReadFromStdin() (bt []byte, err error)

ReadFromStdin is

Types

type Command

type Command struct {
	Name string // LOAD START APPLY DELETE STOP REMOVE
	Cmd  string // kubectl apply -k
	Type string
}

Command is

type DeleteFlags

type DeleteFlags struct {
	Config     string
	PkgURL     string
	WorkDir    string
	CleanForce bool
}

func GetDeleteFlags

func GetDeleteFlags(appURL string) *DeleteFlags

type PkgConfig

type PkgConfig struct {
	Cmds          []Command
	URL           string
	Name          string
	Workdir       string
	ValuesContent []byte // -f values.yaml or -f - or default values,read values content before run
	Workspace     string // fmt.Sprintf("%s/%s", p.Workdir, p.Name)
}

func LoadAppConfig

func LoadAppConfig(url string, flagConfig string) (*PkgConfig, error)

func LoadConfig

func LoadConfig(packageFile string) (*PkgConfig, error)

LoadConfig from tar package

kube.tar

config
images.tar

config content:

LOAD docker load -i images.tar START systemctl start docker DELETE docker rmi STOP systemctl top APPLY kubectl apply -f

type RunOnEveryNodes

type RunOnEveryNodes struct {
	Cmd []Command
}

func (*RunOnEveryNodes) CleanUp

func (r *RunOnEveryNodes) CleanUp(config core.Config, p *PkgConfig)

func (*RunOnEveryNodes) Run

func (r *RunOnEveryNodes) Run(config core.Config, p *PkgConfig)

func (*RunOnEveryNodes) Send

func (r *RunOnEveryNodes) Send(config core.Config, p *PkgConfig)

type RunOnMaster

type RunOnMaster struct {
	Cmd []Command
}

func (*RunOnMaster) CleanUp

func (r *RunOnMaster) CleanUp(config core.Config, p *PkgConfig)

func (*RunOnMaster) Run

func (r *RunOnMaster) Run(config core.Config, p *PkgConfig)

func (*RunOnMaster) Send

func (r *RunOnMaster) Send(config core.Config, p *PkgConfig)

send package to master

type Runner

type Runner interface {
	Run(config core.Config, pkgConfig *PkgConfig)
	Send(config core.Config, pkgConfig *PkgConfig)
	CleanUp(config core.Config, pkgConfig *PkgConfig)
}

Jump to

Keyboard shortcuts

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