Documentation
¶
Index ¶
- func CloudProviders() []string
- func Getent(key string, msg string)
- func IsCloudProvider(name string) bool
- func IsExternal(name string) bool
- func RegisterCloudProvider(name string, cloud Factory)
- type Factory
- type HostData
- type KubeScript
- func (ks *KubeScript) AssignHostname() error
- func (ks *KubeScript) ConfigureSalt()
- func (ks *KubeScript) CreateBasicAuthFile() error
- func (ks *KubeScript) CreateCaCert() error
- func (ks *KubeScript) CreateKubeMasterAuth() error
- func (ks *KubeScript) CreateSaltKubeletAuth() error
- func (ks *KubeScript) CreateSaltKubeproxyAuth() error
- func (ks *KubeScript) CreateSaltPillar()
- func (ks *KubeScript) CreateTokensFile() error
- func (ks *KubeScript) DownloadApps()
- func (ks *KubeScript) EnsureInstallDir()
- func (ks *KubeScript) Highstate()
- func (ks *KubeScript) InstallHostfacts()
- func (ks *KubeScript) InstallSaltBase()
- func (ks *KubeScript) MountMasterPd(devicePath string)
- func (ks *KubeScript) Perform() error
- func (ks *KubeScript) RemoveDockerArtifacts()
- func (ks *KubeScript) SetBrokenMOTD()
- func (ks *KubeScript) SetGoodMOTD()
- func (ks *KubeScript) UpdateHostData()
- func (ks *KubeScript) WriteEnv() error
- type KubeStarter
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 IsCloudProvider ¶
IsCloudProvider returns true if name corresponds to an already registered cloud provider.
func IsExternal ¶
Detects if the string is an external cloud provider
func RegisterCloudProvider ¶
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 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) CreateBasicAuthFile ¶
func (ks *KubeScript) CreateBasicAuthFile() error
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.