Documentation ¶
Index ¶
- Constants
- Variables
- func CheckIsIBMCloud(c client.Client) (bool, error)
- func CheckObjStorageConf(data []byte) (bool, error)
- func CleanUpOperandNames()
- func GetAlertmanagerCA(client client.Client) (string, error)
- func GetAlertmanagerEndpoint(client client.Client, namespace string) (string, error)
- func GetAlertmanagerRouterCA(client client.Client) (string, error)
- func GetCertDuration() time.Duration
- func GetClusterID(ocpClient ocpClientSet.Interface) (string, error)
- func GetClusterNameLabelKey() string
- func GetCrLabelKey() string
- func GetDefaultCRName() string
- func GetDefaultNamespace() string
- func GetDefaultTenantName() string
- func GetImageManifestConfigMapName() string
- func GetImageManifests() map[string]string
- func GetImagePullPolicy(mco observabilityv1beta2.MultiClusterObservabilitySpec) corev1.PullPolicy
- func GetImagePullSecret(mco observabilityv1beta2.MultiClusterObservabilitySpec) string
- func GetKubeAPIServerAddress(client client.Client) (string, error)
- func GetMCONamespace() string
- func GetMonitoringCRName() string
- func GetOBAResources(oba *mcoshared.ObservabilityAddonSpec) *corev1.ResourceRequirements
- func GetObsAPIHost(client client.Client, namespace string) (string, error)
- func GetObsAPISvc(instanceName string) string
- func GetOperandName(name string) string
- func GetOperandNamePrefix() string
- func GetReplicas(component string, advanced *observabilityv1beta2.AdvancedConfig) *int32
- func GetResources(component string, advanced *observabilityv1beta2.AdvancedConfig) corev1.ResourceRequirements
- func GetTenantUID() string
- func GetValidatingWebhookConfigurationForMCO() *admissionregistrationv1.ValidatingWebhookConfiguration
- func HasCustomRuleConfigMap() bool
- func IsPaused(annotations map[string]string) bool
- func IsValidAzureConf(data []byte) (bool, error)
- func IsValidGCSConf(data []byte) (bool, error)
- func IsValidS3Conf(data []byte) (bool, error)
- func ReadImageManifestConfigMap(c client.Client, version string) (bool, error)
- func ReplaceImage(annotations map[string]string, imageRepo, componentName string) (bool, string)
- func SetCertDuration(annotations map[string]string)
- func SetCustomRuleConfigMap(hasConfigMap bool)
- func SetImageManifests(images map[string]string)
- func SetMonitoringCRName(crName string)
- func SetOperandNames(c client.Client) error
- func WithoutResourcesRequests(annotations map[string]string) bool
- type Config
- type ObjectStorgeConf
Constants ¶
const ( OpenshiftIngressOperatorNamespace = "openshift-ingress-operator" OpenshiftIngressNamespace = "openshift-ingress" OpenshiftIngressOperatorCRName = "default" OpenshiftIngressDefaultCertName = "router-certs-default" OpenshiftIngressRouteCAName = "router-ca" AnnotationKeyImageRepository = "mco-imageRepository" AnnotationKeyImageTagSuffix = "mco-imageTagSuffix" AnnotationMCOPause = "mco-pause" AnnotationMCOWithoutResourcesRequests = "mco-thanos-without-resources-requests" AnnotationCertDuration = "mco-cert-duration" MCHUpdatedRequestName = "mch-updated-request" MCOUpdatedRequestName = "mco-updated-request" ImageManifestConfigMapNamePrefix = "mch-image-manifest-" OCMManifestConfigMapTypeLabelKey = "ocm-configmap-type" OCMManifestConfigMapTypeLabelValue = "image-manifest" OCMManifestConfigMapVersionLabelKey = "ocm-release-version" ComponentVersion = "COMPONENT_VERSION" ServerCACerts = "observability-server-ca-certs" ClientCACerts = "observability-client-ca-certs" ServerCerts = "observability-server-certs" ServerCertCN = "observability-server-certificate" GrafanaCerts = "observability-grafana-certs" GrafanaCN = "grafana" ManagedClusterOU = "acm" AlertmanagerAccessorSAName = "observability-alertmanager-accessor" /* #nosec */ AlertmanagerAccessorSecretName = "observability-alertmanager-accessor" AlertmanagerServiceName = "alertmanager" AlertmanagerRouteName = "alertmanager" AlertmanagerRouteBYOCAName = "alertmanager-byo-ca" AlertmanagerRouteBYOCERTName = "alertmanager-byo-cert" AlertRuleDefaultConfigMapName = "thanos-ruler-default-rules" AlertRuleDefaultFileKey = "default_rules.yaml" AlertRuleCustomConfigMapName = "thanos-ruler-custom-rules" AlertRuleCustomFileKey = "custom_rules.yaml" AlertmanagerURL = "http://alertmanager:9093" AlertmanagerConfigName = "alertmanager-config" AlertmanagersDefaultConfigMapName = "thanos-ruler-config" AlertmanagersDefaultConfigFileKey = "config.yaml" AlertmanagersDefaultCaBundleMountPath = "/etc/thanos/configmaps/alertmanager-ca-bundle" AlertmanagersDefaultCaBundleName = "alertmanager-ca-bundle" AlertmanagersDefaultCaBundleKey = "service-ca.crt" AllowlistCustomConfigMapName = "observability-metrics-custom-allowlist" ProxyServiceName = "rbac-query-proxy" ProxyRouteName = "rbac-query-proxy" ProxyRouteBYOCAName = "proxy-byo-ca" ProxyRouteBYOCERTName = "proxy-byo-cert" ValidatingWebhookConfigurationName = "multicluster-observability-operator" WebhookServiceName = "multicluster-observability-webhook-service" )
const ( DefaultImgRepository = "quay.io/open-cluster-management" DefaultImgTagSuffix = "2.4.0-SNAPSHOT-2021-09-23-07-02-14" ObservatoriumImgRepo = "quay.io/observatorium" ObservatoriumAPIImgName = "observatorium" ObservatoriumOperatorImgName = "observatorium-operator" ObservatoriumOperatorImgKey = "observatorium_operator" ThanosReceiveControllerImgName = "thanos-receive-controller" //ThanosReceiveControllerKey is used to get from mch-image-manifest.xxx configmap ThanosReceiveControllerKey = "thanos_receive_controller" ThanosReceiveControllerImgTag = "master-2021-04-28-ee165b6" ThanosImgName = "thanos" MemcachedImgRepo = "quay.io/ocm-observability" MemcachedImgName = "memcached" MemcachedImgTag = "1.6.3-alpine" MemcachedExporterImgRepo = "quay.io/prometheus" MemcachedExporterImgName = "memcached-exporter" MemcachedExporterKey = "memcached_exporter" MemcachedExporterImgTag = "v0.9.0" GrafanaImgKey = "grafana" GrafanaDashboardLoaderName = "grafana-dashboard-loader" GrafanaDashboardLoaderKey = "grafana_dashboard_loader" AlertManagerImgName = "prometheus-alertmanager" AlertManagerImgKey = "prometheus_alertmanager" ConfigmapReloaderImgRepo = "quay.io/openshift" ConfigmapReloaderImgName = "origin-configmap-reloader" ConfigmapReloaderImgTagSuffix = "4.8.0" ConfigmapReloaderKey = "prometheus-config-reloader" OauthProxyImgRepo = "quay.io/open-cluster-management" OauthProxyImgName = "origin-oauth-proxy" OauthProxyImgTagSuffix = "2.0.12-SNAPSHOT-2021-06-11-19-40-10" OauthProxyKey = "oauth_proxy" EndpointControllerImgName = "endpoint-monitoring-operator" EndpointControllerKey = "endpoint_monitoring_operator" RBACQueryProxyImgName = "rbac-query-proxy" RBACQueryProxyKey = "rbac_query_proxy" RBACQueryProxyCPURequets = "20m" RBACQueryProxyMemoryRequets = "100Mi" GrafanaCPURequets = "4m" GrafanaMemoryRequets = "100Mi" GrafanaCPULimits = "500m" GrafanaMemoryLimits = "1Gi" AlertmanagerCPURequets = "4m" AlertmanagerMemoryRequets = "200Mi" ObservatoriumAPICPURequets = "20m" ObservatoriumAPIMemoryRequets = "128Mi" ThanosQueryFrontendCPURequets = "100m" ThanosQueryFrontendMemoryRequets = "256Mi" MemcachedExporterCPURequets = "5m" MemcachedExporterMemoryRequets = "50Mi" ThanosQueryCPURequets = "300m" ThanosQueryMemoryRequets = "1Gi" ThanosCompactCPURequets = "100m" ThanosCompactMemoryRequets = "512Mi" ObservatoriumReceiveControllerCPURequets = "4m" ObservatoriumReceiveControllerMemoryRequets = "32Mi" ThanosReceiveCPURequets = "300m" ThanosReceiveMemoryRequets = "512Mi" ThanosRuleCPURequets = "50m" ThanosRuleMemoryRequets = "512Mi" ThanosRuleReloaderCPURequets = "4m" ThanosRuleReloaderMemoryRequets = "25Mi" ThanosCachedCPURequets = "45m" ThanosCachedMemoryRequets = "128Mi" ThanosCachedExporterCPURequets = "5m" ThanosCachedExporterMemoryRequets = "50Mi" ThanosStoreCPURequets = "100m" ThanosStoreMemoryRequets = "1Gi" MetricsCollectorCPURequets = "10m" MetricsCollectorMemoryRequets = "100Mi" MetricsCollectorCPULimits = "" MetricsCollectorMemoryLimits = "" ObservatoriumAPI = "observatorium-api" ThanosCompact = "thanos-compact" ThanosQuery = "thanos-query" ThanosQueryFrontend = "thanos-query-frontend" ThanosQueryFrontendMemcached = "thanos-query-frontend-memcached" ThanosRule = "thanos-rule" ThanosReceive = "thanos-receive-default" ThanosStoreMemcached = "thanos-store-memcached" ThanosStoreShard = "thanos-store-shard" MemcachedExporter = "memcached-exporter" Grafana = "grafana" RBACQueryProxy = "rbac-query-proxy" Alertmanager = "alertmanager" ThanosReceiveController = "thanos-receive-controller" ObservatoriumOperator = "observatorium-operator" MetricsCollector = "metrics-collector" Observatorium = "observatorium" RetentionResolutionRaw = "30d" RetentionResolution5m = "180d" RetentionResolution1h = "0d" RetentionInLocal = "24h" DeleteDelay = "48h" BlockDuration = "2h" DefaultImagePullPolicy = "IfNotPresent" DefaultImagePullSecret = "multiclusterhub-operator-pull-secret" ResourceLimits = "limits" ResourceRequests = "requests" )
const ( IngressControllerCRD = "ingresscontrollers.operator.openshift.io" MCHCrdName = "multiclusterhubs.operator.open-cluster-management.io" MCOCrdName = "multiclusterobservabilities.observability.open-cluster-management.io" StorageVersionMigrationCrdName = "storageversionmigrations.migration.k8s.io" )
const (
MCORsName = "multiclusterobservabilities"
)
Variables ¶
var ( Replicas1 int32 = 1 Replicas2 int32 = 2 Replicas3 int32 = 3 Replicas = map[string]*int32{ ObservatoriumAPI: &Replicas2, ThanosQuery: &Replicas2, ThanosQueryFrontend: &Replicas2, Grafana: &Replicas2, RBACQueryProxy: &Replicas2, ThanosRule: &Replicas3, ThanosReceive: &Replicas3, ThanosStoreShard: &Replicas3, ThanosStoreMemcached: &Replicas3, ThanosQueryFrontendMemcached: &Replicas3, Alertmanager: &Replicas3, } MemoryLimitMB = int32(1024) ConnectionLimit = int32(1024) MaxItemSize = "1m" )
Functions ¶
func CheckIsIBMCloud ¶
checkIsIBMCloud detects if the current cloud vendor is ibm or not we know we are on OCP already, so if it's also ibm cloud, it's roks
func CheckObjStorageConf ¶
CheckObjStorageConf is used to check/valid the object storage configurations
func CleanUpOperandNames ¶
func CleanUpOperandNames()
CleanUpOperandNames delete all the operand name items Should be called when the MCO CR is deleted
func GetAlertmanagerCA ¶
GetAlertmanagerCA is used to get the CA of Alertmanager
func GetAlertmanagerEndpoint ¶
GetAlertmanagerEndpoint is used to get the URL for alertmanager
func GetAlertmanagerRouterCA ¶
GetAlertmanagerRouterCA is used to get the CA of openshift Route
func GetCertDuration ¶
func GetClusterID ¶
func GetClusterID(ocpClient ocpClientSet.Interface) (string, error)
GetClusterID is used to get the cluster uid
func GetClusterNameLabelKey ¶
func GetClusterNameLabelKey() string
GetClusterNameLabelKey returns the key for the injected label
func GetCrLabelKey ¶
func GetCrLabelKey() string
GetCrLabelKey returns the key for the CR label injected into the resources created by the operator
func GetDefaultCRName ¶
func GetDefaultCRName() string
GetDefaultCRName is used to get default CR name.
func GetDefaultNamespace ¶
func GetDefaultNamespace() string
func GetDefaultTenantName ¶
func GetDefaultTenantName() string
GetDefaultTenantName returns the default tenant name
func GetImageManifestConfigMapName ¶
func GetImageManifestConfigMapName() string
func GetImagePullPolicy ¶
func GetImagePullPolicy(mco observabilityv1beta2.MultiClusterObservabilitySpec) corev1.PullPolicy
func GetImagePullSecret ¶
func GetImagePullSecret(mco observabilityv1beta2.MultiClusterObservabilitySpec) string
func GetKubeAPIServerAddress ¶
GetKubeAPIServerAddress is used to get the api server url
func GetMCONamespace ¶
func GetMCONamespace() string
func GetMonitoringCRName ¶
func GetMonitoringCRName() string
GetMonitoringCRName returns monitoring cr name
func GetOBAResources ¶
func GetOBAResources(oba *mcoshared.ObservabilityAddonSpec) *corev1.ResourceRequirements
func GetObsAPIHost ¶
GetObsAPIHost is used to get the URL for observartium api gateway
func GetObsAPISvc ¶
GetObsAPISvc returns observatorium api service
func GetOperandName ¶
func GetOperandNamePrefix ¶
func GetOperandNamePrefix() string
func GetReplicas ¶
func GetReplicas(component string, advanced *observabilityv1beta2.AdvancedConfig) *int32
func GetResources ¶
func GetResources(component string, advanced *observabilityv1beta2.AdvancedConfig) corev1.ResourceRequirements
func GetValidatingWebhookConfigurationForMCO ¶
func GetValidatingWebhookConfigurationForMCO() *admissionregistrationv1.ValidatingWebhookConfiguration
GetValidatingWebhookConfigurationForMCO return the ValidatingWebhookConfiguration for the MCO validaing webhook
func HasCustomRuleConfigMap ¶
func HasCustomRuleConfigMap() bool
HasCustomRuleConfigMap returns true if there is custom rule configmap
func IsPaused ¶
IsPaused returns true if the multiclusterobservability instance is labeled as paused, and false otherwise
func IsValidAzureConf ¶
IsValidAzureConf is used to validate azure configuration
func IsValidGCSConf ¶
IsValidGCSConf is used to validate GCS configuration
func IsValidS3Conf ¶
IsValidS3Conf is used to validate s3 configuration
func ReadImageManifestConfigMap ¶
ReadImageManifestConfigMap reads configmap with the label ocm-configmap-type=image-manifest
func ReplaceImage ¶
ReplaceImage is used to replace the image with specified annotation or imagemanifest configmap
func SetCertDuration ¶
func SetCustomRuleConfigMap ¶
func SetCustomRuleConfigMap(hasConfigMap bool)
SetCustomRuleConfigMap set true if there is custom rule configmap
func SetImageManifests ¶
SetImageManifests sets imageManifests
func SetMonitoringCRName ¶
func SetMonitoringCRName(crName string)
SetMonitoringCRName sets the cr name
func SetOperandNames ¶
func WithoutResourcesRequests ¶
WithoutResourcesRequests returns true if the multiclusterobservability instance has annotation: mco-thanos-without-resources-requests: "true" This is just for test purpose: the KinD cluster does not have enough resources for the requests. We won't expose this annotation to the customer.
Types ¶
type Config ¶
type Config struct { // s3 configuration Bucket string `yaml:"bucket"` Endpoint string `yaml:"endpoint"` Insecure bool `yaml:"insecure"` AccessKey string `yaml:"access_key"` SecretKey string `yaml:"secret_key"` // azure configuration // Bucket string `yaml:"bucket"` StorageAccount string `yaml:"storage_account"` StorageAccountKey string `yaml:"storage_account_key"` Container string `yaml:"container"` MaxRetries int32 `yaml:"max_retries"` // gcs configuration // Endpoint string `yaml:"endpoint"` ServiceAccount string `yaml:"service_account"` }
Config is for s3/azure/gcs compatiable configuration
type ObjectStorgeConf ¶
ObjectStorgeConf is used to Unmarshal from bytes to do validation