Documentation ¶
Overview ¶
Package install provides the functionality for installing a Kismatic cluster.
Index ¶
- func GenerateKubeconfig(p *Plan, generatedAssetsDir string) error
- 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 CertsConfig
- type Cluster
- type ClusterAddressReader
- type ClusterDashboardURLReader
- type ConfigOptions
- type DockerRegistry
- type Executor
- type ExecutorOptions
- type FilePlanner
- type LocalPKI
- func (lp *LocalPKI) CertificateAuthorityExists() (bool, error)
- func (lp *LocalPKI) GenerateClusterCA(p *Plan) (*tls.CA, error)
- func (lp *LocalPKI) GenerateClusterCertificates(p *Plan, ca *tls.CA, users []string) 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, users []string) (warn []error, err []error)
- type MasterNodeGroup
- type NFS
- type NFSVolume
- type NetworkConfig
- type Node
- type NodeGroup
- type OptionalNodeGroup
- type PKI
- type Plan
- type PlanReadWriter
- type Planner
- type PreFlightExecutor
- type SSHConfig
- type SSHConnection
- type StorageVolume
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateKubeconfig ¶
GenerateKubeconfig generate a kubeconfig file for a specific user
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 CertsConfig ¶
type CertsConfig struct {
Expiry string
}
CertsConfig describes the cluster's trust and certificate configuration
type Cluster ¶
type Cluster struct { Name string AdminPassword string `yaml:"admin_password"` AllowPackageInstallation bool `yaml:"allow_package_installation"` Networking NetworkConfig Certificates CertsConfig SSH SSHConfig }
Cluster describes a Kubernetes cluster
type ClusterAddressReader ¶ added in v1.2.0
ClusterAddressReader is capable of returning the cluster address
type ClusterDashboardURLReader ¶ added in v1.2.0
ClusterDashboardURLReader is capable of returning the cluster dashboard URL
type ConfigOptions ¶
type ConfigOptions struct { CA string Server string Cluster string User string Context string Cert string Key string }
ConfigOptions sds
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
type Executor ¶
type Executor interface { PreFlightExecutor Install(p *Plan) error RunSmokeTest(*Plan) error AddWorker(*Plan, Node) (*Plan, error) RunTask(string, *Plan) error AddVolume(*Plan, StorageVolume) 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 { // SkipCAGeneration determines whether the Certificate Authority should // be generated. If false, an existing CA file must exist. SkipCAGeneration bool // 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 }
ExecutorOptions are used to configure the executor
type FilePlanner ¶
type FilePlanner struct {
File string
}
FilePlanner is a file-based installation planner
func (*FilePlanner) GetClusterAddress ¶ added in v1.2.0
func (fp *FilePlanner) GetClusterAddress(p *Plan) (string, error)
GetClusterAddress returns the LoadBalancedFQDN IP of the cluster
func (*FilePlanner) GetDashboardURL ¶ added in v1.2.0
func (fp *FilePlanner) GetDashboardURL(p *Plan) (string, error)
GetDashboardURL returns the dashboard url, reading the plan file LoadBalancedFQDN
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 LocalPKI ¶
type LocalPKI struct { CACsr string CAConfigFile string CASigningProfile string GeneratedCertsDirectory string Log io.Writer }
LocalPKI is a file-based PKI
func (*LocalPKI) CertificateAuthorityExists ¶
CertificateAuthorityExists returns true if the CA for the cluster exists
func (*LocalPKI) GenerateClusterCA ¶
GenerateClusterCA creates a Certificate Authority for the cluster
func (*LocalPKI) GenerateClusterCertificates ¶
GenerateClusterCertificates creates a Certificates for all nodes on the cluster
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 PodCIDRBlock string `yaml:"pod_cidr_block"` ServiceCIDRBlock string `yaml:"service_cidr_block"` PolicyEnabled bool `yaml:"policy_enabled"` UpdateHostsFiles bool `yaml:"update_hosts_files"` }
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, users []string) error }
The PKI provides a way for generating certificates for the cluster described by the Plan
type Plan ¶
type Plan struct { Cluster Cluster DockerRegistry DockerRegistry `yaml:"docker_registry"` 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) 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) GetUniqueNodeIPs ¶ added in v1.2.0
type PlanReadWriter ¶
PlanReadWriter is capable of reading/writing a Plan
type Planner ¶
type Planner interface { PlanReadWriter ClusterAddressReader ClusterDashboardURLReader PlanExists() bool }
Planner is used to plan the installation
type PreFlightExecutor ¶
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 // AllowAddresses is a list of address wildcards that have access to the volume AllowAddresses []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. |