Documentation ¶
Index ¶
- Constants
- Variables
- type Config
- type NodePool
- type Platform
- func (p *Platform) Address() string
- func (p *Platform) Apply(destroy bool) error
- func (p *Platform) BeProvisioner(state *terraformer.State) error
- func (p *Platform) Code() []byte
- func (p *Platform) Config() interface{}
- func (p *Platform) Credentials(params ...string)
- func (p *Platform) GetPrivateKey() (string, []byte, bool)
- func (p *Platform) GetPublicKey() (string, []byte, bool)
- func (p *Platform) LoadState(stateBuffer *bytes.Buffer) error
- func (p *Platform) MergeWithEnv(envConfig map[string]string) error
- func (p *Platform) Name() string
- func (p *Platform) Nodes() []*state.Node
- func (p *Platform) Output(name string) string
- func (p *Platform) Plan(destroy bool) (plan *terraformer.Plan, err error)
- func (p *Platform) Port() int
- func (p *Platform) PrivateKey(file string, encKey, key []byte)
- func (p *Platform) Provision() error
- func (p *Platform) PublicKey(file string, key []byte)
- func (p *Platform) State() *terraformer.State
- func (p *Platform) Terminate() error
- func (p *Platform) Variables() map[string]interface{}
Constants ¶
const KubekitOS = "Templates/LinkedClones/vmware-kubekit-os-01.48-19.11.00-200G"
KubekitOS is the latest or stable KubekitOS template name
Variables ¶
var ResourceTemplates map[string]string
ResourceTemplates maps resource names to content of resources implementation specified in code.go
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { ClusterName string `json:"-" yaml:"-" mapstructure:"clustername"` KubeAPISSLPort int `json:"kube_api_ssl_port" yaml:"kube_api_ssl_port" mapstructure:"kube_api_ssl_port"` DisableMasterHA bool `json:"disable_master_ha" yaml:"disable_master_ha" mapstructure:"disable_master_ha"` KubeVirtualIPShortname string `json:"kube_virtual_ip_shortname" yaml:"kube_virtual_ip_shortname" mapstructure:"kube_virtual_ip_shortname"` KubeVirtualIPApi string `json:"kube_virtual_ip_api" yaml:"kube_virtual_ip_api" mapstructure:"kube_virtual_ip_api"` KubeVIPAPISSLPort int `json:"kube_vip_api_ssl_port" yaml:"kube_vip_api_ssl_port" mapstructure:"kube_vip_api_ssl_port"` PublicAPIServerDNSName string `json:"public_apiserver_dns_name" yaml:"public_apiserver_dns_name" mapstructure:"public_apiserver_dns_name"` PrivateAPIServerDNSName string `json:"private_apiserver_dns_name" yaml:"private_apiserver_dns_name" mapstructure:"private_apiserver_dns_name"` Username string `json:"username" yaml:"username" mapstructure:"name"` VsphereUsername string `json:"-" yaml:"-" mapstructure:"-"` VspherePassword string `json:"-" yaml:"-" mapstructure:"-"` VsphereServer string `json:"-" yaml:"-" mapstructure:"vsphere_server"` Datacenter string `json:"datacenter" yaml:"datacenter" mapstructure:"datacenter"` Datastore string `json:"datastore" yaml:"datastore" mapstructure:"datastore"` ResourcePool string `json:"resource_pool" yaml:"resource_pool" mapstructure:"resource_pool"` VsphereNet string `json:"vsphere_net" yaml:"vsphere_net" mapstructure:"vsphere_net"` Folder string `json:"folder" yaml:"folder" mapstructure:"folder"` Domain string `json:"domain" yaml:"domain" mapstructure:"domain"` DNSServers []string `json:"dns_servers" yaml:"dns_servers" mapstructure:"dns_servers"` DNSSearch []string `json:"dns_search" yaml:"dns_search" mapstructure:"dns_search"` TimeServers []string `json:"time_servers" yaml:"time_servers" mapstructure:"time_servers"` PrivateKey string `json:"private_key,omitempty" yaml:"private_key,omitempty" mapstructure:"private_key"` PrivateKeyFile string `json:"private_key_file" yaml:"private_key_file" mapstructure:"private_key_file"` PublicKey string `json:"public_key,omitempty" yaml:"public_key,omitempty" mapstructure:"public_key"` PublicKeyFile string `json:"public_key_file" yaml:"public_key_file" mapstructure:"public_key_file"` DefaultNodePool NodePool `json:"default_node_pool" yaml:"default_node_pool" mapstructure:"default_node_pool"` NodePools map[string]NodePool `json:"node_pools" yaml:"node_pools" mapstructure:"node_pools"` }
Config defines the vSphere configuration parameters in the Cluster config file
func NewConfigFrom ¶
func NewConfigFrom(m map[interface{}]interface{}) *Config
NewConfigFrom returns a new vSphere configuration from a map, usually from a cluster config file
func (*Config) MergeNodePools ¶
MergeNodePools merges the node pools in this configuration with the given environment configuration for node pools
func (*Config) MergeWithEnv ¶
MergeWithEnv merges this configuration with the given configuration in a map[string]string, usually from environment variables
func (*Config) MergeWithMapConfig ¶
func (c *Config) MergeWithMapConfig(m map[interface{}]interface{})
MergeWithMapConfig merges this configuration with the given configuration in a map[string], usually from a cluster config file
type NodePool ¶
type NodePool struct { Name string `json:"-" yaml:"-" mapstructure:"name"` Count int `json:"count" yaml:"count" mapstructure:"count"` TemplateName string `json:"template_name,omitempty" yaml:"template_name,omitempty" mapstructure:"template_name"` CPUs int `json:"cpus,omitempty" yaml:"cpus,omitempty" mapstructure:"cpus"` Memory int `json:"memory,omitempty" yaml:"memory,omitempty" mapstructure:"memory"` RootVolSize int `json:"root_vol_size,omitempty" yaml:"root_vol_size,omitempty" mapstructure:"root_vol_size"` LinkedClone bool `json:"linked_clone,omitempty" yaml:"linked_clone,omitempty" mapstructure:"linked_clone"` KubeletNodeLabels []string `json:"kubelet_node_labels,omitempty" yaml:"kubelet_node_labels,omitempty" mapstructure:"kubelet_node_labels"` KubeletNodeTaints []string `json:"kubelet_node_taints,omitempty" yaml:"kubelet_node_taints,omitempty" mapstructure:"kubelet_node_taints"` }
NodePool defines the settings for group of instances on vSphere
type Platform ¶
type Platform struct {
// contains filtered or unexported fields
}
Platform implements the Provisioner interface for vSphere
func CreateFrom ¶
func CreateFrom(clusterName string, config map[interface{}]interface{}, credentials []string, ui *ui.UI, version string) *Platform
CreateFrom creates a new Plaftorm with the given configuration for vSphere
func New ¶
func New(clusterName string, envConfig map[string]string, ui *ui.UI, version string) (*Platform, error)
New creates a new Plaform with the given environment configuration
func (*Platform) Apply ¶
Apply apply the changes either to create or destroy the cluster on this platform
func (*Platform) BeProvisioner ¶
func (p *Platform) BeProvisioner(state *terraformer.State) error
BeProvisioner setup the Plaftorm to be a Provisioner
func (*Platform) Config ¶
func (p *Platform) Config() interface{}
Config returns the default configuration for vSphere
func (*Platform) Credentials ¶
Credentials is to assign the credentials to the configuration
func (*Platform) GetPrivateKey ¶
GetPrivateKey returns the private key and file from the configuration, also if this platform requires a private key for provisioning
func (*Platform) GetPublicKey ¶
GetPublicKey return the public key and file from the configuration, also if this platform requires a public key for provisioning
func (*Platform) LoadState ¶
LoadState loads the given Terraform state in a buffer into the terraformer state
func (*Platform) MergeWithEnv ¶
MergeWithEnv implements the MergeWithEnv method from the interfase Provisioner. It merges the environment variables with the existing configuration
func (*Platform) Plan ¶
func (p *Platform) Plan(destroy bool) (plan *terraformer.Plan, err error)
Plan do the planning of the changes either to create or destroy the cluster on this platform.
func (*Platform) PrivateKey ¶
PrivateKey sets the private key and file in the configuration
func (*Platform) PublicKey ¶
PublicKey sets the public key and file in the configuration and variables
func (*Platform) State ¶
func (p *Platform) State() *terraformer.State
State returns the current Terraform state of the cluster