Documentation
¶
Index ¶
- Constants
- Variables
- func ContainsParam(slice []string, s string) bool
- func CreateEmptyProfile(name string, miniHome ...string) error
- func CreateProfile(name string, cfg *Config, miniHome ...string) error
- func DeleteProfile(profile string, miniHome ...string) error
- func Get(name string) (string, error)
- func GetMachineName() string
- func ListProfiles(miniHome ...string) (validPs []*Profile, inValidPs []*Profile, err error)
- func ProfileExists(name string, miniHome ...string) bool
- func ProfileFolderPath(profile string, miniHome ...string) string
- func ProfileNameInReservedKeywords(name string) bool
- func WriteConfig(configFile string, m MinikubeConfig) error
- type ComponentExtraOptionMap
- type Config
- type ExtraOption
- type ExtraOptionSlice
- type KubernetesConfig
- type Loader
- type MachineConfig
- type MinikubeConfig
- type Profile
- type VersionedExtraOption
Constants ¶
const ( // WantUpdateNotification is the key for WantUpdateNotification WantUpdateNotification = "WantUpdateNotification" // ReminderWaitPeriodInHours is the key for WantUpdateNotification ReminderWaitPeriodInHours = "ReminderWaitPeriodInHours" // WantReportError is the key for WantReportError WantReportError = "WantReportError" // WantReportErrorPrompt is the key for WantReportErrorPrompt WantReportErrorPrompt = "WantReportErrorPrompt" // WantKubectlDownloadMsg is the key for WantKubectlDownloadMsg WantKubectlDownloadMsg = "WantKubectlDownloadMsg" // WantNoneDriverWarning is the key for WantNoneDriverWarning WantNoneDriverWarning = "WantNoneDriverWarning" // MachineProfile is the key for MachineProfile MachineProfile = "profile" // ShowDriverDeprecationNotification is the key for ShowDriverDeprecationNotification ShowDriverDeprecationNotification = "ShowDriverDeprecationNotification" // ShowBootstrapperDeprecationNotification is the key for ShowBootstrapperDeprecationNotification ShowBootstrapperDeprecationNotification = "ShowBootstrapperDeprecationNotification" )
Variables ¶
var ( // ErrKeyNotFound is the error returned when a key doesn't exist in the config file ErrKeyNotFound = errors.New("specified key could not be found in config") )
Functions ¶
func ContainsParam ¶ added in v1.4.0
ContainsParam checks if a given slice of strings contains the provided string. If a modifier func is provided, it is called with the slice item before the comparison.
func CreateEmptyProfile ¶ added in v1.4.0
CreateEmptyProfile creates an empty profile stores in $MINIKUBE_HOME/profiles/<profilename>/config.json
func CreateProfile ¶ added in v1.4.0
CreateProfile creates an profile out of the cfg and stores in $MINIKUBE_HOME/profiles/<profilename>/config.json
func DeleteProfile ¶ added in v1.4.0
DeleteProfile deletes a profile and removes the profile dir
func GetMachineName ¶ added in v0.19.0
func GetMachineName() string
GetMachineName gets the machine name for the VM
func ListProfiles ¶ added in v1.3.0
ListProfiles returns all valid and invalid (if any) minikube profiles invalidPs are the profiles that have a directory or config file but not usable invalidPs would be suggested to be deleted
func ProfileExists ¶ added in v1.4.0
ProfileExists returns true if there is a profile config (regardless of being valid)
func ProfileFolderPath ¶ added in v1.5.0
ProfileFolderPath returns path of profile folder
func ProfileNameInReservedKeywords ¶ added in v1.5.0
ProfileNameInReservedKeywords checks if the profile is an internal keywords
func WriteConfig ¶ added in v1.3.1
func WriteConfig(configFile string, m MinikubeConfig) error
WriteConfig writes a minikube config to the JSON file
Types ¶
type ComponentExtraOptionMap ¶ added in v1.4.0
ComponentExtraOptionMap maps components to their extra opts, which is a map of keys to values
type Config ¶ added in v0.26.0
type Config struct { MachineConfig MachineConfig KubernetesConfig KubernetesConfig }
Config contains machine and k8s config
type ExtraOption ¶ added in v1.4.0
ExtraOption is an extra option
func (*ExtraOption) String ¶ added in v1.4.0
func (e *ExtraOption) String() string
type ExtraOptionSlice ¶ added in v1.4.0
type ExtraOptionSlice []ExtraOption
ExtraOptionSlice is a slice of ExtraOption
func (*ExtraOptionSlice) AsMap ¶ added in v1.4.0
func (es *ExtraOptionSlice) AsMap() ComponentExtraOptionMap
AsMap converts the slice to a map of components to a map of keys and values.
func (*ExtraOptionSlice) Get ¶ added in v1.4.0
func (es *ExtraOptionSlice) Get(key string, component ...string) string
Get finds and returns the value of an argument with the specified key and component (optional) or an empty string if not found. If component contains more than one value, the value for the first component found is returned. If component is not specified, all of the components are used.
func (*ExtraOptionSlice) Set ¶ added in v1.4.0
func (es *ExtraOptionSlice) Set(value string) error
Set parses the string value into a slice
func (*ExtraOptionSlice) String ¶ added in v1.4.0
func (es *ExtraOptionSlice) String() string
String converts the slice to a string value
func (*ExtraOptionSlice) Type ¶ added in v1.4.0
func (es *ExtraOptionSlice) Type() string
Type returns the type
type KubernetesConfig ¶ added in v0.26.0
type KubernetesConfig struct { KubernetesVersion string NodeIP string NodePort int NodeName string APIServerName string APIServerNames []string APIServerIPs []net.IP DNSDomain string ContainerRuntime string CRISocket string NetworkPlugin string FeatureGates string ServiceCIDR string ImageRepository string ExtraOptions ExtraOptionSlice ShouldLoadCachedImages bool EnableDefaultCNI bool }
KubernetesConfig contains the parameters used to configure the VM Kubernetes.
type Loader ¶ added in v0.31.0
Loader loads the kubernetes and machine config based on the machine profile name
var DefaultLoader Loader = &simpleConfigLoader{}
DefaultLoader is the default config loader
type MachineConfig ¶ added in v0.26.0
type MachineConfig struct { KeepContext bool // used by start and profile command to or not to switch kubectl's current context EmbedCerts bool // used by kubeconfig.Setup MinikubeISO string Memory int CPUs int DiskSize int VMDriver string ContainerRuntime string HyperkitVpnKitSock string // Only used by the Hyperkit driver HyperkitVSockPorts []string // Only used by the Hyperkit driver DockerEnv []string // Each entry is formatted as KEY=VALUE. InsecureRegistry []string RegistryMirror []string HostOnlyCIDR string // Only used by the virtualbox driver HypervVirtualSwitch string KVMNetwork string // Only used by the KVM driver KVMQemuURI string // Only used by kvm2 KVMGPU bool // Only used by kvm2 KVMHidden bool // Only used by kvm2 Downloader util.ISODownloader `json:"-"` DockerOpt []string // Each entry is formatted as KEY=VALUE. DisableDriverMounts bool // Only used by virtualbox UUID string // Only used by hyperkit to restore the mac address NoVTXCheck bool // Only used by virtualbox DNSProxy bool // Only used by virtualbox HostDNSResolver bool // Only used by virtualbox }
MachineConfig contains the parameters used to start a cluster.
type MinikubeConfig ¶ added in v0.12.0
type MinikubeConfig map[string]interface{}
MinikubeConfig represents minikube config
func ReadConfig ¶ added in v0.12.0
func ReadConfig(configFile string) (MinikubeConfig, error)
ReadConfig reads in the JSON minikube config
type Profile ¶ added in v1.3.0
Profile represents a minikube profile
func LoadProfile ¶ added in v1.5.0
LoadProfile loads type Profile based on its name
type VersionedExtraOption ¶ added in v1.4.0
type VersionedExtraOption struct { // The flag and component that will be set Option ExtraOption // This flag will only be applied to versions before or equal to this version // If it is the default value, it will have no upper bound on versions the // flag is applied to LessThanOrEqual semver.Version // The flag will only be applied to versions after or equal to this version // If it is the default value, it will have no lower bound on versions the // flag is applied to GreaterThanOrEqual semver.Version }
VersionedExtraOption holds information on flags to apply to a specific range of versions
func NewUnversionedOption ¶ added in v1.4.0
func NewUnversionedOption(component, k, v string) VersionedExtraOption
NewUnversionedOption returns a VersionedExtraOption that applies to all versions.