Documentation ¶
Overview ¶
Kruise is a black box CLI that is driven by a config
Kruise helps with abstractly deploying workloads to Kubernetes
Index ¶
- func Delete(fs *pflag.FlagSet, args []string)
- func Deploy(fs *pflag.FlagSet, args []string)
- func Init(fs *pflag.FlagSet, installers ...Installer)
- func Initialize()
- func InitializeConfig()
- func InitializeLogger()
- func Install(fs *pflag.FlagSet, installers ...Installer)
- func Uninstall(fs *pflag.FlagSet, installers ...Installer)
- type Command
- type CommandBuilder
- type Deployment
- type Deployments
- type HelmChart
- type HelmCharts
- type HelmDeployment
- type HelmDeployments
- type HelmRepositories
- type HelmRepository
- type ICommand
- type ICommandBuilder
- type Installer
- type Installers
- type Konfig
- type KubectlDeployment
- type KubectlDeployments
- type KubectlDockerRegistrySecret
- type KubectlDockerRegistrySecrets
- type KubectlGenericSecret
- type KubectlGenericSecrets
- type KubectlManifest
- type KubectlManifests
- type Profile
- type Profiles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Delete ¶
Delete determines passed deployments from args and passes the cobra Cmd FlagSet to the Uninstall function
func Deploy ¶
Deploy determines passed deployments from args and passes the cobra Cmd FlagSet to the Uninstall function
func Init ¶
Init invokes the Install function for all Installers that should only be installed during initialization (i.e. HelmRepositories and KubectlSecrets)
func InitializeConfig ¶
func InitializeConfig()
InitializeConfig is used to initialize Kruise configuration
func InitializeLogger ¶
func InitializeLogger()
InitializeLogger is used to initialize the Kruise logger
Types ¶
type Command ¶
Command defines how to execute a set or arguments on the command line
Used with the exec.Command function: https://pkg.go.dev/os/exec#Command
type CommandBuilder ¶
type CommandBuilder struct {
Command
}
CommandBuilder is used to build a Kruise Command
func (CommandBuilder) Build ¶
func (c CommandBuilder) Build() ICommand
Build returns an ICommand from a CommandBuilder
func (CommandBuilder) WithArgs ¶
func (c CommandBuilder) WithArgs(args []string) ICommandBuilder
WithArgs defines the argument list for a command
func (CommandBuilder) WithDryRun ¶
func (c CommandBuilder) WithDryRun(dr bool) ICommandBuilder
WithDryRun determines whether the command should be printed or executed
func (CommandBuilder) WithNoStdOut ¶
func (c CommandBuilder) WithNoStdOut() ICommandBuilder
WithNoStdOut determines whether the command should show stdout upon being executed
type Deployment ¶
type Deployment latest.Deployment
Deployment is used to capture the map key as the name field from the latest.Deployment object
type Deployments ¶
type Deployments []Deployment
Deployments is a slice of Deployment objects
func GetDeployments ¶
func GetDeployments() Deployments
GetDeployments gets deployments from Kruise config
type HelmChart ¶
HelmChart represents information about a Helm chart
func (HelmChart) GetPriority ¶
GetPriority is used to get the priority of the installer
type HelmDeployment ¶
type HelmDeployment latest.HelmDeployment
HelmDeployment encapsulates Helm objects like HelmRepositories and HelmCharts for a given deployment
type HelmDeployments ¶
type HelmDeployments []HelmDeployment
HelmDeployments represents a slice of HelmDeployment objects
type HelmRepositories ¶
type HelmRepositories []HelmRepository
HelmRepositories represents a slice of HelmRepository objects
type HelmRepository ¶
type HelmRepository latest.HelmRepository
HelmRepository represents information about a Helm repository
func (HelmRepository) GetPriority ¶
func (r HelmRepository) GetPriority() int
GetPriority is used to get the priority of the installer
func (HelmRepository) Install ¶
func (r HelmRepository) Install(fs *pflag.FlagSet)
Install is used to execute a Helm repo add command
func (HelmRepository) IsInit ¶
func (m HelmRepository) IsInit() bool
IsInit is used to determine whether the installer should be installed during initialization
func (HelmRepository) Uninstall ¶
func (r HelmRepository) Uninstall(fs *pflag.FlagSet)
Uninstall is used to execute a Helm repo remove command
type ICommand ¶
type ICommand interface {
Execute() error
}
ICommand defines the functions for a Kruise Command
type ICommandBuilder ¶
type ICommandBuilder interface { WithArgs(a []string) ICommandBuilder WithDryRun(dr bool) ICommandBuilder WithNoStdOut() ICommandBuilder Build() ICommand }
ICommandBuilder defines the builder functions for the Kruise CommandBuilder
func NewCmd ¶
func NewCmd(name string) ICommandBuilder
NewCmd returns a new Kruise ICommmandBuilder
Not to be confused with the Kruise Kommand which is a wrapper for the cobra Command
type Installer ¶
type Installer interface { Install(fs *pflag.FlagSet) Uninstall(fs *pflag.FlagSet) GetPriority() int IsInit() bool }
Installer represents an interface for generic objects that can be installed and uninstalled
type Konfig ¶
type Konfig struct { Paths []string HiddenPaths []string Name string Override string Manifest latest.KruiseConfig }
Konfig struct used to combine file metadata with unmarshalled Kruise configuration
func NewKonfig ¶
func NewKonfig() *Konfig
NewKonfig is used to create a new Kruise config (Konfig) object
If the KRUISE_CONFIG environment variable is set, that config file is used, otherwise the following locations are checked in this order:
cwd/kruise.json/toml/yaml
xdg.ConfigHome/kruise/kruise.json/toml/yaml
cwd/.kruise.json/toml/yaml
xdg.ConfigHome/kruise/.kruise.json/toml/yaml
xdg.Home/.kruise.json/toml/yaml
func (*Konfig) ApplyUserConfig ¶
func (k *Konfig) ApplyUserConfig()
ApplyUserConfig reads in a configuration file that is passed to viper and unmarshalled
type KubectlDeployment ¶
type KubectlDeployment latest.KubectlDeployment
KubectlDeployment encapsulates Helm objects like KubectlGenericSecrets, KubectlDockerRegistrySecrets and KubectlManifests for a given deployment
type KubectlDeployments ¶
type KubectlDeployments []KubectlDeployment
KubectlDeployments represents a slice of KubectlDeployment objects
type KubectlDockerRegistrySecret ¶
type KubectlDockerRegistrySecret struct { latest.KubectlDockerRegistrySecret Namespaces []string }
KubectlDockerRegistrySecret represents information about a docker-registry Kubernetes secret The Namespaces field is used to support creating the same secret across multiple namespaces and only prompting the user once.
func (KubectlDockerRegistrySecret) GetPriority ¶
func (s KubectlDockerRegistrySecret) GetPriority() int
GetPriority is used to get the priority of the installer
func (KubectlDockerRegistrySecret) Install ¶
func (s KubectlDockerRegistrySecret) Install(fs *pflag.FlagSet)
Install is used to execute a Kubectl create docker-registry secret command
func (KubectlDockerRegistrySecret) IsInit ¶
func (m KubectlDockerRegistrySecret) IsInit() bool
IsInit is used to determine whether the installer should be installed during initialization
func (KubectlDockerRegistrySecret) Uninstall ¶
func (s KubectlDockerRegistrySecret) Uninstall(fs *pflag.FlagSet)
Uninstall is used to execute a Kubectl delete secret command
type KubectlDockerRegistrySecrets ¶
type KubectlDockerRegistrySecrets []KubectlDockerRegistrySecret
KubectlDockerRegistrySecrets represents a slice of KubectlDockerRegistrySecret objects
type KubectlGenericSecret ¶
type KubectlGenericSecret struct { latest.KubectlGenericSecret Namespaces []string }
KubectlGenericSecret represents information about a generic Kubernetes secret The Namespaces field is used to support creating the same secret across multiple namespaces and only prompting the user once.
func (KubectlGenericSecret) GetPriority ¶
func (s KubectlGenericSecret) GetPriority() int
GetPriority is used to get the priority of the installer
func (KubectlGenericSecret) Install ¶
func (s KubectlGenericSecret) Install(fs *pflag.FlagSet)
Install is used to execute a Kubectl create generic secret command
func (KubectlGenericSecret) IsInit ¶
func (m KubectlGenericSecret) IsInit() bool
IsInit is used to determine whether the installer should be installed during initialization
func (KubectlGenericSecret) Uninstall ¶
func (s KubectlGenericSecret) Uninstall(fs *pflag.FlagSet)
Uninstall is used to execute a Kubectl delete secret command
type KubectlGenericSecrets ¶
type KubectlGenericSecrets []KubectlGenericSecret
KubectlGenericSecrets represents a slice of KubectlGenericSecret objects
type KubectlManifest ¶
type KubectlManifest latest.KubectlManifest
KubectlManifest represents information about a Kubectl manifest
func (KubectlManifest) GetPriority ¶
func (m KubectlManifest) GetPriority() int
GetPriority is used to get the priority of the installer
func (KubectlManifest) Install ¶
func (m KubectlManifest) Install(fs *pflag.FlagSet)
Install is used to execute a Kubectl apply command
func (KubectlManifest) IsInit ¶
func (m KubectlManifest) IsInit() bool
IsInit is used to determine whether the installer should be installed during initialization
func (KubectlManifest) Uninstall ¶
func (m KubectlManifest) Uninstall(fs *pflag.FlagSet)
Uninstall is used to execute a Kubectl delete command
type KubectlManifests ¶
type KubectlManifests []KubectlManifest
KubectlManifests represents a slice of KubectlManifest objects