Documentation ¶
Index ¶
- func AESInstall(cmd *cobra.Command, args []string) error
- func AOSSUpgrade(cmd *cobra.Command, args []string) error
- func NewClusterInfo(kubectl Kubectl) clusterInfo
- func NewLoggingWriter(l *log.Logger) io.Writer
- type AdditionalDatum
- type Installer
- func (i *Installer) AskEmail() (string, Result)
- func (i *Installer) Capture(name string, logToStdout bool, input string, args ...string) (res string, err error)
- func (i *Installer) CheckACMEIsDone() error
- func (i *Installer) CheckAESHealth() error
- func (i *Installer) CheckAESServesACME() (err error)
- func (i *Installer) CheckHostnameFound() error
- func (i *Installer) ConfigureTLS(emailAddress string) (string, string, *http.Response, Result)
- func (i *Installer) CreateNamespace() error
- func (i *Installer) FindMatchingHostResource() (*k8s.Resource, error)
- func (i *Installer) FindingRepositoriesAndVersions()
- func (i *Installer) GrabAESInstallID() error
- func (i *Installer) GrabLoadBalancerAddress() error
- func (i *Installer) HostnameMatchesLBAddress(hostname string) bool
- func (i *Installer) NewSimpleKubectl() (res SimpleKubectl, err error)
- func (i *Installer) Perform(kcontext, cloudConnectToken string) Result
- func (i *Installer) Quit()
- func (i *Installer) Report(eventName string, meta ...client.ScoutMeta)
- func (i *Installer) SetMetadatum(name, key string, value interface{})
- func (i *Installer) ShowACMEFailed(reason string)
- func (i *Installer) ShowAESAlreadyInstalled()
- func (i *Installer) ShowAESCRDsButNoAESInstallation()
- func (i *Installer) ShowAESConfiguringTLS()
- func (i *Installer) ShowAESExistingVersion(versionName string, method string)
- func (i *Installer) ShowAESInstallAddress(address string)
- func (i *Installer) ShowAESInstallationComplete()
- func (i *Installer) ShowAESInstallationCompleteNoDNS()
- func (i *Installer) ShowAESInstallationPartiallyComplete()
- func (i *Installer) ShowAESRespondingToACME()
- func (i *Installer) ShowAESVersionBeingInstalled()
- func (i *Installer) ShowAOSSExistingVersion(versionName string, method string)
- func (i *Installer) ShowAcquiringDNSName(hostname string)
- func (i *Installer) ShowBeginAESInstallation()
- func (i *Installer) ShowBeginAOSSUpgrade()
- func (i *Installer) ShowCheckingAESPodDeployment()
- func (i *Installer) ShowDownloadingImages()
- func (i *Installer) ShowExistingHostFound(name, namespace string)
- func (i *Installer) ShowFailedToCreateDNSName(message string)
- func (i *Installer) ShowFailedWhenLookingForExistingVersion()
- func (i *Installer) ShowFirstInstalling()
- func (i *Installer) ShowFirstUpgrading()
- func (i *Installer) ShowInstalling(version string)
- func (i *Installer) ShowLocalClusterDetected()
- func (i *Installer) ShowLookingForExistingHost()
- func (i *Installer) ShowObtainingTLSCertificate()
- func (i *Installer) ShowOverridingChartVersion(aesChartVersion string, version string)
- func (i *Installer) ShowOverridingHelmRepo(aesHelmRepo string, repo string)
- func (i *Installer) ShowOverridingImageRepo(aesImageRepo string, repo string)
- func (i *Installer) ShowOverridingImageTag(aesImageTag string, tag string)
- func (i *Installer) ShowOverridingInstallOption(optionTag string, tagValue string)
- func (i *Installer) ShowProvisioningLoadBalancer()
- func (i *Installer) ShowRequestEmail()
- func (i *Installer) ShowResult(r Result)
- func (i *Installer) ShowScoutDisabled()
- func (i *Installer) ShowTLSConfiguredSuccessfully()
- func (i *Installer) ShowTemplated(text string, more ...AdditionalDatum)
- func (i *Installer) ShowTimedOut(what string)
- func (i *Installer) ShowUpgrading(version string)
- func (i *Installer) ShowWaiting(what string)
- func (i *Installer) ShowWrapped(texts ...string)
- type Kubectl
- type KubernetesVersion
- type LoopFailedError
- type Result
- type Runner
- type SimpleKubectl
- func (k SimpleKubectl) Apply(content, namespace string) error
- func (k SimpleKubectl) ClusterInfo() (string, error)
- func (k SimpleKubectl) Create(what, name, namespace string) error
- func (k SimpleKubectl) Describe(what, namespace string) (string, error)
- func (k SimpleKubectl) Exec(pod, cont, namespace string, args ...string) (string, error)
- func (k SimpleKubectl) Get(what, name, namespace string) (*unstructured.Unstructured, error)
- func (k SimpleKubectl) List(what, namespace string, labels []string) (*unstructured.Unstructured, error)
- func (k SimpleKubectl) Logs(what, namespace string, args ...string) (string, error)
- func (k SimpleKubectl) Run(args ...string) error
- func (k SimpleKubectl) RunAsBytes(args ...string) ([]byte, error)
- func (k SimpleKubectl) RunAsUnstructured(args ...string) (*unstructured.Unstructured, error)
- func (k SimpleKubectl) Version() (KubernetesVersion, error)
- func (k SimpleKubectl) WithStderr(writer io.Writer) Kubectl
- func (k SimpleKubectl) WithStdin(reader io.Reader) Kubectl
- func (k SimpleKubectl) WithStdout(writer io.Writer) Kubectl
- type UnstructuredAmbassadorInstallation
- func (u UnstructuredAmbassadorInstallation) GetConditions() []map[string]interface{}
- func (u UnstructuredAmbassadorInstallation) GetFlavor() (string, error)
- func (u UnstructuredAmbassadorInstallation) GetInstallOSS() bool
- func (u UnstructuredAmbassadorInstallation) GetInstalledVersion() (string, error)
- func (u UnstructuredAmbassadorInstallation) IsEmpty() bool
- func (u UnstructuredAmbassadorInstallation) IsInstalled() bool
- func (u UnstructuredAmbassadorInstallation) LastCondition() map[string]interface{}
- func (u UnstructuredAmbassadorInstallation) LastConditionExplain() (string, string)
- func (u UnstructuredAmbassadorInstallation) SetInstallOSS(installOSS bool) error
- type Upgrader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClusterInfo ¶
func NewClusterInfo(kubectl Kubectl) clusterInfo
Types ¶
type AdditionalDatum ¶
type AdditionalDatum struct {
// contains filtered or unexported fields
}
AdditionalDatum represents a key-value pair that may be used in template expansion
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer represents the state of the installation process
func NewInstaller ¶
NewInstaller returns an Installer object after setting up logging.
func (*Installer) Capture ¶
func (i *Installer) Capture(name string, logToStdout bool, input string, args ...string) (res string, err error)
Capture calls a command and returns its stdout
func (*Installer) CheckACMEIsDone ¶
CheckACMEIsDone queries the Host object and succeeds if its state is Ready.
func (*Installer) CheckAESHealth ¶
CheckAESHealth retrieves AES's idea of whether it is healthy, i.e. ready.
func (*Installer) CheckAESServesACME ¶
CheckAESServesACME performs the same checks that the edgestack.me name service performs against the AES load balancer host
func (*Installer) CheckHostnameFound ¶
CheckHostnameFound tries to connect to check-blah.hostname to see whether DNS has propagated. Each connect talks to a different hostname to try to avoid NXDOMAIN caching.
func (*Installer) ConfigureTLS ¶
ConfigureTLS configures TLS for a valid email address
func (*Installer) CreateNamespace ¶
CreateNamespace creates the namespace for installing AES
func (*Installer) FindMatchingHostResource ¶
FindMatchingHostResource returns a Host resource from the cluster that matches the load balancer's address. The Host resource must refer to a *.edgestack.me domain and be in the Ready state.
func (*Installer) FindingRepositoriesAndVersions ¶
func (i *Installer) FindingRepositoriesAndVersions()
func (*Installer) GrabAESInstallID ¶
GrabAESInstallID uses "kubectl exec" to ask the AES pod for the cluster's ID, which we uses as the AES install ID. This has the side effect of making sure the Pod is Running (though not necessarily Ready). This should be good enough to report the "deploy" status to metrics.
func (*Installer) GrabLoadBalancerAddress ¶
GrabLoadBalancerAddress retrieves the AES service load balancer's address (IP address or hostname)
func (*Installer) HostnameMatchesLBAddress ¶
HostnameMatchesLBAddress returns whether a *.edgestack.me hostname matches a load balancer address, which may be a name or an IP.
func (*Installer) NewSimpleKubectl ¶
func (i *Installer) NewSimpleKubectl() (res SimpleKubectl, err error)
NewSimpleKubectl creates a new, simple kubectl runner
func (*Installer) SetMetadatum ¶
SetMetadatum adds a key-value pair to the metrics extra traits field. All collected metadata is passed with every subsequent report to Metriton.
func (*Installer) ShowACMEFailed ¶
func (*Installer) ShowAESAlreadyInstalled ¶
func (i *Installer) ShowAESAlreadyInstalled()
AES already installed
func (*Installer) ShowAESCRDsButNoAESInstallation ¶
func (i *Installer) ShowAESCRDsButNoAESInstallation()
func (*Installer) ShowAESConfiguringTLS ¶
func (i *Installer) ShowAESConfiguringTLS()
func (*Installer) ShowAESExistingVersion ¶
func (*Installer) ShowAESInstallAddress ¶
func (*Installer) ShowAESInstallationComplete ¶
func (i *Installer) ShowAESInstallationComplete()
AES installation complete!
func (*Installer) ShowAESInstallationCompleteNoDNS ¶
func (i *Installer) ShowAESInstallationCompleteNoDNS()
AES installation complete, but no DNS.
func (*Installer) ShowAESInstallationPartiallyComplete ¶
func (i *Installer) ShowAESInstallationPartiallyComplete()
AES installation partially complete -- other instructions follow.
func (*Installer) ShowAESRespondingToACME ¶
func (i *Installer) ShowAESRespondingToACME()
func (*Installer) ShowAESVersionBeingInstalled ¶
func (i *Installer) ShowAESVersionBeingInstalled()
func (*Installer) ShowAOSSExistingVersion ¶
func (*Installer) ShowAcquiringDNSName ¶
func (*Installer) ShowBeginAESInstallation ¶
func (i *Installer) ShowBeginAESInstallation()
func (*Installer) ShowBeginAOSSUpgrade ¶
func (i *Installer) ShowBeginAOSSUpgrade()
func (*Installer) ShowCheckingAESPodDeployment ¶
func (i *Installer) ShowCheckingAESPodDeployment()
func (*Installer) ShowDownloadingImages ¶
func (i *Installer) ShowDownloadingImages()
func (*Installer) ShowExistingHostFound ¶
func (*Installer) ShowFailedToCreateDNSName ¶
func (*Installer) ShowFailedWhenLookingForExistingVersion ¶
func (i *Installer) ShowFailedWhenLookingForExistingVersion()
func (*Installer) ShowFirstInstalling ¶
func (i *Installer) ShowFirstInstalling()
First message when beginning the AES Installation process
func (*Installer) ShowFirstUpgrading ¶
func (i *Installer) ShowFirstUpgrading()
func (*Installer) ShowInstalling ¶
func (*Installer) ShowLocalClusterDetected ¶
func (i *Installer) ShowLocalClusterDetected()
func (*Installer) ShowLookingForExistingHost ¶
func (i *Installer) ShowLookingForExistingHost()
func (*Installer) ShowObtainingTLSCertificate ¶
func (i *Installer) ShowObtainingTLSCertificate()
func (*Installer) ShowOverridingChartVersion ¶
func (*Installer) ShowOverridingHelmRepo ¶
func (*Installer) ShowOverridingImageRepo ¶
func (*Installer) ShowOverridingImageTag ¶
func (*Installer) ShowOverridingInstallOption ¶
func (*Installer) ShowProvisioningLoadBalancer ¶
func (i *Installer) ShowProvisioningLoadBalancer()
func (*Installer) ShowRequestEmail ¶
func (i *Installer) ShowRequestEmail()
func (*Installer) ShowResult ¶
func (*Installer) ShowScoutDisabled ¶
func (i *Installer) ShowScoutDisabled()
func (*Installer) ShowTLSConfiguredSuccessfully ¶
func (i *Installer) ShowTLSConfiguredSuccessfully()
func (*Installer) ShowTemplated ¶
func (i *Installer) ShowTemplated(text string, more ...AdditionalDatum)
ShowTemplated displays a string to the user (using ShowWrapped) after rendering the supplied text as a template using values from the installer object and the additional parameters. It also processes color tags. TODO: Fix color tag processing so it is effective on Windows.
func (*Installer) ShowTimedOut ¶
func (*Installer) ShowUpgrading ¶
func (*Installer) ShowWaiting ¶
func (*Installer) ShowWrapped ¶
ShowWrapped displays to the user (via the show logger) the text items passed in with word wrapping applied. Leading and trailing newlines are dropped in each text item (to make it easier to use multiline constants), but newlines within each item are preserved. Use an empty string item to include a blank line in the output between other items.
type Kubectl ¶
type Kubectl interface { Runner Create(what, name, namespace string) error Apply(content, namespace string) error Get(what, name, namespace string) (*unstructured.Unstructured, error) List(what, namespace string, labels []string) (*unstructured.Unstructured, error) Exec(pod, cont, namespace string, args ...string) (string, error) Describe(what, namespace string) (string, error) Logs(what, namespace string, args ...string) (string, error) Version() (KubernetesVersion, error) ClusterInfo() (string, error) WithStdin(io.Reader) Kubectl WithStdout(io.Writer) Kubectl WithStderr(io.Writer) Kubectl }
Kubectl is a simple interface for an abstract kubectl
type KubernetesVersion ¶
type KubernetesVersion struct { Client k8sVersion.Info `json:"clientVersion"` Server k8sVersion.Info `json:"serverVersion"` }
type LoopFailedError ¶
type LoopFailedError string
LoopFailedError is a fatal error for loopUntil(...)
type Result ¶
type Result struct { Report string // Action to report to Metriton ShortMessage string // Short human-readable error message Message string // Message to show to the user TryAgain bool // Whether to show the "try again" message (TODO: Is this necessary?) URL string // Docs URL to show and open Err error // Error condition (nil -> successful installation) }
Result represents the result of an installation attempt
func UnhandledErrResult ¶
UnhandledErrResult returns a minimal Result that passes along an error but otherwise does not do anything. It is intended for transitional use, until *every* error is handled explicitly to yield a meaningful Result.
type SimpleKubectl ¶
type SimpleKubectl struct {
// contains filtered or unexported fields
}
SimpleKubectl is a simple `kubectl` wrapper
func (SimpleKubectl) Apply ¶
func (k SimpleKubectl) Apply(content, namespace string) error
func (SimpleKubectl) ClusterInfo ¶
func (k SimpleKubectl) ClusterInfo() (string, error)
func (SimpleKubectl) Create ¶
func (k SimpleKubectl) Create(what, name, namespace string) error
func (SimpleKubectl) Describe ¶
func (k SimpleKubectl) Describe(what, namespace string) (string, error)
func (SimpleKubectl) Exec ¶
func (k SimpleKubectl) Exec(pod, cont, namespace string, args ...string) (string, error)
func (SimpleKubectl) Get ¶
func (k SimpleKubectl) Get(what, name, namespace string) (*unstructured.Unstructured, error)
func (SimpleKubectl) List ¶
func (k SimpleKubectl) List(what, namespace string, labels []string) (*unstructured.Unstructured, error)
func (SimpleKubectl) Logs ¶
func (k SimpleKubectl) Logs(what, namespace string, args ...string) (string, error)
func (SimpleKubectl) Run ¶
func (k SimpleKubectl) Run(args ...string) error
func (SimpleKubectl) RunAsBytes ¶
func (k SimpleKubectl) RunAsBytes(args ...string) ([]byte, error)
func (SimpleKubectl) RunAsUnstructured ¶
func (k SimpleKubectl) RunAsUnstructured(args ...string) (*unstructured.Unstructured, error)
func (SimpleKubectl) Version ¶
func (k SimpleKubectl) Version() (KubernetesVersion, error)
func (SimpleKubectl) WithStderr ¶
func (k SimpleKubectl) WithStderr(writer io.Writer) Kubectl
func (SimpleKubectl) WithStdout ¶
func (k SimpleKubectl) WithStdout(writer io.Writer) Kubectl
type UnstructuredAmbassadorInstallation ¶
type UnstructuredAmbassadorInstallation struct {
unstructured.Unstructured
}
UnstructuredAmbassadorInstallation is an unstructured version of the AmbassadorInstallation CRD. Instead of importing the AmbassadorInstallation from the Operator, we keep it as an Unstructured, so we remove this problematic dependency...
func (UnstructuredAmbassadorInstallation) GetConditions ¶
func (u UnstructuredAmbassadorInstallation) GetConditions() []map[string]interface{}
func (UnstructuredAmbassadorInstallation) GetFlavor ¶
func (u UnstructuredAmbassadorInstallation) GetFlavor() (string, error)
func (UnstructuredAmbassadorInstallation) GetInstallOSS ¶
func (u UnstructuredAmbassadorInstallation) GetInstallOSS() bool
func (UnstructuredAmbassadorInstallation) GetInstalledVersion ¶
func (u UnstructuredAmbassadorInstallation) GetInstalledVersion() (string, error)
func (UnstructuredAmbassadorInstallation) IsEmpty ¶
func (u UnstructuredAmbassadorInstallation) IsEmpty() bool
func (UnstructuredAmbassadorInstallation) IsInstalled ¶
func (u UnstructuredAmbassadorInstallation) IsInstalled() bool
func (UnstructuredAmbassadorInstallation) LastCondition ¶
func (u UnstructuredAmbassadorInstallation) LastCondition() map[string]interface{}
LastCondition returns the last condition
func (UnstructuredAmbassadorInstallation) LastConditionExplain ¶
func (u UnstructuredAmbassadorInstallation) LastConditionExplain() (string, string)
func (UnstructuredAmbassadorInstallation) SetInstallOSS ¶
func (u UnstructuredAmbassadorInstallation) SetInstallOSS(installOSS bool) error
type Upgrader ¶
type Upgrader struct {
Installer
}
func NewUpgrader ¶
NewUpgrader returns an Installer object after setting up logging.