agent

package
v0.91.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindAuthTokenFromAssetStore added in v0.90.17

func FindAuthTokenFromAssetStore(assetDir string) (string, error)

FindAuthTokenFromAssetStore returns the auth token from asset store.

func FindRendezvouIPAndSSHKeyFromAssetStore added in v0.90.0

func FindRendezvouIPAndSSHKeyFromAssetStore(assetDir string) (string, string, error)

FindRendezvouIPAndSSHKeyFromAssetStore returns the rendezvousIP and public ssh key.

func MonitorAddNodes added in v0.90.0

func MonitorAddNodes(ctx context.Context, clusters []*Cluster, ipAddresses []string)

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

func WaitForBootstrapComplete(cluster *Cluster) error

WaitForBootstrapComplete Wait for the bootstrap process to complete on cluster installations triggered by the agent installer.

func WaitForInstallComplete

func WaitForInstallComplete(cluster *Cluster) error

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

func (czero *Cluster) CanSSHToNodeZero() bool

CanSSHToNodeZero Checks if ssh to NodeZero succeeds.

func (*Cluster) GetClusterRestAPIMetadata

func (czero *Cluster) GetClusterRestAPIMetadata() (*models.Cluster, error)

GetClusterRestAPIMetadata Retrieve the current cluster metadata from the Agent Rest API

func (*Cluster) HasErrored

func (czero *Cluster) HasErrored(status string) (bool, string)

HasErrored Determine if the cluster installation has errored using the models from the Agent Rest API.

func (*Cluster) IsBootstrapComplete

func (czero *Cluster) IsBootstrapComplete() (bool, bool, error)

IsBootstrapComplete (is-bootstrap-complete, exit-on-error, returned-error) IsBootstrapComplete Determine if the cluster has completed the bootstrap process.

func (*Cluster) IsClusterStuckInReady

func (czero *Cluster) IsClusterStuckInReady() (bool, error)

IsClusterStuckInReady Determine if the cluster has stopped transitioning out of the Ready state

func (*Cluster) IsInstallComplete

func (czero *Cluster) IsInstallComplete() (bool, error)

IsInstallComplete Determine if the cluster has completed installation.

func (*Cluster) IsInstalling

func (czero *Cluster) IsInstalling(status string) (bool, string)

IsInstalling Determine if the cluster is still installing using the models from the Agent Rest API.

func (*Cluster) MonitorStatusFromAssistedService added in v0.90.0

func (czero *Cluster) MonitorStatusFromAssistedService() (bool, error)

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

func (czero *Cluster) PrintInstallStatus(cluster *models.Cluster)

PrintInstallStatus Print a human friendly message using the models from the Agent Rest API.

func (*Cluster) PrintInstallationComplete

func (czero *Cluster) PrintInstallationComplete() error

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

ListCSRs returns a list of this cluster's CSRs.

func (*ClusterKubeAPIClient) ListNodes added in v0.90.0

func (kube *ClusterKubeAPIClient) ListNodes() (*corev1.NodeList, error)

ListNodes returns a list of nodes that have joined the cluster.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL