steps

package
v2.0.0-beta.13+incompa... Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 License: Apache-2.0 Imports: 13 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          string `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 CertificatesConfig

type CertificatesConfig struct {
	KubernetesConfigDir string `json:"kubernetesConfigDir"`
	PublicIP            string `json:"publicIp"`
	PrivateIP           string `json:"privateIp"`
	IsMaster            bool   `json:"isMaster"`

	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 {
	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"`
	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"`
	SshConfig          SshConfig          `json:"sshConfig"`
	PrometheusConfig   PrometheusConfig   `json:"prometheusConfig"`

	ClusterCheckConfig ClusterCheckConfig `json:"clusterCheckConfig"`

	Node             node.Node     `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 (*Config) AddMaster

func (c *Config) AddMaster(n *node.Node)

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 *node.Node)

AddNode to map of nodes in cluster

func (*Config) GetMaster

func (c *Config) GetMaster() *node.Node

GetMaster returns first master in master map or nil

func (*Config) GetMasters

func (c *Config) GetMasters() map[string]*node.Node

func (*Config) GetNode

func (c *Config) GetNode() *node.Node

GetMaster returns first master in master map or nil

func (*Config) GetNodes

func (c *Config) GetNodes() map[string]*node.Node

func (*Config) KubeStateChan

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

func (*Config) NodeChan

func (c *Config) NodeChan() chan node.Node

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 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 {
	PrivateKey       string `json:"privateKey"`
	ImageFamily      string `json:"imageFamily"`
	ProjectID        string `json:"projectId"`
	Region           string `json:"region"`
	AvailabilityZone string `json:"availabilityZone"`
	Size             string `json:"size"`
	InstanceGroup    string `json:"instanceGroup"`
	ClientEmail      string `json:"clientEmail"`
	TokenURI         string `json:"tokenURI"`
	AuthURI          string `json:"authURI"`
}

type KubeletConfig

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

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"`
	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]*node.Node) 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 SshConfig

type SshConfig struct {
	User                string `json:"user"`
	Port                string `json:"port"`
	BootstrapPrivateKey string `json:"bootstrapPrivateKey"`
	BootstrapPublicKey  string `json:"bootstrapPublicKey"`
	PublicKey           string `json:"publicKey"`
	Timeout             int    `json:"timeout"`
}

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