Documentation ¶
Index ¶
- Constants
- Variables
- func CalculateDiskSizeInMB(humanReadableDiskSize string) int
- func CanReadFile(path string) bool
- func ChownR(path string, uid, gid int) error
- func FindAndSet(path string, c interface{}, value string) error
- func GenerateCACert(certPath, keyPath string, name string) error
- func GenerateSignedCert(certPath, keyPath, cn string, ips []net.IP, alternateDNS []string, ...) error
- func GetAlternateDNS(domain string) []string
- func GetBinaryDownloadURL(version, platform string) string
- func GetClient() (kubernetes.Interface, error)
- func GetDNSIP(serviceCIDR string) (net.IP, error)
- func GetServiceClusterIP(serviceCIDR string) (net.IP, error)
- func IsDirectory(path string) (bool, error)
- func IsRetryableAPIError(err error) bool
- func MaybeChownDirRecursiveToMinikubeUser(dir string) error
- func Pad(str string) string
- func ParseSHAFromURL(url string) (string, error)
- func Retry(attempts int, callback func() error) (err error)
- func RetryAfter(attempts int, callback func() error, d time.Duration) (err error)
- func StartPods(c kubernetes.Interface, namespace string, pod v1.Pod, waitForRunning bool) error
- func TeePrefix(prefix string, r io.Reader, w io.Writer, ...) error
- func Until(fn func() error, w io.Writer, name string, sleep time.Duration, ...)
- func WaitForDeploymentToStabilize(c kubernetes.Interface, ns, name string, timeout time.Duration) error
- func WaitForEvent(c kubernetes.Interface, ns string, reason string) error
- func WaitForPodDelete(c kubernetes.Interface, ns string, label labels.Selector) error
- func WaitForPodsWithLabelRunning(c kubernetes.Interface, ns string, label labels.Selector) error
- func WaitForRCToStabilize(c kubernetes.Interface, ns, name string, timeout time.Duration) error
- func WaitForService(c kubernetes.Interface, namespace, name string, exist bool, ...) error
- func WaitForServiceEndpointsNum(c kubernetes.Interface, namespace, serviceName string, expectNum int, ...) error
- type DefaultDownloader
- func (f DefaultDownloader) CacheMinikubeISOFromURL(isoURL string) error
- func (f DefaultDownloader) GetISOCacheFilepath(isoURL string) string
- func (f DefaultDownloader) GetISOFileURI(isoURL string) string
- func (f DefaultDownloader) IsMinikubeISOCached(isoURL string) bool
- func (f DefaultDownloader) ShouldCacheMinikubeISO(isoURL string) bool
- type ExtraOption
- type ExtraOptionSlice
- type ISODownloader
- type MultiError
- type PodStore
- type RetriableError
Constants ¶
const ( APIServerPort = 8443 DefaultMinikubeDirectory = "/var/lib/minikube" DefaultCertPath = DefaultMinikubeDirectory + "/certs/" DefaultKubeConfigPath = DefaultMinikubeDirectory + "/kubeconfig" DefaultDNSDomain = "cluster.local" DefaultServiceCIDR = "10.96.0.0/12" )
These constants are used by both minikube
const ErrPrefix = "! "
const OutPrefix = "> "
Variables ¶
var ( // ReasonableMutateTime is how long to wait for basic object mutations, such as deletions, to show up ReasonableMutateTime = time.Minute * 1 // ReasonableStartTime is how long to wait for pods to start, considering dependency chains & slow networks. ReasonableStartTime = time.Minute * 10 )
var DefaultAdmissionControllers = []string{
"Initializers",
"NamespaceLifecycle",
"LimitRanger",
"ServiceAccount",
"DefaultStorageClass",
"DefaultTolerationSeconds",
"NodeRestriction",
"MutatingAdmissionWebhook",
"ValidatingAdmissionWebhook",
"ResourceQuota",
}
Functions ¶
func CalculateDiskSizeInMB ¶ added in v0.22.0
func CanReadFile ¶
If the file represented by path exists and readable, return true otherwise return false.
func FindAndSet ¶ added in v0.11.0
FindAndSet sets the nested value.
func GenerateCACert ¶ added in v0.6.0
func GenerateSignedCert ¶ added in v0.6.0
func GenerateSignedCert(certPath, keyPath, cn string, ips []net.IP, alternateDNS []string, signerCertPath, signerKeyPath string) error
You may also specify additional subject alt names (either ip or dns names) for the certificate The certificate will be created with file mode 0644. The key will be created with file mode 0600. If the certificate or key files already exist, they will be overwritten. Any parent directories of the certPath or keyPath will be created as needed with file mode 0755.
func GetAlternateDNS ¶
func GetBinaryDownloadURL ¶ added in v0.26.0
func GetClient ¶ added in v0.22.2
func GetClient() (kubernetes.Interface, error)
func GetServiceClusterIP ¶ added in v0.24.0
GetServiceClusterIP returns the first IP of the ServiceCIDR
func IsDirectory ¶ added in v0.9.0
func IsRetryableAPIError ¶ added in v0.22.2
func MaybeChownDirRecursiveToMinikubeUser ¶ added in v0.21.0
func ParseSHAFromURL ¶ added in v0.11.0
func RetryAfter ¶ added in v0.2.0
func TeePrefix ¶ added in v0.32.0
func TeePrefix(prefix string, r io.Reader, w io.Writer, logger func(format string, args ...interface{})) error
TeePrefix copies bytes from a reader to writer, logging each new line.
func Until ¶
Until endlessly loops the provided function until a message is received on the done channel. The function will wait the duration provided in sleep between function calls. Errors will be sent on provider Writer.
func WaitForDeploymentToStabilize ¶ added in v0.25.0
func WaitForDeploymentToStabilize(c kubernetes.Interface, ns, name string, timeout time.Duration) error
WaitForDeploymentToStabilize waits till the Deployment has a matching generation/replica count between spec and status.
func WaitForEvent ¶ added in v0.31.0
func WaitForEvent(c kubernetes.Interface, ns string, reason string) error
WaitForEvent waits for the given event to appear
func WaitForPodDelete ¶ added in v0.31.0
WaitForPodDelete waits for a pod to be deleted
func WaitForPodsWithLabelRunning ¶ added in v0.22.2
WaitForPodsWithLabelRunning waits for all matching pods to become Running and at least one matching pod exists.
func WaitForRCToStabilize ¶ added in v0.22.2
WaitForRCToStabilize waits till the RC has a matching generation/replica count between spec and status.
func WaitForService ¶ added in v0.22.2
func WaitForService(c kubernetes.Interface, namespace, name string, exist bool, interval, timeout time.Duration) error
WaitForService waits until the service appears (exist == true), or disappears (exist == false)
func WaitForServiceEndpointsNum ¶ added in v0.22.2
func WaitForServiceEndpointsNum(c kubernetes.Interface, namespace, serviceName string, expectNum int, interval, timeout time.Duration) error
WaitForServiceEndpointsNum waits until the amount of endpoints that implement service to expectNum.
Types ¶
type DefaultDownloader ¶ added in v0.16.0
type DefaultDownloader struct{}
func (DefaultDownloader) CacheMinikubeISOFromURL ¶ added in v0.16.0
func (f DefaultDownloader) CacheMinikubeISOFromURL(isoURL string) error
func (DefaultDownloader) GetISOCacheFilepath ¶ added in v0.17.0
func (f DefaultDownloader) GetISOCacheFilepath(isoURL string) string
func (DefaultDownloader) GetISOFileURI ¶ added in v0.16.0
func (f DefaultDownloader) GetISOFileURI(isoURL string) string
func (DefaultDownloader) IsMinikubeISOCached ¶ added in v0.17.0
func (f DefaultDownloader) IsMinikubeISOCached(isoURL string) bool
func (DefaultDownloader) ShouldCacheMinikubeISO ¶ added in v0.17.0
func (f DefaultDownloader) ShouldCacheMinikubeISO(isoURL string) bool
type ExtraOption ¶ added in v0.11.0
func (*ExtraOption) String ¶ added in v0.11.0
func (e *ExtraOption) String() string
type ExtraOptionSlice ¶ added in v0.11.0
type ExtraOptionSlice []ExtraOption
func (*ExtraOptionSlice) Set ¶ added in v0.11.0
func (es *ExtraOptionSlice) Set(value string) error
func (*ExtraOptionSlice) String ¶ added in v0.11.0
func (es *ExtraOptionSlice) String() string
func (*ExtraOptionSlice) Type ¶ added in v0.11.0
func (es *ExtraOptionSlice) Type() string
type ISODownloader ¶ added in v0.16.0
type MultiError ¶ added in v0.8.0
type MultiError struct {
Errors []error
}
func (*MultiError) Collect ¶ added in v0.8.0
func (m *MultiError) Collect(err error)
func (MultiError) ToError ¶ added in v0.8.0
func (m MultiError) ToError() error
type PodStore ¶ added in v0.22.2
type PodStore struct { cache.Store Reflector *cache.Reflector // contains filtered or unexported fields }
func NewPodStore ¶ added in v0.22.2
type RetriableError ¶ added in v0.12.0
type RetriableError struct {
Err error
}
func (RetriableError) Error ¶ added in v0.12.0
func (r RetriableError) Error() string