Class KubeClusterAdvice
Holds cluster configuration advice initialized early during cluster setup. This is used to centralize the decisions about things like resource limitations and node taints/affinity based on the overall resources available to the cluster.
Namespace: Neon.Kube
Assembly: Neon.Kube.dll
Syntax
public class KubeClusterAdvice
Remarks
KubeClusterAdvice maintains a dictionary of KubeServiceAdvice instances keyed by the service identity (one of the service identify constants defined here). The constructor initializes empty advice instances for each of the known NEONKUBE services.
The basic idea here is that an early setup step will be executed that constructs a KubeClusterAdvice instance, determines resource and other limitations holistically based on the cluster hosting environment as well as the total resources available to the cluster, potentially priortizing resource assignments to some services over others. The step will persist the KubeClusterAdvice to the setup controller state as the ClusterAdvice property so this information will be available to all other deployment steps.
KubeServiceAdvice inherits from ObjectDictionary and can hold arbitrary key/values. The idea is to make it easy to add custom values to the advice for a service that can be picked up in subsequent deployment steps and used for things like initializing Helm chart values.
Although KubeServiceAdvice can hold arbitrary key/values, we've defined class properties to manage the common service properties:
PodCpuLimit | double: Identifies the property specifying the maximum CPU to assign to each service pod. |
PodCpuRequest | double: Identifies the property specifying the CPU to reserve for each service pod. |
PodMemoryLimit | decimal: Identifies the property specifying the maxumum bytes RAM that can be consumed by each service pod. |
PodMemoryRequest | decimal: Identifies the property specifying the bytes of RAM to be reserved for each service pod. |
ReplicaCount | int: Identifies the property specifying how many pods should be deployed for the service. |
Constructors
KubeClusterAdvice()
Constructs an instance by initialize empty KubeServiceAdvice instances for each cluster service defined above.
Declaration
public KubeClusterAdvice()
Fields
AlertManager
Identifies the NEONKUBE cluster's AlertManager service.
Declaration
public static string AlertManager
Field Value
Type | Description |
---|---|
string |
BlackboxExporter
Identifies the NEONKUBE cluster's BlackboxExporter service.
Declaration
public static string BlackboxExporter
Field Value
Type | Description |
---|---|
string |
Calico
Identifies the NEONKUBE cluster's Calico service.
Declaration
public static string Calico
Field Value
Type | Description |
---|---|
string |
CertManager
Identifies the NEONKUBE cluster's CertManager service manager nodes.
Declaration
public static string CertManager
Field Value
Type | Description |
---|---|
string |
CoreDns
Identifies the NEONKUBE cluster's CoreDNS service.
Declaration
public static string CoreDns
Field Value
Type | Description |
---|---|
string |
Dex
Identifies the NEONKUBE cluster's Dex service.
Declaration
public static string Dex
Field Value
Type | Description |
---|---|
string |
EtcdCluster
Identifies the NEONKUBE cluster's etcd nodes service.
Declaration
public static string EtcdCluster
Field Value
Type | Description |
---|---|
string |
EtcdOperator
Identifies the NEONKUBE cluster's Etcd Operator service.
Declaration
public static string EtcdOperator
Field Value
Type | Description |
---|---|
string |
FluentBit
Identifies the NEONKUBE cluster's FluentBit service.
Declaration
public static string FluentBit
Field Value
Type | Description |
---|---|
string |
Glauth
Identifies the NEONKUBE cluster's Glauth service.
Declaration
public static string Glauth
Field Value
Type | Description |
---|---|
string |
Grafana
Identifies the NEONKUBE cluster's Grafana service.
Declaration
public static string Grafana
Field Value
Type | Description |
---|---|
string |
GrafanaAgent
Identifies the NEONKUBE cluster's Grafana Agent service.
Declaration
public static string GrafanaAgent
Field Value
Type | Description |
---|---|
string |
GrafanaAgentNode
Identifies the NEONKUBE cluster's Grafana Agent daemonset service.
Declaration
public static string GrafanaAgentNode
Field Value
Type | Description |
---|---|
string |
GrafanaAgentOperator
Identifies the NEONKUBE cluster's Grafana Agent service.
Declaration
public static string GrafanaAgentOperator
Field Value
Type | Description |
---|---|
string |
Harbor
Identifies the NEONKUBE cluster's Harbor service.
Declaration
public static string Harbor
Field Value
Type | Description |
---|---|
string |
HarborChartmuseum
Identifies the NEONKUBE cluster's Harbor Chartmuseum service.
Declaration
public static string HarborChartmuseum
Field Value
Type | Description |
---|---|
string |
HarborClair
Identifies the NEONKUBE cluster's Harbor Clair service.
Declaration
public static string HarborClair
Field Value
Type | Description |
---|---|
string |
HarborCore
Identifies the NEONKUBE cluster's Harbor Core service.
Declaration
public static string HarborCore
Field Value
Type | Description |
---|---|
string |
HarborJobservice
Identifies the NEONKUBE cluster's Harbor Jobservice service.
Declaration
public static string HarborJobservice
Field Value
Type | Description |
---|---|
string |
HarborNotaryServer
Identifies the NEONKUBE cluster's Harbor Notary Server service.
Declaration
public static string HarborNotaryServer
Field Value
Type | Description |
---|---|
string |
HarborNotarySigner
Identifies the NEONKUBE cluster's Harbor Notary Signer service.
Declaration
public static string HarborNotarySigner
Field Value
Type | Description |
---|---|
string |
HarborPortal
Identifies the NEONKUBE cluster's Harbor Portal service.
Declaration
public static string HarborPortal
Field Value
Type | Description |
---|---|
string |
HarborRegistry
Identifies the NEONKUBE cluster's Harbor Registry service.
Declaration
public static string HarborRegistry
Field Value
Type | Description |
---|---|
string |
IstioIngressGateway
Identifies the NEONKUBE cluster's Istio Ingress Gateway service.
Declaration
public static string IstioIngressGateway
Field Value
Type | Description |
---|---|
string |
IstioPilot
Identifies the NEONKUBE cluster's Istio Pilot service.
Declaration
public static string IstioPilot
Field Value
Type | Description |
---|---|
string |
IstioProxy
Identifies the NEONKUBE cluster's Istio Proxy service.
Declaration
public static string IstioProxy
Field Value
Type | Description |
---|---|
string |
Kiali
Identifies the NEONKUBE cluster's Kiali service.
Declaration
public static string Kiali
Field Value
Type | Description |
---|---|
string |
KubeApiServerWatchCacheSize
Specifies the default watch cache size for the Kubernetes API Server.
Declaration
public int KubeApiServerWatchCacheSize
Field Value
Type | Description |
---|---|
int |
KubeStateMetrics
Identifies the Kube State Metrics service.
Declaration
public static string KubeStateMetrics
Field Value
Type | Description |
---|---|
string |
KubernetesDashboard
Identifies the NEONKUBE cluster's Kubernetes Dashboard service.
Declaration
public static string KubernetesDashboard
Field Value
Type | Description |
---|---|
string |
LogsQuota
Specifies the cluster default Logs quota.
Declaration
public string LogsQuota
Field Value
Type | Description |
---|---|
string |
Loki
Identifies the NEONKUBE cluster's Loki service.
Declaration
public static string Loki
Field Value
Type | Description |
---|---|
string |
LokiCompactor
Identifies the NEONKUBE cluster's Loki Compactor service.
Declaration
public static string LokiCompactor
Field Value
Type | Description |
---|---|
string |
LokiDistributor
Identifies the NEONKUBE cluster's Loki Distributor service.
Declaration
public static string LokiDistributor
Field Value
Type | Description |
---|---|
string |
LokiIndexGateway
Identifies the NEONKUBE cluster's Loki Index Gateway service.
Declaration
public static string LokiIndexGateway
Field Value
Type | Description |
---|---|
string |
LokiIngester
Identifies the NEONKUBE cluster's Loki Ingester service.
Declaration
public static string LokiIngester
Field Value
Type | Description |
---|---|
string |
LokiQuerier
Identifies the NEONKUBE cluster's Loki Querier service.
Declaration
public static string LokiQuerier
Field Value
Type | Description |
---|---|
string |
LokiQueryFrontend
Identifies the NEONKUBE cluster's Loki Query Frontend service.
Declaration
public static string LokiQueryFrontend
Field Value
Type | Description |
---|---|
string |
LokiRuler
Identifies the NEONKUBE cluster's Loki Ruler service.
Declaration
public static string LokiRuler
Field Value
Type | Description |
---|---|
string |
LokiTableManager
Identifies the NEONKUBE cluster's Loki Table Manager service.
Declaration
public static string LokiTableManager
Field Value
Type | Description |
---|---|
string |
Memcached
Identifies the NEONKUBE cluster's Memcached service.
Declaration
public static string Memcached
Field Value
Type | Description |
---|---|
string |
MetricsEnabled
Specifies whether cluster metrics are enabled by default.
Declaration
public bool? MetricsEnabled
Field Value
Type | Description |
---|---|
bool? |
MetricsInterval
Specifies the cluster default Metrics scrape interval.
Declaration
public string MetricsInterval
Field Value
Type | Description |
---|---|
string |
MetricsQuota
Specifies the cluster default Metrics quota.
Declaration
public string MetricsQuota
Field Value
Type | Description |
---|---|
string |
MetricsServer
Identifies the NEONKUBE cluster's Metrics-Server service.
Declaration
public static string MetricsServer
Field Value
Type | Description |
---|---|
string |
Mimir
Identifies the NEONKUBE cluster's Mimir service.
Declaration
public static string Mimir
Field Value
Type | Description |
---|---|
string |
MimirAlertmanager
Identifies the NEONKUBE cluster's Mimir Alertmanager service.
Declaration
public static string MimirAlertmanager
Field Value
Type | Description |
---|---|
string |
MimirCompactor
Identifies the NEONKUBE cluster's Mimir Compactor service.
Declaration
public static string MimirCompactor
Field Value
Type | Description |
---|---|
string |
MimirDistributor
Identifies the NEONKUBE cluster's Mimir Distributor service.
Declaration
public static string MimirDistributor
Field Value
Type | Description |
---|---|
string |
MimirIngester
Identifies the NEONKUBE cluster's Mimir Ingester service.
Declaration
public static string MimirIngester
Field Value
Type | Description |
---|---|
string |
MimirOverridesExporter
Identifies the NEONKUBE cluster's Mimir OverridesExporter service.
Declaration
public static string MimirOverridesExporter
Field Value
Type | Description |
---|---|
string |
MimirQuerier
Identifies the NEONKUBE cluster's Mimir Querier service.
Declaration
public static string MimirQuerier
Field Value
Type | Description |
---|---|
string |
MimirQueryFrontend
Identifies the NEONKUBE cluster's Mimir Query Frontend service.
Declaration
public static string MimirQueryFrontend
Field Value
Type | Description |
---|---|
string |
MimirRuler
Identifies the NEONKUBE cluster's Mimir Alertmanager service.
Declaration
public static string MimirRuler
Field Value
Type | Description |
---|---|
string |
MimirStoreGateway
Identifies the NEONKUBE cluster's Mimir Alertmanager service.
Declaration
public static string MimirStoreGateway
Field Value
Type | Description |
---|---|
string |
Minio
Identifies the NEONKUBE cluster's Minio service.
Declaration
public static string Minio
Field Value
Type | Description |
---|---|
string |
MinioOperator
Identifies the NEONKUBE cluster's Minio Operator service.
Declaration
public static string MinioOperator
Field Value
Type | Description |
---|---|
string |
NeonAcme
Identifies the NEONKUBE cluster's neon-acme service.
Declaration
public static string NeonAcme
Field Value
Type | Description |
---|---|
string |
NeonClusterOperator
Identifies the NEONKUBE cluster's neon-cluster-operator service.
Declaration
public static string NeonClusterOperator
Field Value
Type | Description |
---|---|
string |
NeonNodeAgent
Identifies the NEONKUBE cluster's neon-node-agent service.
Declaration
public static string NeonNodeAgent
Field Value
Type | Description |
---|---|
string |
NeonSsoSessionProxy
Identifies the NEONKUBE cluster's neon-sso-session-proxy service.
Declaration
public static string NeonSsoSessionProxy
Field Value
Type | Description |
---|---|
string |
NeonSystemDb
Identifies the NEONKUBE cluster's system database.
Declaration
public static string NeonSystemDb
Field Value
Type | Description |
---|---|
string |
NeonSystemDbMetrics
Identifies the NEONKUBE cluster's system database metrics sidecar.
Declaration
public static string NeonSystemDbMetrics
Field Value
Type | Description |
---|---|
string |
NeonSystemDbPooler
Identifies the NEONKUBE cluster's system database pooler.
Declaration
public static string NeonSystemDbPooler
Field Value
Type | Description |
---|---|
string |
NodeProblemDetector
Identifies the NEONKUBE cluster's Node Problem Detector service.
Declaration
public static string NodeProblemDetector
Field Value
Type | Description |
---|---|
string |
Oauth2Proxy
Identifies the NEONKUBE cluster's oauth2-proxy service.
Declaration
public static string Oauth2Proxy
Field Value
Type | Description |
---|---|
string |
OpenEbsAdmissionServer
Identifies the NEONKUBE cluster's OpenEBS Admission Server service.
Declaration
public static string OpenEbsAdmissionServer
Field Value
Type | Description |
---|---|
string |
OpenEbsApiServer
Identifies the NEONKUBE cluster's OpenEBS API Server service.
Declaration
public static string OpenEbsApiServer
Field Value
Type | Description |
---|---|
string |
OpenEbsCstor
Identifies the NEONKUBE cluster's OpenEBS cStor service.
Declaration
public static string OpenEbsCstor
Field Value
Type | Description |
---|---|
string |
OpenEbsCstorAdmissionServer
Identifies the NEONKUBE cluster's OpenEBS cStor Admission Server service.
Declaration
public static string OpenEbsCstorAdmissionServer
Field Value
Type | Description |
---|---|
string |
OpenEbsCstorCsiController
Identifies the NEONKUBE cluster's OpenEBS cStor CSI Controller service.
Declaration
public static string OpenEbsCstorCsiController
Field Value
Type | Description |
---|---|
string |
OpenEbsCstorCsiNode
Identifies the NEONKUBE cluster's OpenEBS cStor CSI Node service.
Declaration
public static string OpenEbsCstorCsiNode
Field Value
Type | Description |
---|---|
string |
OpenEbsCstorCspcOperator
Identifies the NEONKUBE cluster's OpenEBS cStor CSPC Operator service.
Declaration
public static string OpenEbsCstorCspcOperator
Field Value
Type | Description |
---|---|
string |
OpenEbsCstorCvcOperator
Identifies the NEONKUBE cluster's OpenEBS cStor CVC Operator service.
Declaration
public static string OpenEbsCstorCvcOperator
Field Value
Type | Description |
---|---|
string |
OpenEbsCstorPool
Identifies the NEONKUBE cluster's OpenEBS Cstor Pool containers.
Declaration
public static string OpenEbsCstorPool
Field Value
Type | Description |
---|---|
string |
OpenEbsCstorPoolAux
Identifies the NEONKUBE cluster's OpenEBS Cstor Pool sidecar containers.
Declaration
public static string OpenEbsCstorPoolAux
Field Value
Type | Description |
---|---|
string |
OpenEbsJiva
Identifies the NEONKUBE cluster's OpenEBS Jiva service.
Declaration
public static string OpenEbsJiva
Field Value
Type | Description |
---|---|
string |
OpenEbsLocalPvProvisioner
Identifies the NEONKUBE cluster's OpenEBS Local PV Provisioner service.
Declaration
public static string OpenEbsLocalPvProvisioner
Field Value
Type | Description |
---|---|
string |
OpenEbsNdm
Identifies the NEONKUBE cluster's OpenEBS Node Disk Manager service.
Declaration
public static string OpenEbsNdm
Field Value
Type | Description |
---|---|
string |
OpenEbsNdmOperator
Identifies the NEONKUBE cluster's OpenEBS Node Disk Manager Operator service.
Declaration
public static string OpenEbsNdmOperator
Field Value
Type | Description |
---|---|
string |
OpenEbsProvisioner
Identifies the NEONKUBE cluster's OpenEBS API Server service.
Declaration
public static string OpenEbsProvisioner
Field Value
Type | Description |
---|---|
string |
OpenEbsSnapshotOperator
Identifies the NEONKUBE cluster's OpenEBS Snapshot Operator service.
Declaration
public static string OpenEbsSnapshotOperator
Field Value
Type | Description |
---|---|
string |
OpenEbsWebhook
Identifies the NEONKUBE cluster's OpenEBS Snapshot Webhook service.
Declaration
public static string OpenEbsWebhook
Field Value
Type | Description |
---|---|
string |
Prometheus
Identifies the NEONKUBE cluster's Prometheus service.
Declaration
public static string Prometheus
Field Value
Type | Description |
---|---|
string |
PrometheusOperator
Identifies the NEONKUBE cluster's Prometheus Operator service.
Declaration
public static string PrometheusOperator
Field Value
Type | Description |
---|---|
string |
Redis
Identifies the NEONKUBE cluster's Redis service.
Declaration
public static string Redis
Field Value
Type | Description |
---|---|
string |
RedisHA
Identifies the NEONKUBE cluster's Redis HA service.
Declaration
public static string RedisHA
Field Value
Type | Description |
---|---|
string |
Reloader
Identifies the NEONKUBE cluster's Reloader service.
Declaration
public static string Reloader
Field Value
Type | Description |
---|---|
string |
Tempo
Identifies the NEONKUBE cluster's Tempo service.
Declaration
public static string Tempo
Field Value
Type | Description |
---|---|
string |
TempoAlertmanager
Identifies the NEONKUBE cluster's Tempo Alertmanager service.
Declaration
public static string TempoAlertmanager
Field Value
Type | Description |
---|---|
string |
TempoCompactor
Identifies the NEONKUBE cluster's Tempo Compactor service.
Declaration
public static string TempoCompactor
Field Value
Type | Description |
---|---|
string |
TempoDistributor
Identifies the NEONKUBE cluster's Tempo Distributor service.
Declaration
public static string TempoDistributor
Field Value
Type | Description |
---|---|
string |
TempoIngester
Identifies the NEONKUBE cluster's Tempo Ingester service.
Declaration
public static string TempoIngester
Field Value
Type | Description |
---|---|
string |
TempoOverridesExporter
Identifies the NEONKUBE cluster's Tempo OverridesExporter service.
Declaration
public static string TempoOverridesExporter
Field Value
Type | Description |
---|---|
string |
TempoQuerier
Identifies the NEONKUBE cluster's Tempo Querier service.
Declaration
public static string TempoQuerier
Field Value
Type | Description |
---|---|
string |
TempoQueryFrontend
Identifies the NEONKUBE cluster's Tempo Query Frontend service.
Declaration
public static string TempoQueryFrontend
Field Value
Type | Description |
---|---|
string |
TempoRuler
Identifies the NEONKUBE cluster's Tempo Alertmanager service.
Declaration
public static string TempoRuler
Field Value
Type | Description |
---|---|
string |
TempoStoreGateway
Identifies the NEONKUBE cluster's Tempo Alertmanager service.
Declaration
public static string TempoStoreGateway
Field Value
Type | Description |
---|---|
string |
TracesQuota
Specifies the cluster default Traces quota.
Declaration
public string TracesQuota
Field Value
Type | Description |
---|---|
string |
Properties
IsReadOnly
Cluster advice is designed to be configured once during cluster setup and then be
considered to be read-only thereafter. This property should be set to
true
after the advice is intialized to prevent it from being modified
again.
note
This is necessary because setup is performed on multiple threads and this class is not inheritly thread-safe. This also fits with the idea that the logic behind this advice is to be centralized.
Declaration
public bool IsReadOnly { get; set; }
Property Value
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when attempting to make the instance read/write aftyer being set to read-only. |
Methods
AddServiceAdvice(string, KubeServiceAdvice)
Adds the KubeServiceAdvice for the specified service.
Declaration
public void AddServiceAdvice(string serviceName, KubeServiceAdvice advice)
Parameters
Type | Name | Description |
---|---|---|
string | serviceName | Identifies the service (one of the constants defined by this class). |
KubeServiceAdvice | advice | The KubeServiceAdvice instance for the service |
GetServiceAdvice(string)
Returns the KubeServiceAdvice for the specified service.
Declaration
public KubeServiceAdvice GetServiceAdvice(string serviceName)
Parameters
Type | Name | Description |
---|---|---|
string | serviceName | Identifies the service (one of the constants defined by this class). |
Returns
Type | Description |
---|---|
KubeServiceAdvice | The KubeServiceAdvice instance for the service. |
Exceptions
Type | Condition |
---|---|
KeyNotFoundException | Thrown when there's no advice for the service. |