installers.virt.kubectl_installer #
kubectl_installer
Installs the kubectl CLI tool for interacting with Kubernetes clusters.
Usage
import incubaid.herolib.installers.virt.kubectl_installer
// Get the installer
mut installer := kubectl_installer.get()!
// Install kubectl
installer.install()!
Example heroscript
!!kubectl_installer.configure
kubectl_version: 'v1.33.1'
!!kubectl_installer.install
Constants #
const version = 'v1.33.1'
Default kubectl version (matches K3s default version for compatibility)
fn delete #
fn delete(args ArgsGet) !
fn exists #
fn exists(args ArgsGet) !bool
does the config exists?
fn get #
fn get(args ArgsGet) !&KubectlInstaller
fn heroscript_dumps #
fn heroscript_dumps(obj KubectlInstaller) !string
///////////NORMALLY NO NEED TO TOUCH
fn heroscript_loads #
fn heroscript_loads(heroscript string) !KubectlInstaller
fn list #
fn list(args ArgsList) ![]&KubectlInstaller
if fromdb set: load from filesystem, and not from mem, will also reset what is in mem
fn new #
fn new(args ArgsGet) !&KubectlInstaller
fn play #
fn play(mut plbook PlayBook) !
fn set #
fn set(o KubectlInstaller) !
register the config for the future
fn switch #
fn switch(name string)
switch instance to be used for kubectl_installer
struct ArgsGet #
@[params]
struct ArgsGet {
pub mut:
name string = 'default'
fromdb bool // will load from filesystem
create bool // default will not create if not exist
}
///////FACTORY
struct ArgsList #
@[params]
struct ArgsList {
pub mut:
fromdb bool // will load from filesystem
}
struct InstallArgs #
@[params]
struct InstallArgs {
pub mut:
reset bool
}
struct KubectlInstaller #
@[heap]
struct KubectlInstaller {
pub mut:
name string = 'default'
}
kubectl installer - handles kubectl CLI tool installation
fn (KubectlInstaller) destroy #
fn (mut self KubectlInstaller) destroy() !
fn (KubectlInstaller) install #
fn (mut self KubectlInstaller) install(args InstallArgs) !
fn (KubectlInstaller) reload #
fn (mut self KubectlInstaller) reload() !
load from disk and make sure is properly intialized