Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppLensActions ¶
type AppLensActions interface {
AppLensGetDetector(ctx context.Context, detectorId string) ([]byte, error)
AppLensListDetectors(ctx context.Context) ([]byte, error)
}
func NewAppLensActions ¶
func NewAppLensActions(log *logrus.Entry, env env.Interface, oc *api.OpenShiftCluster, subscriptionDoc *api.SubscriptionDocument, ) (AppLensActions, error)
type AzureActions ¶
type AzureActions interface {
GroupResourceList(ctx context.Context) ([]mgmtfeatures.GenericResourceExpanded, error)
ResourcesList(ctx context.Context, resources []mgmtfeatures.GenericResourceExpanded, writer io.WriteCloser) error
WriteToStream(ctx context.Context, writer io.WriteCloser) error
NICReconcileFailedState(ctx context.Context, nicName string) error
VMRedeployAndWait(ctx context.Context, vmName string) error
VMStartAndWait(ctx context.Context, vmName string) error
VMStopAndWait(ctx context.Context, vmName string, deallocateVM bool) error
VMSizeList(ctx context.Context) ([]string, error)
VMGetSKUs(ctx context.Context, vmSizes []string) (map[string]*sdkcompute.ResourceSKU, error)
VMResize(ctx context.Context, vmName string, vmSize string) error
ResourceGroupHasVM(ctx context.Context, vmName string) (bool, error)
VMSerialConsole(ctx context.Context, log *logrus.Entry, vmName string, target io.Writer) error
ResourceDeleteAndWait(ctx context.Context, resourceID string) error
GetEffectiveRouteTable(ctx context.Context, nicName string) ([]byte, error)
GetVirtualMachine(ctx context.Context, resourceGroupName string, VMName string, expand mgmtcompute.InstanceViewTypes) (result mgmtcompute.VirtualMachine, err error)
}
AzureActions contains those actions which rely solely on Azure clients, not using any k8s clients
func NewAzureActions ¶
func NewAzureActions(log *logrus.Entry, env env.Interface, oc *api.OpenShiftCluster, subscriptionDoc *api.SubscriptionDocument, ) (AzureActions, error)
NewAzureActions returns an azureActions
type ContainerMetrics ¶
type ContainerMetrics struct {
Name string `json:"name"`
CPU string `json:"cpu"`
Memory string `json:"memory"`
}
ContainerMetrics is used to store individual container resource usage (not directly used in current code).
type KubeActions ¶
type KubeActions interface {
KubeGet(ctx context.Context, groupKind, namespace, name string) ([]byte, error)
KubeList(ctx context.Context, groupKind, namespace string) ([]byte, error)
KubeCreateOrUpdate(ctx context.Context, obj *unstructured.Unstructured) error
KubeDelete(ctx context.Context, groupKind, namespace, name string, force bool, propagationPolicy *metav1.DeletionPropagation) error
ResolveGVR(groupKind string, optionalVersion string) (schema.GroupVersionResource, error)
CordonNode(ctx context.Context, nodeName string, unschedulable bool) error
DrainNode(ctx context.Context, nodeName string) error
ApproveCsr(ctx context.Context, csrName string) error
ApproveAllCsrs(ctx context.Context) error
KubeGetPodLogs(ctx context.Context, namespace, name, containerName string) ([]byte, error)
// kubeWatch returns a watch object for the provided label selector key
KubeWatch(ctx context.Context, o *unstructured.Unstructured, label string) (watch.Interface, error)
// Fetch top pods and nodes metrics
TopPods(ctx context.Context, restConfig *restclient.Config, allNamespaces bool) ([]PodMetrics, error)
TopNodes(ctx context.Context, restConfig *restclient.Config) ([]NodeMetrics, error)
CheckAPIServerReadyz(ctx context.Context) error
}
KubeActions are those that involve k8s objects, and thus depend upon k8s clients being createable
func NewKubeActions ¶
func NewKubeActions(log *logrus.Entry, env env.Interface, oc *api.OpenShiftCluster) (KubeActions, error)
NewKubeActions returns a kubeActions
type NodeMetrics ¶
type NodeMetrics struct {
NodeName string `json:"nodeName"`
CPUUsage string `json:"cpuUsage"`
MemoryUsage string `json:"memoryUsage"`
CPUPercentage float64 `json:"cpuPercentage"`
MemoryPercentage float64 `json:"memoryPercentage"`
}
NodeMetrics contains resource usage and percentage for a node.
type PodMetrics ¶
type PodMetrics struct {
Namespace string `json:"namespace"`
PodName string `json:"podName"`
NodeName string `json:"nodeName"`
CPUUsage string `json:"cpuUsage"`
MemoryUsage string `json:"memoryUsage"`
CPUPercentage float64 `json:"cpuPercentage"`
MemoryPercentage float64 `json:"memoryPercentage"`
}
PodMetrics contains resource usage and percentage for a pod.
Click to show internal directories.
Click to hide internal directories.