Documentation ¶
Index ¶
- func CertName(role ssntp.Role) string
- func CleanupImages(pattern string, keep []string, imageCacheDir string) error
- func CreateAdminCert(ctx context.Context, force bool) (_ string, _ string, errOut error)
- func CreateBatWorkloads(ctx context.Context, allWorkloads bool, sshPublickey string, password string, ...) (errOut error)
- func CreateCNCIImage(ctx context.Context, anchorCertPath string, caCertPath string, ...) (errOut error)
- func CreateUserCert(ctx context.Context, username string, tenants []string) (_ string, errOut error)
- func DefaultImageCacheDir() string
- func DialSSHContext(ctx context.Context, network string, addr string, config *ssh.ClientConfig) (*ssh.Client, error)
- func DownloadImage(ctx context.Context, url string, imageCacheDir string) (_ string, _ bool, errOut error)
- func GenerateCert(anchorCertPath string, role ssntp.Role) (path string, errOut error)
- func HostnameWithFallback() string
- func InGoPath(path string) string
- func InstallTool(ctx context.Context, config unitFileConf) (errOut error)
- func InstallToolRemote(ctx context.Context, sshUser string, hostname string, config unitFileConf) (errOut error)
- func OutputEnvironment(conf *ClusterConfiguration)
- func SSHCreateFile(ctx context.Context, user string, host string, dest string, f io.Reader) error
- func SSHRunCommand(ctx context.Context, user string, host string, command string) error
- func SSHRunCommandWithStatus(ctx context.Context, user string, host string, command string) (int, error)
- func SetupLocalLauncher(ctx context.Context) (errOut error)
- func SetupMaster(ctx context.Context, force bool, imageCacheDir string, ...) (errOut error)
- func SetupNodes(ctx context.Context, sshUser string, networkNode bool, hosts []string) error
- func SudoChownFiles(ctx context.Context, dest ...string) error
- func SudoCommandContext(ctx context.Context, name string, args ...string) *exec.Cmd
- func SudoCopyFile(ctx context.Context, dest string, src string) error
- func SudoMakeDirectory(ctx context.Context, dest string) error
- func SudoRemoveDirectory(ctx context.Context, dest string) error
- func SudoRemoveFile(ctx context.Context, dest string) error
- func TeardownNodes(ctx context.Context, sshUser string, hosts []string) error
- func UpdateMaster(ctx context.Context) error
- type ClusterConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupImages ¶
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 ¶
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 ¶
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 InstallTool ¶
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 ¶
SSHCreateFile creates a file on a remote machine
func SSHRunCommand ¶
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 ¶
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 ¶
SetupNodes joins the given nodes as launcher nodes
func SudoChownFiles ¶
SudoChownFiles changes the user and group one or more files to ciaoUserAndGroup
func SudoCommandContext ¶
SudoCommandContext runs the given command with root privileges
func SudoCopyFile ¶
SudoCopyFile copies the file from the source to dest as root
func SudoMakeDirectory ¶
SudoMakeDirectory creates the desired directory hiearchy as root
func SudoRemoveDirectory ¶
SudoRemoveDirectory deletes the directory hiearchy as root
func SudoRemoveFile ¶
SudoRemoveFile deletes the file as root
func TeardownNodes ¶
TeardownNodes removes launcher from the given nodes
func UpdateMaster ¶
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