os

package
v0.8.2-beta.2 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: Apache-2.0 Imports: 42 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SeedNodePlanName = "seed-node-standard-plan"
	ConfigDestDir    = "/etc/pki/weaveworks/wksctl"
	PemDestDir       = "/etc/pki/weaveworks/wksctl/pem"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControllerParams

type ControllerParams struct {
	// ImageOverride will override the WKS controller image if set. It will do so
	// whether the controller manifest comes from a git repository or is the
	// built-in one.
	ImageOverride string
	// ImageBuiltin is the WKS controller image to use when generating the WKS
	// controller manifest from in-memory data.
	ImageBuiltin string
}

ControllerParams are all SeedNodeParams related to the WKS controller

type GitParams

type GitParams struct {
	GitURL           string
	GitBranch        string
	GitPath          string
	GitDeployKeyPath string
}

GitParams are all SeedNodeParams related to the user's Git(Hub) repo

type Identifiers

type Identifiers struct {
	MachineID  string
	SystemUUID string
}

Identifiers groups the various pieces of data usable to uniquely identify a machine in a cluster.

type NodeParams

type NodeParams struct {
	IsMaster                 bool // true if this node is a master, false else.
	MasterIP                 string
	MasterPort               int
	Token                    string // kubeadm's --token
	DiscoveryTokenCaCertHash string // kubeadm's --discovery-token-ca-cert-hash
	CertificateKey           string // kubeadm's --certificate-key
	KubeletConfig            config.KubeletConfig
	KubernetesVersion        string
	CRI                      baremetalspecv1.ContainerRuntime
	ConfigFileSpecs          []baremetalspecv1.FileSpec
	ProviderConfigMaps       map[string]*v1.ConfigMap
	AuthConfigMap            *v1.ConfigMap
	Namespace                string
	ExternalLoadBalancer     string // used instead of MasterIP if existed
	AddonNamespaces          map[string]string
}

NodeParams groups required inputs to configure a Kubernetes node.

func (NodeParams) Validate

func (params NodeParams) Validate() error

Validate generally validates this NodeParams struct, e.g. ensures it contains mandatory values, that these are well-formed, etc.

type OS

type OS struct {
	Name string

	PkgType resource.PkgType
	// contains filtered or unexported fields
}

OS represents an operating system and exposes the operations required to install Kubernetes on a machine setup with that OS.

func Identify

func Identify(sshClient *ssh.Client) (*OS, error)

Identify uses the provided SSH client to identify the operating system of the machine it is configured to talk to.

func (OS) CreateNodeSetupPlan

func (o OS) CreateNodeSetupPlan(params NodeParams) (*plan.Plan, error)

CreateNodeSetupPlan creates the plan that will be used to set up a node.

func (OS) CreateSeedNodeSetupPlan

func (o OS) CreateSeedNodeSetupPlan(params SeedNodeParams) (*plan.Plan, error)

CreateSeedNodeSetupPlan constructs the seed node plan used to setup the initial node prior to turning control over to wks-controller

func (OS) IDs

func (o OS) IDs() (*Identifiers, error)

IDs returns this machine's ID (see also OS#GetMachineID) and system UUID (see also: OS#GetSystemUUID).

func (OS) SetupNode

func (o OS) SetupNode(p *plan.Plan) error

SetupNode installs Kubernetes on this machine and configures it based on the manifests stored during the initialization of the cluster, when SetupSeedNode was called.

func (OS) SetupSeedNode

func (o OS) SetupSeedNode(params SeedNodeParams) error

SetupSeedNode installs Kubernetes on this machine, and store the provided manifests in the API server, so that the rest of the cluster can then be set up by the WKS controller.

type SeedNodeParams

type SeedNodeParams struct {
	PublicIP             string
	PrivateIP            string
	ClusterManifestPath  string
	MachinesManifestPath string
	SSHKeyPath           string
	// BootstrapToken is the token used by kubeadm init and kubeadm join
	// to safely form new clusters.
	BootstrapToken       *kubeadmapi.BootstrapTokenString
	KubeletConfig        config.KubeletConfig
	Controller           ControllerParams
	GitData              GitParams
	SealedSecretKeyPath  string
	SealedSecretCertPath string
	ConfigDirectory      string
	Namespace            string
	ImageRepository      string
	ExternalLoadBalancer string
	AdditionalSANs       []string
	AddonNamespaces      map[string]string
}

SeedNodeParams groups required inputs to configure a "seed" Kubernetes node.

func (SeedNodeParams) GetAddonNamespace

func (params SeedNodeParams) GetAddonNamespace(name string) string

func (SeedNodeParams) Validate

func (params SeedNodeParams) Validate() error

Validate generally validates this SeedNodeParams struct, e.g. ensures it contains mandatory values, that these are well-formed, etc.

Jump to

Keyboard shortcuts

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