Documentation
¶
Index ¶
- Constants
- func DiscardPreviousMachines(prevMachineDetails map[string]MachineInfo, ...)
- func EditMachineSets(machineClient *machinev1beta1.MachineV1beta1Client, ...)
- func FinalizeMetrics(machineSetsToEdit *sync.Map, scaledMachineDetails map[string]MachineInfo, ...)
- func GetCAPIClient(restConfig *rest.Config) client.Client
- func GetCapiMachines(capiClient client.Client, scaleEventEpoch int64, clusterID string, ...) (map[string]MachineInfo, string)
- func GetHCNamespace(clientset kubernetes.Interface, clusterID string) string
- func GetMachineClient(restConfig *rest.Config) *machinev1beta1.MachineV1beta1Client
- func GetMachines(machineClient *machinev1beta1.MachineV1beta1Client, scaleEventEpoch int64) (map[string]MachineInfo, string)
- func GetMachinesets(machineClient *machinev1beta1.MachineV1beta1Client) map[int][]string
- func Int32Ptr(i int32) *int32
- func SetupMetrics(uuid string, metadata map[string]interface{}, ...)
- func WaitForCAPIMachineSets(capiClient client.Client, clusterID string, namespace string) error
- func WaitForMachineSet(machineClient *machinev1beta1.MachineV1beta1Client, name string, ...) error
- func WaitForNodes(clientset kubernetes.Interface) error
- func WaitForWorkerMachineSets(machineClient *machinev1beta1.MachineV1beta1Client) error
- type AWSProviderSpec
- type MachineInfo
- type MachineSetInfo
- type NodeReadyMetric
- type ProviderStatus
- type ProviderStatusCondition
- type ScaleConfig
- type Scenario
Constants ¶
const AutoScalerBuffer = 10
const DefaultClusterAutoScaler = "default"
const DefaultNamespace = "default"
const JobName = "workers-scale"
Resource constants
const MachineNamespace = "openshift-machine-api"
const TenMinutes = 600
Variables ¶
This section is empty.
Functions ¶
func DiscardPreviousMachines ¶
func DiscardPreviousMachines(prevMachineDetails map[string]MachineInfo, currentMachineDetails map[string]MachineInfo)
DiscardPreviousMachines updates the current machines details discarding the previous ones
func EditMachineSets ¶
func EditMachineSets(machineClient *machinev1beta1.MachineV1beta1Client, clientSet kubernetes.Interface, machineSetsToEdit *sync.Map, isScaleUp bool)
EditMachineSets edits machinesets parallelly
func FinalizeMetrics ¶
func FinalizeMetrics(machineSetsToEdit *sync.Map, scaledMachineDetails map[string]MachineInfo, metadata map[string]interface{}, indexerValue indexers.Indexer, amiID string, scaleEventEpoch int64)
FinalizeMetrics performs and indexes required metrics
func GetCAPIClient ¶
GetCAPIClient create a cluster api client
func GetCapiMachines ¶
func GetCapiMachines(capiClient client.Client, scaleEventEpoch int64, clusterID string, namespace string) (map[string]MachineInfo, string)
GetCapiMachines to fetch cluster api kind machines
func GetHCNamespace ¶
func GetHCNamespace(clientset kubernetes.Interface, clusterID string) string
GetHCNamespace gets the longest hosted cluster namespace from management cluster
func GetMachineClient ¶
func GetMachineClient(restConfig *rest.Config) *machinev1beta1.MachineV1beta1Client
GetMachineClient creates a reusable machine client
func GetMachines ¶
func GetMachines(machineClient *machinev1beta1.MachineV1beta1Client, scaleEventEpoch int64) (map[string]MachineInfo, string)
GetMachines lists all worker machines in the cluster
func GetMachinesets ¶
func GetMachinesets(machineClient *machinev1beta1.MachineV1beta1Client) map[int][]string
GetMachinesets lists all machinesets
func SetupMetrics ¶
func SetupMetrics(uuid string, metadata map[string]interface{}, kubeClientProvider *config.KubeClientProvider)
SetupMetrics sets up the measurment factory for us
func WaitForCAPIMachineSets ¶
WaitForWorkerMachineSets waits for all the cluster-api type worker machinesets in specific to be ready
func WaitForMachineSet ¶
func WaitForMachineSet(machineClient *machinev1beta1.MachineV1beta1Client, name string, newReplicaCount int32) error
WaitForMachineSet waits for machinesets to be ready with new replica count
func WaitForNodes ¶
func WaitForNodes(clientset kubernetes.Interface) error
WaitForNodes waits for all the nodes to be ready
func WaitForWorkerMachineSets ¶
func WaitForWorkerMachineSets(machineClient *machinev1beta1.MachineV1beta1Client) error
WaitForWorkerMachineSets waits for all the worker machinesets in specific to be ready
Types ¶
type AWSProviderSpec ¶
type AWSProviderSpec struct { AMI struct { ID string `json:"id"` } `json:"ami"` }
Struct to extract AMIID from aws provider spec
type MachineInfo ¶
type MachineInfo struct {
// contains filtered or unexported fields
}
MachineInfo provides information about a machine resource
type MachineSetInfo ¶
MachineSetInfo provides information about a machineset resource
type NodeReadyMetric ¶
type NodeReadyMetric struct { Timestamp time.Time `json:"timestamp"` ScaleEventTimestamp time.Time `json:"scaleEventTimestamp"` MachineCreationTimestamp time.Time `json:"-"` MachineCreationLatency int `json:"machineCreationLatency"` MachineReadyTimestamp time.Time `json:"-"` MachineReadyLatency int `json:"machineReadyLatency"` NodeCreationTimestamp time.Time `json:"-"` NodeCreationLatency int `json:"nodeCreationLatency"` NodeReadyTimestamp time.Time `json:"-"` NodeReadyLatency int `json:"nodeReadyLatency"` MetricName string `json:"metricName"` AMIID string `json:"amiID"` UUID string `json:"uuid"` JobName string `json:"jobName,omitempty"` Name string `json:"nodeName"` Labels map[string]string `json:"labels"` Metadata interface{} `json:"metadata,omitempty"` }
NodeReadyMetric to capture details on node bootup
type ProviderStatus ¶
type ProviderStatus struct {
Conditions []ProviderStatusCondition `json:"conditions"`
}
ProviderStatus of a machine
type ProviderStatusCondition ¶
type ProviderStatusCondition struct { LastTransitionTime metav1.Time `json:"lastTransitionTime"` Message string `json:"message"` Reason string `json:"reason"` Status string `json:"status"` Type string `json:"type"` }
ProviderStatusCondition of a machine
type ScaleConfig ¶
type ScaleConfig struct { UUID string AdditionalWorkerNodes int Metadata map[string]interface{} Indexer indexers.Indexer GC bool ScaleEventEpoch int64 AutoScalerEnabled bool MCKubeConfig string IsHCP bool }
ScaleConfig contains configuration for scaling
type Scenario ¶
type Scenario interface {
OrchestrateWorkload(ScaleConfig) string
}
Interface for our scenarios