Documentation
¶
Index ¶
- Constants
- func InitializeRedisClient(address string, password string, db int) *redis.Client
- func InitializeRedisClientFromConfig(ctx context.Context, config *Config, sugar *zap.SugaredLogger) *redis.Client
- func ParseCsvIpAddressString(csv string) []net.IP
- type ComputeConfiguration
- type ComputeCost
- type ComputeType
- type Config
- type KubernetesClientWrapper
- type MetricsClientWrapper
- type MetricsContainer
- type MetricsNode
- type MetricsNodeList
- type MetricsPod
- type MetricsPodList
- type PriorityEnum
- type RealKubernetesClient
- func (r *RealKubernetesClient) ListNamespaces(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error)
- func (r *RealKubernetesClient) ListNodes(ctx context.Context, opts metav1.ListOptions) (*corev1.NodeList, error)
- func (r *RealKubernetesClient) ListPods(ctx context.Context, namespace string, opts metav1.ListOptions) (*corev1.PodList, error)
- type RealMetricsClient
- type WeightedInteruptionRate
- type WeightedLatencyRate
- type WeightedNode
- type WeightedPod
Constants ¶
View Source
const ( AnnotationDiskType = "ultron.io/disk-type" AnnotationNetworkType = "ultron.io/network-type" AnnotationStorageSize = "ultron.io/storage-size" AnnotationPriority = "ultron.io/priority" AnnotationManaged = "ultron.io/managed" BlockTypeCertificate = "CERTIFICATE" BlockTypeRsaPrivateKey = "RSA PRIVATE KEY" CacheKeyWeightedNodes = "ULTRON_WEIGHTED_NODES" CacheKeyDurableComputeConfigurations = "ULTRON_DURABLE_CONFIGURATION" CacheKeyDurableComputeConfigurationLatencyRates = "ULTRON_DURABLE_COMPUTECONFIGURATION_LATENCY_RATES" CacheKeyEphemeralComputeConfigurations = "ULTRON_EPHEMERAL_COMPUTECONFIGURATION" CacheKeyEphemeralComputeConfigurationInteruptionRates = "ULTRON_EPHEMERAL_COMPUTECONFIGURATION_INTERUPTION_RATES" ComputeTypeDurable ComputeType = "durable" ComputeTypeEphemeral ComputeType = "ephemeral" DefaultDiskType = "SSD" DefaultNetworkType = "isolated" DefaultStorageSizeGB = 10.0 DefaultPriority = PriorityLow DefaultDurableInstanceType = "ultron.durable" DefaultEphemeralInstanceType = "ultron.ephemeral" EnvServerAddress = "ULTRON_SERVER_ADDRESS" EnvServerCertificateOrganization = "ULTRON_SERVER_CERTIFICATE_ORGANIZATION" EnvServerCertificateCommonName = "ULTRON_SERVER_CERTIFICATE_COMMON_NAME" EnvServerCertificateDnsNames = "ULTRON_SERVER_CERTIFICATE_DNS_NAMES" EnvServerCertificateIpAddresses = "ULTRON_SERVER_CERTIFICATE_IP_ADDRESSES" EnvServerCertificateExportPath = "ULTRON_SERVER_CERTIFICATE_EXPORT_PATH" EnvRedisServerAddress = "ULTRON_SERVER_REDIS_ADDRESS" EnvRedisServerPassword = "ULTRON_SERVER_REDIS_PASSWORD" EnvRedisServerDatabase = "ULTRON_SERVER_REDIS_DATABASE" EnvKubernetesConfig = "KUBECONFIG" EnvKubernetesServiceHost = "KUBERNETES_SERVICE_HOST" EnvKubernetesServicePort = "KUBERNETES_SERVICE_PORT" LabelHostName = "kubernetes.io/hostname" LabelInstanceType = "node.kubernetes.io/instance-type" MetadataName = "metadata.name" MetricKeyCpuUsage = "cpu_usage" MetricKeyCpuTotal = "cpu_total" MetricKeyMemoryUsage = "memory_usage" MetricKeyMemoryTotal = "memory_total" PriorityLow PriorityEnum = false PriorityHigh PriorityEnum = true TopicNodeObserve = "ULTRON_TOPIC_NODE_OBSERVE" TopicPodObserve = "ULTRON_TOPIC_POD_OBSERVE" )
Variables ¶
This section is empty.
Functions ¶
func InitializeRedisClient ¶ added in v0.1.3
func InitializeRedisClientFromConfig ¶ added in v0.1.4
func InitializeRedisClientFromConfig(ctx context.Context, config *Config, sugar *zap.SugaredLogger) *redis.Client
func ParseCsvIpAddressString ¶ added in v0.3.2
Types ¶
type ComputeConfiguration ¶
type ComputeConfiguration struct { Id *int32 `json:"id,omitempty"` ProviderId *int32 `json:"providerId,omitempty"` ProviderName *string `json:"providerName,omitempty"` LocationId *int32 `json:"locationId,omitempty"` LocationName *string `json:"locationName,omitempty"` DataCenterId *string `json:"dataCenterId,omitempty"` DataCenterName *string `json:"dataCenterName,omitempty"` OsId *int32 `json:"osId,omitempty"` OsType *string `json:"osType,omitempty"` OsVersion *string `json:"osVersion,omitempty"` CloudNetworkTypes []string `json:"cloudNetworkTypes,omitempty"` VCpuType *string `json:"vCpuType,omitempty"` VCpu *int32 `json:"vCpu,omitempty"` RamGb *int32 `json:"ramGb,omitempty"` VolumeGb *int32 `json:"volumeGb,omitempty"` VolumeType *string `json:"volumeType,omitempty"` Cost *ComputeCost `json:"cost,omitempty"` ComputeType ComputeType `json:"computeType,omitempty"` }
type ComputeCost ¶ added in v0.0.6
type ComputeType ¶
type ComputeType string
type Config ¶ added in v0.1.3
type Config struct { RedisServerAddress string RedisServerPassword string RedisServerDatabase int ServerAddress string CertificateOrganization string CertificateCommonName string CertificateDnsNamesCSV string CertificateIpAddressesCSV string CertificateExportPath string }
func LoadConfig ¶ added in v0.1.3
type KubernetesClientWrapper ¶ added in v0.2.0
type KubernetesClientWrapper struct {
ClientSet *kubernetes.Clientset
}
func (*KubernetesClientWrapper) CoreV1 ¶ added in v0.2.0
func (k *KubernetesClientWrapper) CoreV1() v1.CoreV1Interface
type MetricsClientWrapper ¶ added in v0.2.0
type MetricsClientWrapper struct {
ClientSet *metricsclient.Clientset
}
func (*MetricsClientWrapper) MetricsV1beta1 ¶ added in v0.2.0
func (m *MetricsClientWrapper) MetricsV1beta1() metricsv1beta1.MetricsV1beta1Interface
type MetricsContainer ¶ added in v0.2.0
type MetricsContainer struct { Name string Usage corev1.ResourceList }
type MetricsNode ¶ added in v0.2.0
type MetricsNode struct { Name string Usage corev1.ResourceList }
type MetricsNodeList ¶ added in v0.2.0
type MetricsNodeList struct {
Items []MetricsNode
}
type MetricsPod ¶ added in v0.2.0
type MetricsPod struct { Name string Namespace string Containers []MetricsContainer }
type MetricsPodList ¶ added in v0.2.0
type MetricsPodList struct {
Items []MetricsPod
}
type PriorityEnum ¶
type PriorityEnum bool
func (PriorityEnum) String ¶
func (p PriorityEnum) String() string
type RealKubernetesClient ¶ added in v0.2.0
type RealKubernetesClient struct {
ClientSet *kubernetes.Clientset
}
func (*RealKubernetesClient) ListNamespaces ¶ added in v0.2.0
func (r *RealKubernetesClient) ListNamespaces(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error)
func (*RealKubernetesClient) ListNodes ¶ added in v0.2.0
func (r *RealKubernetesClient) ListNodes(ctx context.Context, opts metav1.ListOptions) (*corev1.NodeList, error)
type RealMetricsClient ¶ added in v0.2.0
type RealMetricsClient struct {
ClientSet *metricsclient.Clientset
}
func (*RealMetricsClient) ListNodeMetrics ¶ added in v0.2.0
func (r *RealMetricsClient) ListNodeMetrics(ctx context.Context, opts metav1.ListOptions) (*MetricsNodeList, error)
func (*RealMetricsClient) ListPodMetrics ¶ added in v0.2.0
func (r *RealMetricsClient) ListPodMetrics(ctx context.Context, namespace string, opts metav1.ListOptions) (*MetricsPodList, error)
type WeightedInteruptionRate ¶
type WeightedLatencyRate ¶
type WeightedNode ¶
type WeightedNode struct { Selector map[string]string AvailableCPU float64 TotalCPU float64 AvailableMemory float64 TotalMemory float64 AvailableStorage float64 TotalStorage float64 DiskType string NetworkType string Price float64 MedianPrice float64 InstanceType string InterruptionRate WeightedInteruptionRate LatencyRate WeightedLatencyRate }
Click to show internal directories.
Click to hide internal directories.