steps

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 14 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterStep

func RegisterStep(stepName string, step Step)

func RunTemplate

func RunTemplate(ctx context.Context, tpl *template.Template, r runner.Runner, output io.Writer, cfg interface{}) error

Types

type AWSConfig

type AWSConfig struct {
	KeyID                  string `json:"access_key"`
	Secret                 string `json:"secret_key"`
	Region                 string `json:"region"`
	AvailabilityZone       string `json:"availabilityZone"`
	KeyPairName            string `json:"keyPairName"`
	VPCID                  string `json:"vpcid"`
	VPCCIDR                string `json:"vpccidr"`
	RouteTableID           string `json:"routeTableId"`
	InternetGatewayID      string `json:"internetGatewayId"`
	NodesSecurityGroupID   string `json:"nodesSecurityGroupID"`
	MastersSecurityGroupID string `json:"mastersSecurityGroupID"`
	MastersInstanceProfile string `json:"mastersInstanceProfile"`
	NodesInstanceProfile   string `json:"nodesInstanceProfile"`
	VolumeSize             string `json:"volumeSize"`
	EbsOptimized           string `json:"ebsOptimized"`
	ImageID                string `json:"image"`
	InstanceType           string `json:"size"`
	HasPublicAddr          bool   `json:"hasPublicAddr"`
	// Map of availability zone to subnet
	Subnets map[string]string `json:"subnets"`
	// Map az to route table association
	RouteTableAssociationIDs map[string]string `json:"routeTableAssociationIds"`
}

type AzureConfig

type AzureConfig struct {
	ClientID       string `json:"clientId"`
	ClientSecret   string `json:"clientSecret"`
	TenantID       string `json:"tenantId"`
	SubscriptionID string `json:"subscriptionId"`

	Location string `json:location`
}

type CertificatesConfig

type CertificatesConfig struct {
	KubernetesConfigDir string `json:"kubernetesConfigDir"`
	PublicIP            string `json:"publicIp"`
	PrivateIP           string `json:"privateIp"`
	IsMaster            bool   `json:"isMaster"`
	// TODO: this shouldn't be a part of SANs
	// https://kubernetes.io/docs/setup/certificates/#all-certificates
	KubernetesSvcIP string `json:"kubernetesSvcIp"`

	StaticAuth profile.StaticAuth `json:"staticAuth"`

	// DEPRECATED: it's a part of staticAuth
	Username string
	// DEPRECATED: it's a part of staticAuth
	Password string

	AdminCert string `json:"adminCert"`
	AdminKey  string `json:"adminKey"`

	ParenCert []byte `json:"parenCert"`
	CACert    string `json:"caCert"`
	CAKey     string `json:"caKey"`
}

type ClusterCheckConfig

type ClusterCheckConfig struct {
	MachineCount int
}

type Config

type Config struct {
	Kube model.Kube `json:"kube"`

	TaskID                 string
	Provider               clouds.Name  `json:"provider"`
	IsMaster               bool         `json:"isMaster"`
	ClusterID              string       `json:"clusterId"`
	ClusterName            string       `json:"clusterName"`
	LogBootstrapPrivateKey bool         `json:"logBootstrapPrivateKey"`
	DigitalOceanConfig     DOConfig     `json:"digitalOceanConfig"`
	AWSConfig              AWSConfig    `json:"awsConfig"`
	GCEConfig              GCEConfig    `json:"gceConfig"`
	AzureConfig            AzureConfig  `json:"azureConfig"`
	OSConfig               OSConfig     `json:"osConfig"`
	PacketConfig           PacketConfig `json:"packetConfig"`

	DockerConfig       DockerConfig       `json:"dockerConfig"`
	DownloadK8sBinary  DownloadK8sBinary  `json:"downloadK8sBinary"`
	CertificatesConfig CertificatesConfig `json:"certificatesConfig"`
	FlannelConfig      FlannelConfig      `json:"flannelConfig"`
	NetworkConfig      NetworkConfig      `json:"networkConfig"`
	KubeletConfig      KubeletConfig      `json:"kubeletConfig"`
	ManifestConfig     ManifestConfig     `json:"manifestConfig"`
	PostStartConfig    PostStartConfig    `json:"postStartConfig"`
	TillerConfig       TillerConfig       `json:"tillerConfig"`
	EtcdConfig         EtcdConfig         `json:"etcdConfig"`
	PrometheusConfig   PrometheusConfig   `json:"prometheusConfig"`
	DrainConfig        DrainConfig        `json:"drainConfig"`

	ClusterCheckConfig ClusterCheckConfig `json:"clusterCheckConfig"`

	Node             model.Machine `json:"node"`
	CloudAccountID   string        `json:"cloudAccountId" valid:"required, length(1|32)"`
	CloudAccountName string        `json:"cloudAccountName" valid:"required, length(1|32)"`
	Timeout          time.Duration `json:"timeout"`
	Runner           runner.Runner `json:"-"`

	Masters Map `json:"masters"`

	Nodes Map `json:"nodes"`

	ReadyForBootstrapLatch *sync.WaitGroup
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(clusterName, clusterToken, cloudAccountName string, profile profile.Profile) *Config

NewConfig builds instance of config for provisioning

func NewConfigFromKube

func NewConfigFromKube(profile *profile.Profile, k *model.Kube) *Config

func (*Config) AddMaster

func (c *Config) AddMaster(n *model.Machine)

AddMaster to map of master, map is used because it is reference and can be shared among goroutines that run multiple tasks of cluster deployment

func (*Config) AddNode

func (c *Config) AddNode(n *model.Machine)

AddNode to map of nodes in cluster

func (*Config) ConfigChan

func (c *Config) ConfigChan() chan *Config

func (*Config) GetMaster

func (c *Config) GetMaster() *model.Machine

GetMaster returns first master in master map or nil

func (*Config) GetMasters

func (c *Config) GetMasters() map[string]*model.Machine

func (*Config) GetNode

func (c *Config) GetNode() *model.Machine

GetMaster returns first master in master map or nil

func (*Config) GetNodes

func (c *Config) GetNodes() map[string]*model.Machine

func (*Config) KubeStateChan

func (c *Config) KubeStateChan() chan model.KubeState

func (*Config) NodeChan

func (c *Config) NodeChan() chan model.Machine

func (*Config) SetConfigChan

func (c *Config) SetConfigChan(configChan chan *Config)

func (*Config) SetKubeStateChan

func (c *Config) SetKubeStateChan(kubeStateChan chan model.KubeState)

func (*Config) SetNodeChan

func (c *Config) SetNodeChan(nodeChan chan model.Machine)

type DOConfig

type DOConfig struct {
	Name string `json:"name" valid:"required"`
	// These come from UI select
	Region string `json:"region" valid:"required"`
	Size   string `json:"size" valid:"required"`
	Image  string `json:"image" valid:"required"`

	// These come from cloud account
	Fingerprint string `json:"fingerprint" valid:"required"`
	AccessToken string `json:"accessToken" valid:"required"`
}

type DockerConfig

type DockerConfig struct {
	Version        string `json:"version"`
	ReleaseVersion string `json:"releaseVersion"`
	Arch           string `json:"arch"`
}

type DownloadK8sBinary

type DownloadK8sBinary struct {
	K8SVersion      string `json:"k8sVersion"`
	Arch            string `json:"arch"`
	OperatingSystem string `json:"operatingSystem"`
}

type DrainConfig

type DrainConfig struct {
	PrivateIP string `json:"privateIp"`
}

type EtcdConfig

type EtcdConfig struct {
	Name           string        `json:"name"`
	Version        string        `json:"version"`
	AdvertiseHost  string        `json:"advertiseHost"`
	Host           string        `json:"host"`
	DataDir        string        `json:"dataDir"`
	ServicePort    string        `json:"servicePort"`
	ManagementPort string        `json:"managementPort"`
	Timeout        time.Duration `json:"timeout"`
	StartTimeout   string        `json:"startTimeout"`
	RestartTimeout string        `json:"restartTimeout"`
	ClusterToken   string        `json:"clusterToken"`
}

type FlannelConfig

type FlannelConfig struct {
	IsMaster bool   `json:"isMaster"`
	Arch     string `json:"arch"`
	Version  string `json:"version"`
	EtcdHost string `json:"etcdHost"`
}

type GCEConfig

type GCEConfig struct {
	// NOTE(stgleb): This comes from cloud account
	PrivateKey  string `json:"private_key"`
	ClientEmail string `json:"client_email"`
	TokenURI    string `json:"token_uri"`
	ProjectID   string `json:"project_id"`

	// This comes from profile
	ImageFamily      string `json:"imageFamily"`
	Region           string `json:"region"`
	AvailabilityZone string `json:"availabilityZone"`
	Size             string `json:"size"`
	InstanceGroup    string `json:"instanceGroup"`
}

type KubeletConfig

type KubeletConfig struct {
	IsMaster       bool   `json:"isMaster"`
	NodeLabels     string `json:"nodeLabels"`
	ProxyPort      string `json:"proxyPort"`
	K8SVersion     string `json:"k8sVersion"`
	ProviderString string `json:"ProviderString"`
	ClusterDNSIP   string `json:"clusterDNSip"`
}

type ManifestConfig

type ManifestConfig struct {
	IsMaster            bool   `json:"isMaster"`
	K8SVersion          string `json:"k8sVersion"`
	KubernetesConfigDir string `json:"kubernetesConfigDir"`
	RBACEnabled         bool   `json:"rbacEnabled"`
	ProviderString      string `json:"ProviderString"`
	ServicesCIDR        string `json:"servicesCIDR"`
	ClusterDNSIP        string `json:"clusterDNSIp"`
	MasterHost          string `json:"masterHost"`
	MasterPort          string `json:"masterPort"`
	Password            string `json:"password"`
}

type Map

type Map struct {
	// contains filtered or unexported fields
}

func NewMap

func NewMap(m map[string]*model.Machine) Map

func (*Map) MarshalJSON

func (m *Map) MarshalJSON() ([]byte, error)

func (*Map) UnmarshalJSON

func (m *Map) UnmarshalJSON(b []byte) error

type NetworkConfig

type NetworkConfig struct {
	EtcdRepositoryUrl string `json:"etcdRepositoryUrl"`
	EtcdVersion       string `json:"etcdVersion"`
	EtcdHost          string `json:"etcdHost"`

	Arch            string `json:"arch"`
	OperatingSystem string `json:"operatingSystem"`

	Network     string `json:"network"`
	NetworkType string `json:"networkType"`
}

type OSConfig

type OSConfig struct{}

type PacketConfig

type PacketConfig struct{}

type PostStartConfig

type PostStartConfig struct {
	IsMaster    bool          `json:"isMaster"`
	Host        string        `json:"host"`
	Port        string        `json:"port"`
	Username    string        `json:"username"`
	RBACEnabled bool          `json:"rbacEnabled"`
	Timeout     time.Duration `json:"timeout"`
}

type PrometheusConfig

type PrometheusConfig struct {
	Port        string `json:"port"`
	RBACEnabled bool   `json:"rbacEnabled"`
}

type Step

type Step interface {
	Run(context.Context, io.Writer, *Config) error
	Name() string
	Description() string
	Depends() []string
	Rollback(context.Context, io.Writer, *Config) error
}

func GetStep

func GetStep(stepName string) Step

type TillerConfig

type TillerConfig struct {
	HelmVersion     string `json:"helmVersion"`
	RBACEnabled     bool   `json:"rbacEnabled"`
	OperatingSystem string `json:"operatingSystem"`
	Arch            string `json:"arch"`
}

Jump to

Keyboard shortcuts

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