Documentation ¶
Index ¶
- func FindAuthTokenFromAssetStore(assetDir string) (string, error)
- func FindRendezvouIPAndSSHKeyFromAssetStore(assetDir string) (string, string, error)
- func MonitorAddNodes(ctx context.Context, clusters []*Cluster, ipAddresses []string)
- func MonitorSingleNode(waitContext context.Context, cluster *Cluster, nodeIPAddress string, ...)
- func WaitForBootstrapComplete(cluster *Cluster) error
- func WaitForInstallComplete(cluster *Cluster) error
- type Cluster
- func (czero *Cluster) CanSSHToNodeZero() bool
- func (czero *Cluster) GetClusterRestAPIMetadata() (*models.Cluster, error)
- func (czero *Cluster) HasErrored(status string) (bool, string)
- func (czero *Cluster) IsBootstrapComplete() (bool, bool, error)
- func (czero *Cluster) IsClusterStuckInReady() (bool, error)
- func (czero *Cluster) IsInstallComplete() (bool, error)
- func (czero *Cluster) IsInstalling(status string) (bool, string)
- func (czero *Cluster) MonitorStatusFromAssistedService() (bool, error)
- func (czero *Cluster) PrintInfraEnvRestAPIEventList()
- func (czero *Cluster) PrintInstallStatus(cluster *models.Cluster)
- func (czero *Cluster) PrintInstallationComplete() error
- type ClusterKubeAPIClient
- func (kube *ClusterKubeAPIClient) DoesKubeConfigExist() (bool, error)
- func (kube *ClusterKubeAPIClient) IsBootstrapConfigMapComplete() (bool, error)
- func (kube *ClusterKubeAPIClient) IsKubeAPILive() bool
- func (kube *ClusterKubeAPIClient) ListCSRs() (*certificatesv1.CertificateSigningRequestList, error)
- func (kube *ClusterKubeAPIClient) ListNodes() (*corev1.NodeList, error)
- type ClusterOpenShiftAPIClient
- func (ocp *ClusterOpenShiftAPIClient) AreClusterOperatorsInitialized() (bool, error)
- func (ocp *ClusterOpenShiftAPIClient) IsConsoleRouteAvailable() (bool, error)
- func (ocp *ClusterOpenShiftAPIClient) IsConsoleRouteURLAvailable() (bool, string, error)
- func (ocp *ClusterOpenShiftAPIClient) LogClusterOperatorConditions() error
- type NodeZeroRestClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAuthTokenFromAssetStore ¶ added in v0.90.17
FindAuthTokenFromAssetStore returns the auth token from asset store.
func FindRendezvouIPAndSSHKeyFromAssetStore ¶ added in v0.90.0
FindRendezvouIPAndSSHKeyFromAssetStore returns the rendezvousIP and public ssh key.
func MonitorAddNodes ¶ added in v0.90.0
MonitorAddNodes display the progress of one or more nodes being added to a cluster. ipAddresses is an array of IP addresses to be monitored. clusters is an array of their corresponding initialized Cluster struct used to interact with the assisted-service and k8s APIs.
func MonitorSingleNode ¶ added in v0.90.17
func MonitorSingleNode(waitContext context.Context, cluster *Cluster, nodeIPAddress string, wg *sync.WaitGroup)
MonitorSingleNode waits for the a node to be added to the cluster and reports its status until it becomes Ready.
func WaitForBootstrapComplete ¶
WaitForBootstrapComplete Wait for the bootstrap process to complete on cluster installations triggered by the agent installer.
func WaitForInstallComplete ¶
WaitForInstallComplete Waits for the cluster installation triggered by the agent installer to be complete.
Types ¶
type Cluster ¶
type Cluster struct { Ctx context.Context API *clientSet // contains filtered or unexported fields }
Cluster is a struct designed to help interact with the cluster that is currently being installed by agent installer.
func NewCluster ¶
func NewCluster(ctx context.Context, assetDir, rendezvousIP, kubeconfigPath, sshKey string, workflowType workflow.AgentWorkflowType) (*Cluster, error)
NewCluster initializes a Cluster object
func (*Cluster) CanSSHToNodeZero ¶
CanSSHToNodeZero Checks if ssh to NodeZero succeeds.
func (*Cluster) GetClusterRestAPIMetadata ¶
GetClusterRestAPIMetadata Retrieve the current cluster metadata from the Agent Rest API
func (*Cluster) HasErrored ¶
HasErrored Determine if the cluster installation has errored using the models from the Agent Rest API.
func (*Cluster) IsBootstrapComplete ¶
IsBootstrapComplete (is-bootstrap-complete, exit-on-error, returned-error) IsBootstrapComplete Determine if the cluster has completed the bootstrap process.
func (*Cluster) IsClusterStuckInReady ¶
IsClusterStuckInReady Determine if the cluster has stopped transitioning out of the Ready state
func (*Cluster) IsInstallComplete ¶
IsInstallComplete Determine if the cluster has completed installation.
func (*Cluster) IsInstalling ¶
IsInstalling Determine if the cluster is still installing using the models from the Agent Rest API.
func (*Cluster) MonitorStatusFromAssistedService ¶ added in v0.90.0
MonitorStatusFromAssistedService (exit-on-error, returned-error) checks if the Assisted Service API is up, and both cluster and infraenv have been registered.
After those preconditions are met, it then reports on the host validation status and overall cluster status and updates the cluster's install history.
After cluster or host installation has started, new events from the Assisted Service API are also logged and updated to the cluster's install history.
func (*Cluster) PrintInfraEnvRestAPIEventList ¶
func (czero *Cluster) PrintInfraEnvRestAPIEventList()
PrintInfraEnvRestAPIEventList Prints the whole event list for debugging
func (*Cluster) PrintInstallStatus ¶
PrintInstallStatus Print a human friendly message using the models from the Agent Rest API.
func (*Cluster) PrintInstallationComplete ¶
PrintInstallationComplete Prints the installation complete information
type ClusterKubeAPIClient ¶
type ClusterKubeAPIClient struct { Client *kubernetes.Clientset // contains filtered or unexported fields }
ClusterKubeAPIClient is a kube client to interact with the cluster that agent installer is installing.
func NewClusterKubeAPIClient ¶
func NewClusterKubeAPIClient(ctx context.Context, kubeconfigPath string) (*ClusterKubeAPIClient, error)
NewClusterKubeAPIClient Create a new kube client to interact with the cluster under install.
func (*ClusterKubeAPIClient) DoesKubeConfigExist ¶
func (kube *ClusterKubeAPIClient) DoesKubeConfigExist() (bool, error)
DoesKubeConfigExist Determine if the kubeconfig for the cluster can be used without errors.
func (*ClusterKubeAPIClient) IsBootstrapConfigMapComplete ¶
func (kube *ClusterKubeAPIClient) IsBootstrapConfigMapComplete() (bool, error)
IsBootstrapConfigMapComplete Detemine if the cluster's bootstrap configmap has the status complete.
func (*ClusterKubeAPIClient) IsKubeAPILive ¶
func (kube *ClusterKubeAPIClient) IsKubeAPILive() bool
IsKubeAPILive Determine if the cluster under install has initailized the kubenertes API.
func (*ClusterKubeAPIClient) ListCSRs ¶ added in v0.90.0
func (kube *ClusterKubeAPIClient) ListCSRs() (*certificatesv1.CertificateSigningRequestList, error)
ListCSRs returns a list of this cluster's CSRs.
type ClusterOpenShiftAPIClient ¶
type ClusterOpenShiftAPIClient struct { ConfigClient *configclient.Clientset RouteClient *routeclient.Clientset // contains filtered or unexported fields }
ClusterOpenShiftAPIClient Kube client using the OpenShift clientset instead of the Kubernetes clientset
func NewClusterOpenShiftAPIClient ¶
func NewClusterOpenShiftAPIClient(ctx context.Context, kubeconfigPath string) (*ClusterOpenShiftAPIClient, error)
NewClusterOpenShiftAPIClient Create a kube client with OCP understanding
func (*ClusterOpenShiftAPIClient) AreClusterOperatorsInitialized ¶
func (ocp *ClusterOpenShiftAPIClient) AreClusterOperatorsInitialized() (bool, error)
AreClusterOperatorsInitialized Waits for all Openshift cluster operators to initialize
func (*ClusterOpenShiftAPIClient) IsConsoleRouteAvailable ¶
func (ocp *ClusterOpenShiftAPIClient) IsConsoleRouteAvailable() (bool, error)
IsConsoleRouteAvailable Check if the OCP console route is created
func (*ClusterOpenShiftAPIClient) IsConsoleRouteURLAvailable ¶
func (ocp *ClusterOpenShiftAPIClient) IsConsoleRouteURLAvailable() (bool, string, error)
IsConsoleRouteURLAvailable Check if the console route URL is available
func (*ClusterOpenShiftAPIClient) LogClusterOperatorConditions ¶
func (ocp *ClusterOpenShiftAPIClient) LogClusterOperatorConditions() error
LogClusterOperatorConditions Log OCP cluster operator conditions
type NodeZeroRestClient ¶
type NodeZeroRestClient struct { Client *client.AssistedInstall NodeZeroIP string NodeSSHKey []string // contains filtered or unexported fields }
NodeZeroRestClient is a struct to interact with the Agent Rest API that is on node zero.
func NewNodeZeroRestClient ¶
func NewNodeZeroRestClient(ctx context.Context, rendezvousIP, sshKey, token string) *NodeZeroRestClient
NewNodeZeroRestClient Initialize a new rest client to interact with the Agent Rest API on node zero.
func (*NodeZeroRestClient) GetInfraEnvEvents ¶
func (rest *NodeZeroRestClient) GetInfraEnvEvents(infraEnvID *strfmt.UUID) (models.EventList, error)
GetInfraEnvEvents Return the event list for the provided infraEnvID from the Agent Rest API
func (*NodeZeroRestClient) GetRestAPIServiceBaseURL ¶
func (rest *NodeZeroRestClient) GetRestAPIServiceBaseURL() *url.URL
GetRestAPIServiceBaseURL Return the url of the Agent Rest API on node zero
func (*NodeZeroRestClient) IsRestAPILive ¶
func (rest *NodeZeroRestClient) IsRestAPILive() bool
IsRestAPILive Determine if the Agent Rest API on node zero has initialized