kubectlinstaller

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

README

pkg/installer/kubectl

This package provides a kubectl installer implementation for KSail.

Purpose

Implements the Installer interface specifically for installing and managing kubectl, the Kubernetes command-line tool. This installer ensures that kubectl is available and properly configured for use with KSail.

Features

  • kubectl Installation: Downloads and installs kubectl binary
  • Version Management: Handles specific kubectl versions
  • Configuration: Sets up kubectl configuration for cluster access

Usage

import "github.com/devantler-tech/ksail-go/pkg/installer/kubectl"

// Create kubectl installer
kubectlInstaller := kubectl.NewInstaller(/* configuration */)

// Install kubectl
ctx := context.Background()
if err := kubectlInstaller.Install(ctx); err != nil {
    log.Fatal("Failed to install kubectl:", err)
}

// Uninstall kubectl
if err := kubectlInstaller.Uninstall(ctx); err != nil {
    log.Fatal("Failed to uninstall kubectl:", err)
}

This installer is essential for ensuring kubectl availability when working with Kubernetes clusters through KSail.


⬅️ Go Back

Documentation

Overview

Package kubectlinstaller provides a kubectl installer implementation.

Index

Constants

This section is empty.

Variables

View Source
var ErrCRDNameNotAccepted = errors.New("crd names not accepted")

ErrCRDNameNotAccepted is returned when CRD names are not accepted.

Functions

This section is empty.

Types

type KubectlInstaller

type KubectlInstaller struct {
	// contains filtered or unexported fields
}

KubectlInstaller implements the installer.Installer interface for kubectl.

func NewKubectlInstaller

func NewKubectlInstaller(
	timeout time.Duration,
	apiExtensionsClient apiextensionsv1client.CustomResourceDefinitionInterface,
	dynamicClient dynamic.ResourceInterface,
) *KubectlInstaller

NewKubectlInstaller creates a new kubectl installer instance.

func (*KubectlInstaller) Install

func (b *KubectlInstaller) Install(ctx context.Context) error

Install ensures the ApplySet CRD and its parent CR exist.

func (*KubectlInstaller) Uninstall

func (b *KubectlInstaller) Uninstall(ctx context.Context) error

Uninstall deletes the ApplySet CR then its CRD.

Jump to

Keyboard shortcuts

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