Documentation
¶
Overview ¶
Package installer provides functionality for installing and uninstalling components.
This package defines the Installer interface and provides implementations for installing various Kubernetes components on clusters:
- argocd: ArgoCD GitOps engine installation
- cert-manager: Certificate management installation
- cni: Container Network Interface installers (Cilium, Calico)
- flux: Flux GitOps engine installation
- localpathstorage: Local path storage provisioner
- metrics-server: Kubernetes metrics server
Common utilities:
- Installer interface for consistent installation patterns
- Helm chart deployment helpers
- Readiness polling for installed components
Index ¶
- Constants
- func GetImagesFromInstallers(ctx context.Context, installers map[string]Installer) ([]string, error)
- func GetInstallTimeout(clusterCfg *v1alpha1.Cluster) time.Duration
- type Factory
- type Installer
- type MockInstaller
- type MockInstaller_Expecter
- type MockInstaller_Images_Call
- func (_c *MockInstaller_Images_Call) Return(strings []string, err error) *MockInstaller_Images_Call
- func (_c *MockInstaller_Images_Call) Run(run func(ctx context.Context)) *MockInstaller_Images_Call
- func (_c *MockInstaller_Images_Call) RunAndReturn(run func(ctx context.Context) ([]string, error)) *MockInstaller_Images_Call
- type MockInstaller_Install_Call
- func (_c *MockInstaller_Install_Call) Return(err error) *MockInstaller_Install_Call
- func (_c *MockInstaller_Install_Call) Run(run func(ctx context.Context)) *MockInstaller_Install_Call
- func (_c *MockInstaller_Install_Call) RunAndReturn(run func(ctx context.Context) error) *MockInstaller_Install_Call
- type MockInstaller_Uninstall_Call
- func (_c *MockInstaller_Uninstall_Call) Return(err error) *MockInstaller_Uninstall_Call
- func (_c *MockInstaller_Uninstall_Call) Run(run func(ctx context.Context)) *MockInstaller_Uninstall_Call
- func (_c *MockInstaller_Uninstall_Call) RunAndReturn(run func(ctx context.Context) error) *MockInstaller_Uninstall_Call
Constants ¶
const ( // DefaultInstallTimeout is the default timeout (5 minutes) for component installation. DefaultInstallTimeout = 5 * time.Minute // TalosInstallTimeout is the timeout (5 minutes) for Talos component installation. // Talos clusters take longer to bootstrap due to the immutable OS design. TalosInstallTimeout = 5 * time.Minute // CalicoInstallTimeout is the timeout for Calico CNI installs, which often take longer // due to multiple components needing to become ready (tigera-operator, calico-node // DaemonSet, and calico-kube-controllers Deployment). CalicoInstallTimeout = 10 * time.Minute // KyvernoInstallTimeout is the timeout for Kyverno policy engine installs, which need // extra time for multiple deployments and CRDs to become ready (admission-controller, // background-controller, cleanup-controller, reports-controller, and policy CRDs). KyvernoInstallTimeout = 10 * time.Minute // CertManagerInstallTimeout is the timeout for cert-manager installs, which need // extra time for multiple deployments and webhook configurations to become ready. CertManagerInstallTimeout = 10 * time.Minute // GatekeeperInstallTimeout is the timeout for Gatekeeper policy engine installs, // which need extra time for the webhook and audit controller to become ready. GatekeeperInstallTimeout = 7 * time.Minute // FluxInstallTimeout is the timeout for Flux operator installs, which need // extra time for CRD establishment. On resource-constrained runners (e.g., GitHub Actions), // the Flux operator CRDs can take 7-10 minutes to become fully "Established" in the API server, // even though the operator pod is running. 12 minutes provides sufficient margin for slower // environments while ensuring quick feedback for actual failures. // See: https://github.com/devantler-tech/ksail/issues/2264 FluxInstallTimeout = 12 * time.Minute // ArgoCDInstallTimeout is the timeout for ArgoCD installs, which need // extra time for multiple components to become ready (server, repo-server, // application-controller, and Redis). ArgoCDInstallTimeout = 10 * time.Minute )
Variables ¶
This section is empty.
Functions ¶
func GetImagesFromInstallers ¶ added in v5.29.0
func GetImagesFromInstallers( ctx context.Context, installers map[string]Installer, ) ([]string, error)
GetImagesFromInstallers retrieves container images from all provided installers. Returns a deduplicated list of all images across all installers.
func GetInstallTimeout ¶
GetInstallTimeout determines the timeout for component installation. Uses cluster connection timeout if configured, otherwise defaults to:
- TalosInstallTimeout (5m) for Talos distribution
- DefaultInstallTimeout (5m) for all other distributions
Returns DefaultInstallTimeout if clusterCfg is nil.
Types ¶
type Factory ¶ added in v5.29.0
type Factory struct {
// contains filtered or unexported fields
}
Factory creates installers based on cluster configuration. It holds the shared dependencies required by installers.
func NewFactory ¶ added in v5.29.0
func NewFactory( helmClient helm.Interface, dockerClient client.APIClient, kubeconfig, kubecontext string, timeout time.Duration, distribution v1alpha1.Distribution, ) *Factory
NewFactory creates a new installer factory with the required dependencies.
func (*Factory) CreateInstallersForConfig ¶ added in v5.29.0
CreateInstallersForConfig creates installers for all components specified in the cluster config. Returns a map of component name to installer.
type Installer ¶
type Installer interface {
// Install installs the component.
Install(ctx context.Context) error
// Uninstall uninstalls the component.
Uninstall(ctx context.Context) error
// Images returns the container images used by this component.
// The images are extracted from the rendered Helm chart manifests.
Images(ctx context.Context) ([]string, error)
}
Installer defines methods for installing and uninstalling components.
type MockInstaller ¶
MockInstaller is an autogenerated mock type for the Installer type
func NewMockInstaller ¶
func NewMockInstaller(t interface {
mock.TestingT
Cleanup(func())
}) *MockInstaller
NewMockInstaller creates a new instance of MockInstaller. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockInstaller) EXPECT ¶
func (_m *MockInstaller) EXPECT() *MockInstaller_Expecter
func (*MockInstaller) Images ¶ added in v5.29.0
func (_mock *MockInstaller) Images(ctx context.Context) ([]string, error)
Images provides a mock function for the type MockInstaller
type MockInstaller_Expecter ¶
type MockInstaller_Expecter struct {
// contains filtered or unexported fields
}
func (*MockInstaller_Expecter) Images ¶ added in v5.29.0
func (_e *MockInstaller_Expecter) Images(ctx interface{}) *MockInstaller_Images_Call
Images is a helper method to define mock.On call
- ctx context.Context
func (*MockInstaller_Expecter) Install ¶
func (_e *MockInstaller_Expecter) Install(ctx interface{}) *MockInstaller_Install_Call
Install is a helper method to define mock.On call
- ctx context.Context
func (*MockInstaller_Expecter) Uninstall ¶
func (_e *MockInstaller_Expecter) Uninstall(ctx interface{}) *MockInstaller_Uninstall_Call
Uninstall is a helper method to define mock.On call
- ctx context.Context
type MockInstaller_Images_Call ¶ added in v5.29.0
MockInstaller_Images_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Images'
func (*MockInstaller_Images_Call) Return ¶ added in v5.29.0
func (_c *MockInstaller_Images_Call) Return(strings []string, err error) *MockInstaller_Images_Call
func (*MockInstaller_Images_Call) Run ¶ added in v5.29.0
func (_c *MockInstaller_Images_Call) Run(run func(ctx context.Context)) *MockInstaller_Images_Call
func (*MockInstaller_Images_Call) RunAndReturn ¶ added in v5.29.0
func (_c *MockInstaller_Images_Call) RunAndReturn(run func(ctx context.Context) ([]string, error)) *MockInstaller_Images_Call
type MockInstaller_Install_Call ¶
MockInstaller_Install_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Install'
func (*MockInstaller_Install_Call) Return ¶
func (_c *MockInstaller_Install_Call) Return(err error) *MockInstaller_Install_Call
func (*MockInstaller_Install_Call) Run ¶
func (_c *MockInstaller_Install_Call) Run(run func(ctx context.Context)) *MockInstaller_Install_Call
func (*MockInstaller_Install_Call) RunAndReturn ¶
func (_c *MockInstaller_Install_Call) RunAndReturn(run func(ctx context.Context) error) *MockInstaller_Install_Call
type MockInstaller_Uninstall_Call ¶
MockInstaller_Uninstall_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Uninstall'
func (*MockInstaller_Uninstall_Call) Return ¶
func (_c *MockInstaller_Uninstall_Call) Return(err error) *MockInstaller_Uninstall_Call
func (*MockInstaller_Uninstall_Call) Run ¶
func (_c *MockInstaller_Uninstall_Call) Run(run func(ctx context.Context)) *MockInstaller_Uninstall_Call
func (*MockInstaller_Uninstall_Call) RunAndReturn ¶
func (_c *MockInstaller_Uninstall_Call) RunAndReturn(run func(ctx context.Context) error) *MockInstaller_Uninstall_Call
Directories
¶
| Path | Synopsis |
|---|---|
|
Package argocdinstaller installs Argo CD via Helm.
|
Package argocdinstaller installs Argo CD via Helm. |
|
Package certmanagerinstaller installs cert-manager via Helm.
|
Package certmanagerinstaller installs cert-manager via Helm. |
|
Package cloudproviderkindinstaller provides a Helm-based installer for Cloud Provider KIND.
|
Package cloudproviderkindinstaller provides a Helm-based installer for Cloud Provider KIND. |
|
Package cni provides unified CNI installer implementations and shared utilities for managing CNI providers on Kubernetes clusters.
|
Package cni provides unified CNI installer implementations and shared utilities for managing CNI providers on Kubernetes clusters. |
|
calico
Package calicoinstaller provides an installer for installing Calico CNI on a Kubernetes cluster.
|
Package calicoinstaller provides an installer for installing Calico CNI on a Kubernetes cluster. |
|
cilium
Package ciliuminstaller provides an installer for installing Cilium CNI on a Kubernetes cluster.
|
Package ciliuminstaller provides an installer for installing Cilium CNI on a Kubernetes cluster. |
|
Package fluxinstaller provides an installer for installing Flux on a Kubernetes cluster.
|
Package fluxinstaller provides an installer for installing Flux on a Kubernetes cluster. |
|
Package gatekeeperinstaller installs Gatekeeper via Helm.
|
Package gatekeeperinstaller installs Gatekeeper via Helm. |
|
Package hetznercsiinstaller installs the Hetzner Cloud CSI driver via Helm.
|
Package hetznercsiinstaller installs the Hetzner Cloud CSI driver via Helm. |
|
internal
|
|
|
helmutil
Package helmutil provides shared helpers for Helm-based installer packages.
|
Package helmutil provides shared helpers for Helm-based installer packages. |
|
Package kubeletcsrapproverinstaller provides an installer for kubelet-csr-approver on a Kubernetes cluster.
|
Package kubeletcsrapproverinstaller provides an installer for kubelet-csr-approver on a Kubernetes cluster. |
|
Package kyvernoinstaller installs Kyverno via Helm.
|
Package kyvernoinstaller installs Kyverno via Helm. |
|
Package localpathstorageinstaller provides installation of Rancher Local Path Provisioner for Kind clusters.
|
Package localpathstorageinstaller provides installation of Rancher Local Path Provisioner for Kind clusters. |
|
Package metallbinstaller installs MetalLB via Helm.
|
Package metallbinstaller installs MetalLB via Helm. |
|
Package metricsserverinstaller provides an installer for installing metrics-server on a Kubernetes cluster.
|
Package metricsserverinstaller provides an installer for installing metrics-server on a Kubernetes cluster. |