Documentation ¶
Overview ¶
Package install provides the functionality for installing a Kismatic cluster.
Index ¶
- Variables
- func DetectNodeUpgradeSafety(plan Plan, node Node, kubeClient upgradeKubeInfoClient) []error
- func GenerateKubeconfig(p *Plan, generatedAssetsDir string) error
- func IsGreaterOrEqualThanVersion(this semver.Version, that string) bool
- func IsLessThanVersion(this semver.Version, that string) bool
- func IsOlderVersion(that semver.Version) bool
- func RegenerateKubeconfig(p *Plan, generatedAssetsDir string) (bool, error)
- func SetVersion(v string)
- func ValidateCertificates(p *Plan, pki *LocalPKI) (bool, []error)
- func ValidateNode(node *Node) (bool, []error)
- func ValidatePlan(p *Plan) (bool, []error)
- func ValidatePlanSSHConnections(p *Plan) (bool, []error)
- func ValidateSSHConnection(con *SSHConnection, prefix string) (bool, []error)
- func ValidateStorageVolume(sv StorageVolume) (bool, []error)
- func WritePlanTemplate(p *Plan, w PlanReadWriter) error
- type APIServerOptions
- type AddOns
- type CNI
- type CNIOptions
- type CalicoOptions
- type CertsConfig
- type Cluster
- type ClusterVersion
- type ConfigOptions
- type DNS
- type Dashboard
- type DeprecatedPackageManager
- type DiagnosticsExecutor
- type Docker
- type DockerRegistry
- type DockerStorage
- type DockerStorageDirectLVM
- type Executor
- type ExecutorOptions
- type Features
- type FilePlanner
- type Heapster
- type HeapsterMonitoring
- type HeapsterOptions
- type InfluxDB
- type ListableNode
- type LocalPKI
- func (lp *LocalPKI) CertificateAuthorityExists() (bool, error)
- func (lp *LocalPKI) GenerateCertificate(name string, validityPeriod string, commonName string, ...) (bool, error)
- func (lp *LocalPKI) GenerateClusterCA(p *Plan) (*tls.CA, error)
- func (lp *LocalPKI) GenerateClusterCertificates(p *Plan, ca *tls.CA) error
- func (lp *LocalPKI) GenerateNodeCertificate(plan *Plan, node Node, ca *tls.CA) error
- func (lp *LocalPKI) GetClusterCA() (*tls.CA, error)
- func (lp *LocalPKI) NodeCertificateExists(node Node) (bool, error)
- func (lp *LocalPKI) ValidateClusterCertificates(p *Plan) (warns []error, errs []error)
- type MasterNodeGroup
- type NFS
- type NFSVolume
- type NetworkConfig
- type Node
- type NodeGroup
- type OptionalNodeGroup
- type PKI
- type PackageManager
- type Plan
- func (p Plan) DockerRegistryAddress() string
- func (p Plan) DockerRegistryPort() string
- func (p *Plan) GetRolesForIP(ip string) []string
- func (p *Plan) GetSSHClient(host string) (ssh.Client, error)
- func (p *Plan) GetSSHConnection(host string) (*SSHConnection, error)
- func (p *Plan) GetUniqueNodes() []Node
- func (p Plan) NetworkConfigured() bool
- type PlanReadWriter
- type Planner
- type PreFlightExecutor
- type SSHConfig
- type SSHConnection
- type StorageVolume
Constants ¶
This section is empty.
Variables ¶
var KismaticVersion semver.Version
KismaticVersion contains the version information of the currently running binary
Functions ¶
func DetectNodeUpgradeSafety ¶ added in v1.3.0
DetectNodeUpgradeSafety determines whether it's safe to upgrade a specific node listed in the plan file. If any condition that could result in data or availability loss is detected, the upgrade is deemed unsafe, and the conditions are returned as errors.
func GenerateKubeconfig ¶
GenerateKubeconfig generate a kubeconfig file for a specific user
func IsGreaterOrEqualThanVersion ¶ added in v1.3.0
IsGreaterOrEqualThanVersion parses the version from a string and returns true if this version is greater or equal than that version
func IsLessThanVersion ¶ added in v1.3.1
IsLessThanVersion parses the version from a string and returns true if this version is less than that version
func IsOlderVersion ¶ added in v1.3.0
IsOlderVersion returns true if the provided version is older than the current Kismatic version
func RegenerateKubeconfig ¶ added in v1.4.0
RegenerateKubeconfig backs up the old kubeconfig file if it exists. Returns true if the new kubeconfig file is different than the previous one. Otherwise returns false.
func SetVersion ¶ added in v1.3.0
func SetVersion(v string)
SetVersion parses the given version, and sets it as the global version of the binary
func ValidateCertificates ¶ added in v1.2.0
ValidateCertificates checks if certificates exist and are valid
func ValidateNode ¶
ValidateNode runs validation against the given node.
func ValidatePlan ¶
ValidatePlan runs validation against the installation plan to ensure that the plan contains valid user input. Returns true, nil if the validation is successful. Otherwise, returns false and a collection of validation errors.
func ValidatePlanSSHConnections ¶ added in v1.2.0
ValidatePlanSSHConnections tries to establish SSH connections to all nodes in the cluster
func ValidateSSHConnection ¶ added in v1.1.0
func ValidateSSHConnection(con *SSHConnection, prefix string) (bool, []error)
ValidateSSHConnection tries to establish SSH connection with the details provieded for a single node
func ValidateStorageVolume ¶ added in v1.2.0
func ValidateStorageVolume(sv StorageVolume) (bool, []error)
ValidateStorageVolume validates the storage volume attributes
func WritePlanTemplate ¶
func WritePlanTemplate(p *Plan, w PlanReadWriter) error
WritePlanTemplate writes an installation plan with pre-filled defaults.
Types ¶
type APIServerOptions ¶ added in v1.4.0
type AddOns ¶ added in v1.4.0
type AddOns struct { CNI *CNI `yaml:"cni"` DNS DNS `yaml:"dns"` HeapsterMonitoring *HeapsterMonitoring `yaml:"heapster"` Dashboard *Dashboard `yaml:"dashboard"` DashboardDeprecated *Dashboard `yaml:"dashbard,omitempty"` PackageManager PackageManager `yaml:"package_manager"` }
type CNI ¶ added in v1.5.0
type CNI struct { Disable bool Provider string Options CNIOptions `yaml:"options"` }
type CNIOptions ¶ added in v1.5.0
type CNIOptions struct {
Calico CalicoOptions
}
type CalicoOptions ¶ added in v1.5.0
type CalicoOptions struct {
Mode string
}
type CertsConfig ¶
CertsConfig describes the cluster's trust and certificate configuration
type Cluster ¶
type Cluster struct { Name string AdminPassword string `yaml:"admin_password"` DisablePackageInstallation bool `yaml:"disable_package_installation"` AllowPackageInstallation *bool `yaml:"allow_package_installation,omitempty"` PackageRepoURLs string `yaml:"package_repository_urls"` DisconnectedInstallation bool `yaml:"disconnected_installation"` DisableRegistrySeeding bool `yaml:"disable_registry_seeding"` Networking NetworkConfig Certificates CertsConfig SSH SSHConfig APIServerOptions APIServerOptions `yaml:"kube_apiserver"` }
Cluster describes a Kubernetes cluster
type ClusterVersion ¶ added in v1.3.0
type ClusterVersion struct { EarliestVersion semver.Version LatestVersion semver.Version IsTransitioning bool Nodes []ListableNode }
ClusterVersion contains version information about the cluster
func ListVersions ¶ added in v1.3.0
func ListVersions(plan *Plan) (ClusterVersion, error)
ListVersions connects to the cluster described in the plan file and gathers version information about it.
type ConfigOptions ¶
type ConfigOptions struct { CA string Server string Cluster string User string Context string Cert string Key string }
ConfigOptions sds
type DeprecatedPackageManager ¶ added in v1.4.0
type DeprecatedPackageManager struct {
Enabled bool
}
type DiagnosticsExecutor ¶ added in v1.3.0
DiagnosticsExecutor will run diagnostics on the nodes after an install
func NewDiagnosticsExecutor ¶ added in v1.3.0
func NewDiagnosticsExecutor(stdout io.Writer, errOut io.Writer, options ExecutorOptions) (DiagnosticsExecutor, error)
NewDiagnosticsExecutor returns an executor for running preflight
type Docker ¶ added in v1.3.1
type Docker struct { // Storage includes the storage-specific configuration for docker Storage DockerStorage }
Docker includes the configuration for the docker installation owned by KET.
type DockerRegistry ¶
type DockerRegistry struct { SetupInternal bool `yaml:"setup_internal"` Address string Port int CAPath string `yaml:"CA"` }
DockerRegistry details for docker registry, either confgiured by the cli or customer provided
func (DockerRegistry) ConfigureDockerWithPrivateRegistry ¶ added in v1.4.0
func (r DockerRegistry) ConfigureDockerWithPrivateRegistry() bool
ConfigureDockerWithPrivateRegistry returns true when confgiuring an external or on cluster registry is required
type DockerStorage ¶ added in v1.3.1
type DockerStorage struct { // DirectLVM is the configuration required for setting up device mapper in direct-lvm mode DirectLVM DockerStorageDirectLVM `yaml:"direct_lvm"` }
DockerStorage includes the storage-specific configuration for docker.
type DockerStorageDirectLVM ¶ added in v1.3.1
type DockerStorageDirectLVM struct { // Determines whether direct-lvm mode is enabled Enabled bool // BlockDevice is the path to the block device that will be used. E.g. /dev/sdb BlockDevice string `yaml:"block_device"` // EnableDeferredDeletion determines whether deferred deletion should be enabled EnableDeferredDeletion bool `yaml:"enable_deferred_deletion"` }
DockerStorageDirectLVM includes the configuration required for setting up device mapper in direct-lvm mode
type Executor ¶
type Executor interface { PreFlightExecutor Install(p *Plan) error GenerateCertificates(p *Plan, useExistingCA bool) error RunSmokeTest(*Plan) error AddWorker(*Plan, Node) (*Plan, error) RunPlay(string, *Plan) error AddVolume(*Plan, StorageVolume) error UpgradeEtcd2Nodes(plan Plan, nodesToUpgrade []ListableNode) error UpgradeNodes(plan Plan, nodesToUpgrade []ListableNode, onlineUpgrade bool, maxParallelWorkers int) error ValidateControlPlane(plan Plan) error UpgradeDockerRegistry(plan Plan) error UpgradeClusterServices(plan Plan) error MigrateEtcdCluster(plan Plan) error }
The Executor will carry out the installation plan
func NewExecutor ¶
NewExecutor returns an executor for performing installations according to the installation plan.
type ExecutorOptions ¶
type ExecutorOptions struct { // GeneratedAssetsDirectory is the location where generated assets // are to be stored GeneratedAssetsDirectory string // RestartServices determines whether the cluster services should be // restarted during the installation. RestartServices bool // OutputFormat sets the format of the executor OutputFormat string // Verbose output from the executor Verbose bool // RunsDirectory is where information about installation runs is kept RunsDirectory string // DiagnosticsDirecty is where the doDiagnostics information about the cluster will be dumped DiagnosticsDirecty string // DryRun determines if the executor should actually run the task DryRun bool }
ExecutorOptions are used to configure the executor
type Features ¶ added in v1.3.3
type Features struct {
PackageManager *DeprecatedPackageManager `yaml:"package_manager,omitempty"`
}
Features is deprecated, required to support KET v1.3.3 When writing out a new plan file, this will be nil and will not appear
type FilePlanner ¶
type FilePlanner struct {
File string
}
FilePlanner is a file-based installation planner
func (*FilePlanner) PlanExists ¶
func (fp *FilePlanner) PlanExists() bool
PlanExists return true if the plan exists on the file system
func (*FilePlanner) Read ¶
func (fp *FilePlanner) Read() (*Plan, error)
Read the plan from the file system
func (*FilePlanner) Write ¶
func (fp *FilePlanner) Write(p *Plan) error
Write the plan to the file system
type HeapsterMonitoring ¶ added in v1.4.0
type HeapsterMonitoring struct { Disable bool Options HeapsterOptions `yaml:"options"` }
type HeapsterOptions ¶ added in v1.4.0
type ListableNode ¶ added in v1.3.0
ListableNode contains version and role information about a given node
func NodesWithRoles ¶ added in v1.3.0
func NodesWithRoles(nodes []ListableNode, roles ...string) []ListableNode
NodesWithRoles returns a filtered list of ListableNode slice based on the node's roles
func (*ListableNode) HasRoles ¶ added in v1.3.0
func (n *ListableNode) HasRoles(roles ...string) bool
HasRoles returns true if contains any of the roles
type LocalPKI ¶
LocalPKI is a file-based PKI
func (*LocalPKI) CertificateAuthorityExists ¶
CertificateAuthorityExists returns true if the CA for the cluster exists
func (*LocalPKI) GenerateCertificate ¶ added in v1.5.0
func (lp *LocalPKI) GenerateCertificate(name string, validityPeriod string, commonName string, subjectAlternateNames []string, organizations []string, ca *tls.CA, overwrite bool) (bool, error)
GenerateCertificate creates a private key and certificate for the given name, CN, subjectAlternateNames and organizations If cert exists, will not fail Pass overwrite to replace an existing cert
func (*LocalPKI) GenerateClusterCA ¶
GenerateClusterCA creates a Certificate Authority for the cluster
func (*LocalPKI) GenerateClusterCertificates ¶
GenerateClusterCertificates creates all certificates required for the cluster described in the plan file.
func (*LocalPKI) GenerateNodeCertificate ¶
GenerateNodeCertificate creates a private key and certificate for the given node
func (*LocalPKI) GetClusterCA ¶
GetClusterCA returns the cluster CA
func (*LocalPKI) NodeCertificateExists ¶
NodeCertificateExists returns true if the node's key and certificate exist
type MasterNodeGroup ¶
type MasterNodeGroup struct { ExpectedCount int `yaml:"expected_count"` LoadBalancedFQDN string `yaml:"load_balanced_fqdn"` LoadBalancedShortName string `yaml:"load_balanced_short_name"` Nodes []Node }
MasterNodeGroup is the collection of master nodes
type NetworkConfig ¶
type NetworkConfig struct { Type string `yaml:"type,omitempty"` PodCIDRBlock string `yaml:"pod_cidr_block"` ServiceCIDRBlock string `yaml:"service_cidr_block"` UpdateHostsFiles bool `yaml:"update_hosts_files"` HTTPProxy string `yaml:"http_proxy"` HTTPSProxy string `yaml:"https_proxy"` NoProxy string `yaml:"no_proxy"` }
NetworkConfig describes the cluster's networking configuration
type OptionalNodeGroup ¶ added in v1.1.0
type OptionalNodeGroup NodeGroup
An OptionalNodeGroup is a collection of nodes that can be empty
type PKI ¶
type PKI interface { CertificateAuthorityExists() (bool, error) NodeCertificateExists(node Node) (bool, error) GenerateNodeCertificate(plan *Plan, node Node, ca *tls.CA) error GetClusterCA() (*tls.CA, error) GenerateClusterCA(p *Plan) (*tls.CA, error) GenerateClusterCertificates(p *Plan, ca *tls.CA) error GenerateCertificate(name string, validityPeriod string, commonName string, subjectAlternateNames []string, organizations []string, ca *tls.CA, overwrite bool) (bool, error) }
The PKI provides a way for generating certificates for the cluster described by the Plan
type PackageManager ¶ added in v1.3.3
type Plan ¶
type Plan struct { Cluster Cluster Docker Docker DockerRegistry DockerRegistry `yaml:"docker_registry"` AddOns AddOns `yaml:"add_ons"` Features *Features `yaml:"features,omitempty"` Etcd NodeGroup Master MasterNodeGroup Worker NodeGroup Ingress OptionalNodeGroup Storage OptionalNodeGroup NFS NFS }
Plan is the installation plan that the user intends to execute
func (Plan) DockerRegistryAddress ¶ added in v1.3.3
func (Plan) DockerRegistryPort ¶ added in v1.3.3
func (*Plan) GetRolesForIP ¶ added in v1.3.0
func (*Plan) GetSSHClient ¶ added in v1.2.1
GetSSHClient is a convience method that calls GetSSHConnection and returns an SSH client with the result
func (*Plan) GetSSHConnection ¶ added in v1.2.0
func (p *Plan) GetSSHConnection(host string) (*SSHConnection, error)
GetSSHConnection returns the SSHConnection struct containing the node and SSHConfig details
func (*Plan) GetUniqueNodes ¶ added in v1.3.0
GetUniqueNodes returns a list of the unique nodes that are listed in the plan file. That is, if a node has multiple roles, it will only appear once in the list.
func (Plan) NetworkConfigured ¶ added in v1.5.0
NetworkConfigured returns true if pod validation/smoketest should run
type PlanReadWriter ¶
PlanReadWriter is capable of reading/writing a Plan
type Planner ¶
type Planner interface { PlanReadWriter PlanExists() bool }
Planner is used to plan the installation
type PreFlightExecutor ¶
type PreFlightExecutor interface { RunPreFlightCheck(*Plan) error RunNewWorkerPreFlightCheck(Plan, Node) error RunUpgradePreFlightCheck(*Plan, ListableNode) error }
The PreFlightExecutor will run pre-flight checks against the environment defined in the plan file
func NewPreFlightExecutor ¶
func NewPreFlightExecutor(stdout io.Writer, errOut io.Writer, options ExecutorOptions) (PreFlightExecutor, error)
NewPreFlightExecutor returns an executor for running preflight
type SSHConnection ¶ added in v1.1.0
type StorageVolume ¶ added in v1.2.0
type StorageVolume struct { // Name of the storage volume Name string // SizeGB is the size of the volume, in gigabytes SizeGB int // ReplicateCount is the number of replicas ReplicateCount int // DistributionCount is the degree to which data will be distributed across the cluster DistributionCount int // StorageClass is the annotation that will be used when creating the persistent-volume in kubernetes StorageClass string // AllowAddresses is a list of address wildcards that have access to the volume AllowAddresses []string // ReclaimPolicy is the persistent volume's reclaim policy // ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reclaim-policy ReclaimPolicy string // AccessModes supported by the persistent volume // ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes AccessModes []string }
StorageVolume managed by Kismatic
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package explain contains explainers that are used for processing an incoming stream, and explaining the events that are found in it.
|
Package explain contains explainers that are used for processing an incoming stream, and explaining the events that are found in it. |