Documentation
¶
Overview ¶
Package kubernetes provides cluster-wide kubernetes utilities.
Index ¶
- func CheckCompatibility(k8sVersion string, versions []NodeVersion) error
- func DetectLowestVersion(ctx context.Context, cluster UpgradeProvider, options UpgradeOptions) (string, error)
- func GetMinimumTalosVersion(versions []NodeVersion) (*compatibility.TalosVersion, error)
- func PerformManifestsSync(ctx context.Context, cluster UpgradeProvider, useSSA bool, ...) error
- func Upgrade(ctx context.Context, cluster UpgradeProvider, options UpgradeOptions) error
- func ValidateImageReference(ref string) error
- func VerifyVersionCompatibility(ctx context.Context, talosClient *client.Client, nodes []string, ...) (*compatibility.TalosVersion, error)
- type NodeVersion
- type UpgradeOptions
- type UpgradeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCompatibility ¶ added in v1.13.0
func CheckCompatibility(k8sVersion string, versions []NodeVersion) error
CheckCompatibility checks if all provided Talos versions are compatible with the given Kubernetes version.
func DetectLowestVersion ¶
func DetectLowestVersion(ctx context.Context, cluster UpgradeProvider, options UpgradeOptions) (string, error)
DetectLowestVersion returns lowest Kubernetes components versions in the cluster.
func GetMinimumTalosVersion ¶ added in v1.13.0
func GetMinimumTalosVersion(versions []NodeVersion) (*compatibility.TalosVersion, error)
GetMinimumTalosVersion returns the minimum Talos version from the provided list of NodeVersion.
func PerformManifestsSync ¶ added in v1.13.0
func PerformManifestsSync( ctx context.Context, cluster UpgradeProvider, useSSA bool, options UpgradeOptions, ) error
PerformManifestsSync performs manifests sync from Talos manifest list to Kubernetes.
func Upgrade ¶ added in v1.4.0
func Upgrade(ctx context.Context, cluster UpgradeProvider, options UpgradeOptions) error
Upgrade the Kubernetes control plane components, manifests, kubelets.
func ValidateImageReference ¶ added in v1.10.0
ValidateImageReference validates if the provided string is a valid Docker image reference.
func VerifyVersionCompatibility ¶ added in v1.11.0
func VerifyVersionCompatibility(ctx context.Context, talosClient *client.Client, nodes []string, k8sVersion string, logger func(string, ...any)) ( *compatibility.TalosVersion, error, )
VerifyVersionCompatibility retrieves Talos versions for the specified nodes and checks their compatibility with the given Kubernetes version.
Types ¶
type NodeVersion ¶ added in v1.13.0
type NodeVersion struct {
Node string
Version *compatibility.TalosVersion
}
NodeVersion holds the node identifier along with its Talos version.
func GetNodesTalosVersions ¶ added in v1.13.0
func GetNodesTalosVersions(ctx context.Context, talosClient *client.Client, nodes []string) ([]NodeVersion, error)
GetNodesTalosVersions retrieves the Talos versions for the specified nodes.
type UpgradeOptions ¶
type UpgradeOptions struct {
Path *upgrade.Path
DryRun bool
ControlPlaneEndpoint string
LogOutput io.Writer
PrePullImages bool
UpgradeKubelet bool
EncoderOpt encoder.Option
KubeletImage string
APIServerImage string
ControllerManagerImage string
SchedulerImage string
ProxyImage string
NoPrune bool
ForceManifests bool
ReconcileTimeout time.Duration
InventoryPolicy ssa.InventoryPolicy
SkipManifestWait bool
// contains filtered or unexported fields
}
UpgradeOptions represents Kubernetes control plane upgrade settings.
func (*UpgradeOptions) Log ¶
func (options *UpgradeOptions) Log(line string, args ...any)
Log writes the line to logger or to stdout if no logger was provided.
func (*UpgradeOptions) Validate ¶ added in v1.10.0
func (options *UpgradeOptions) Validate() error
Validate checks all image references in the upgrade options.
type UpgradeProvider ¶
type UpgradeProvider interface {
cluster.ClientProvider
cluster.K8sProvider
}
UpgradeProvider are the cluster interfaces required by upgrade process.