cloud

package
v0.0.0-...-fdd9da6 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2017 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloudProviders

func CloudProviders() []string

CloudProviders returns the name of all registered cloud providers in a string slice

func Getent

func Getent(key string, msg string)

func IsCloudProvider

func IsCloudProvider(name string) bool

IsCloudProvider returns true if name corresponds to an already registered cloud provider.

func IsExternal

func IsExternal(name string) bool

Detects if the string is an external cloud provider

func RegisterCloudProvider

func RegisterCloudProvider(name string, cloud Factory)

RegisterCloudProvider registers a cloud.Factory by name. This is expected to happen during app startup.

Types

type Factory

type Factory func(config io.Reader) (KubeStarter, error)

Factory is a function that returns a cloud.KubeStarter. The config parameter provides an io.Reader handler to the factory in order to load specific configurations. If no configuration is provided the parameter is nil.

type HostData

type HostData struct {
	APIServers       string
	HostnameOverride string
	InternalIP       string
	Iface            string
}

type KubeScript

type KubeScript struct {
	script.Script
	Shell *sh.Session

	HostData HostData
	PongoCtx *pongo2.Context
	Req      *api.ClusterStartupConfig

	SetHostname           bool
	EnsureBasicNetworking func()
	FindMasterPd          func() (string, bool)
	WriteCloudConfig      func() error
}

func (*KubeScript) AssignHostname

func (ks *KubeScript) AssignHostname() error

This is intended to be used for cloud providers which does not set hostname for instances, eg: Linode. This should be run as soon as the networking in enabled. This will call the instance-by-ip (external ip) api to retrieve hostname and sets it by running commands:

```sh # ref: https://www.linode.com/docs/getting-started hostnamectl set-hostname hostname echo "$external_ip $hostname" >> /etc/hosts ``` If you are running local api server, then it will use Firebase to read the instance-by-ip response.

func (*KubeScript) ConfigureSalt

func (ks *KubeScript) ConfigureSalt()

func (*KubeScript) CreateCaCert

func (ks *KubeScript) CreateCaCert() error

func (*KubeScript) CreateKubeMasterAuth

func (ks *KubeScript) CreateKubeMasterAuth() error

func (*KubeScript) CreateSaltKubeletAuth

func (ks *KubeScript) CreateSaltKubeletAuth() error

func (*KubeScript) CreateSaltKubeproxyAuth

func (ks *KubeScript) CreateSaltKubeproxyAuth() error

func (*KubeScript) CreateSaltPillar

func (ks *KubeScript) CreateSaltPillar()

func (*KubeScript) CreateTokensFile

func (ks *KubeScript) CreateTokensFile() error

func (*KubeScript) DownloadApps

func (ks *KubeScript) DownloadApps()

func (*KubeScript) EnsureInstallDir

func (ks *KubeScript) EnsureInstallDir()

func (*KubeScript) Highstate

func (ks *KubeScript) Highstate()

func (*KubeScript) InstallHostfacts

func (ks *KubeScript) InstallHostfacts()

func (*KubeScript) InstallSaltBase

func (ks *KubeScript) InstallSaltBase()

func (*KubeScript) MountMasterPd

func (ks *KubeScript) MountMasterPd(devicePath string)

--- KUBE MASTER --- Mounts a persistent disk (formatting if needed) to store the persistent data on the master -- etcd's data, a few settings, and security certs/keys/tokens.

This function can be reused to mount an existing PD because all of its operations modifying the disk are idempotent -- safe_format_and_mount only formats an unformatted disk, and mkdir -p will leave a directory be if it already exists. ref: https://github.com/kubernetes/kubernetes/blob/c406665b2b1fdec98cd321c427896f6e4b959530/cluster/gce/configure-vm.sh#L276

func (*KubeScript) Perform

func (ks *KubeScript) Perform() error

func (*KubeScript) RemoveDockerArtifacts

func (ks *KubeScript) RemoveDockerArtifacts()

func (*KubeScript) SetBrokenMOTD

func (ks *KubeScript) SetBrokenMOTD()

func (*KubeScript) SetGoodMOTD

func (ks *KubeScript) SetGoodMOTD()

func (*KubeScript) UpdateHostData

func (ks *KubeScript) UpdateHostData()

func (*KubeScript) WriteEnv

func (ks *KubeScript) WriteEnv() error

type KubeStarter

type KubeStarter interface {
	Run(req *api.ClusterStartupConfig) error
}

func GetCloudProvider

func GetCloudProvider(name string, config io.Reader) (KubeStarter, error)

GetCloudProvider creates an instance of the named cloud provider, or nil if the name is unknown. The error return is only used if the named provider was known but failed to initialize. The config parameter specifies the io.Reader handler of the configuration file for the cloud provider, or nil for no configuation.

func InitCloudProvider

func InitCloudProvider(name string, configFilePath string) (KubeStarter, error)

InitCloudProvider creates an instance of the named cloud provider.

Directories

Path Synopsis
aws
gce

Jump to

Keyboard shortcuts

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