deploy

package
Version: v0.0.0-...-194264a Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2018 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CertName

func CertName(role ssntp.Role) string

CertName gives file name to use for downloaded certificate

func CleanupImages

func CleanupImages(pattern string, keep []string, imageCacheDir string) error

CleanupImages will remove all images from the cache directory that match a specific pattern. Images that match this pattern but should be preserved can be specified in the "keep" slice.

func CreateAdminCert

func CreateAdminCert(ctx context.Context, force bool) (_ string, _ string, errOut error)

CreateAdminCert creates and installs the authentication certificates

func CreateBatWorkloads

func CreateBatWorkloads(ctx context.Context, allWorkloads bool, sshPublickey string, password string, imageCacheDir string) (errOut error)

CreateBatWorkloads creates all necessary workloads to run BAT

func CreateCNCIImage

func CreateCNCIImage(ctx context.Context, anchorCertPath string, caCertPath string, imageCacheDir string) (errOut error)

CreateCNCIImage creates a customised CNCI image in the system

func CreateUserCert

func CreateUserCert(ctx context.Context, username string, tenants []string) (_ string, errOut error)

CreateUserCert creates a user certificate in current working directory

func DefaultImageCacheDir

func DefaultImageCacheDir() string

DefaultImageCacheDir provides the default location for downloaded images

func DialSSHContext

func DialSSHContext(ctx context.Context, network string, addr string, config *ssh.ClientConfig) (*ssh.Client, error)

DialSSHContext is the equivalent of ssh.Dial but allowing the use of a context

func DownloadImage

func DownloadImage(ctx context.Context, url string, imageCacheDir string) (_ string, _ bool, errOut error)

DownloadImage checks for a cached image in the cache directory and downloads otherwise. The returned string is the path to the file and the boolean indicates if it was downloaded on this function call.

func GenerateCert

func GenerateCert(anchorCertPath string, role ssntp.Role) (path string, errOut error)

GenerateCert creates a certificate signed by the anchor certificate for a given role

func HostnameWithFallback

func HostnameWithFallback() string

HostnameWithFallback returns hostname with a fallback to localhost

func InGoPath

func InGoPath(path string) string

InGoPath returns the desired path relative to $GOPATH

func InstallTool

func InstallTool(ctx context.Context, config unitFileConf) (errOut error)

InstallTool installs a tool to its final destination and manages it via systemd

func InstallToolRemote

func InstallToolRemote(ctx context.Context, sshUser string, hostname string, config unitFileConf) (errOut error)

InstallToolRemote installs a tool a on a remote machine and setups it up with systemd

func OutputEnvironment

func OutputEnvironment(conf *ClusterConfiguration)

OutputEnvironment prints the environment to be used to access cluster

func SSHCreateFile

func SSHCreateFile(ctx context.Context, user string, host string, dest string, f io.Reader) error

SSHCreateFile creates a file on a remote machine

func SSHRunCommand

func SSHRunCommand(ctx context.Context, user string, host string, command string) error

SSHRunCommand is a convenience function to run a command on a given host. This assumes the key is already in the keyring for the provided user.

func SSHRunCommandWithStatus

func SSHRunCommandWithStatus(ctx context.Context, user string, host string, command string) (int, error)

SSHRunCommandWithStatus is a convenience function to run a command on a given host. This assumes the key is already in the keyring for the provided user. On success, the function returns 0, nil. On failure, the function returns an integer indicating the exit code of the command and an error. The exit code is set to -1, if the exit code was not available.

func SetupLocalLauncher

func SetupLocalLauncher(ctx context.Context) (errOut error)

SetupLocalLauncher installs launcher in dual mode on this node for testing

func SetupMaster

func SetupMaster(ctx context.Context, force bool, imageCacheDir string, clusterConf *ClusterConfiguration,
	localLauncher bool) (errOut error)

SetupMaster configures this machine to be a master node of the cluster

func SetupNodes

func SetupNodes(ctx context.Context, sshUser string, networkNode bool, hosts []string) error

SetupNodes joins the given nodes as launcher nodes

func SudoChownFiles

func SudoChownFiles(ctx context.Context, dest ...string) error

SudoChownFiles changes the user and group one or more files to ciaoUserAndGroup

func SudoCommandContext

func SudoCommandContext(ctx context.Context, name string, args ...string) *exec.Cmd

SudoCommandContext runs the given command with root privileges

func SudoCopyFile

func SudoCopyFile(ctx context.Context, dest string, src string) error

SudoCopyFile copies the file from the source to dest as root

func SudoMakeDirectory

func SudoMakeDirectory(ctx context.Context, dest string) error

SudoMakeDirectory creates the desired directory hiearchy as root

func SudoRemoveDirectory

func SudoRemoveDirectory(ctx context.Context, dest string) error

SudoRemoveDirectory deletes the directory hiearchy as root

func SudoRemoveFile

func SudoRemoveFile(ctx context.Context, dest string) error

SudoRemoveFile deletes the file as root

func TeardownNodes

func TeardownNodes(ctx context.Context, sshUser string, hosts []string) error

TeardownNodes removes launcher from the given nodes

func UpdateMaster

func UpdateMaster(ctx context.Context) error

UpdateMaster updates the running one the master

Types

type ClusterConfiguration

type ClusterConfiguration struct {
	CephID            string
	HTTPSCaCertPath   string
	HTTPSCertPath     string
	AdminSSHKeyPath   string
	ComputeNet        string
	MgmtNet           string
	CNCINet           string
	ServerIP          string
	AuthCACertPath    string
	AuthAdminCertPath string
	ServerHostname    string
	DisableLimits     bool
	CNCISize          string
}

ClusterConfiguration provides cluster setup information

Jump to

Keyboard shortcuts

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