Documentation
¶
Index ¶
- Constants
- func AddEnv(env []corev1.EnvVar, existing map[string]string, name string, v string) []corev1.EnvVar
- func AddEnvFromConfigMap(env []corev1.EnvVar, existing map[string]string, environmentName string, ...) []corev1.EnvVar
- func AddEnvFromSecret(env []corev1.EnvVar, existing map[string]string, environmentName string, ...) []corev1.EnvVar
- func AddMultiDatabaseEnvs(a *api.DatabaseObserver, e map[string]string, source []corev1.EnvVar) []corev1.EnvVar
- func AddNamespaceSelector(a *api.DatabaseObserver, spec *monitorv1.ServiceMonitorSpec)
- func AddSidecarContainers(a *api.DatabaseObserver, listing *[]corev1.Container)
- func AddSidecarVolumes(a *api.DatabaseObserver, listing *[]corev1.Volume)
- func AddSingleDatabaseEnvs(a *api.DatabaseObserver, e map[string]string, source []corev1.EnvVar) []corev1.EnvVar
- func GetEndpoints(a *api.DatabaseObserver) []monitorv1.Endpoint
- func GetExporterArgs(a *api.DatabaseObserver) []string
- func GetExporterCommands(a *api.DatabaseObserver) []string
- func GetExporterDeploymentSecurityContext(a *api.DatabaseObserver) *corev1.SecurityContext
- func GetExporterDeploymentVolumeMounts(a *api.DatabaseObserver) []corev1.VolumeMount
- func GetExporterDeploymentVolumes(a *api.DatabaseObserver) []corev1.Volume
- func GetExporterEnvs(a *api.DatabaseObserver) []corev1.EnvVar
- func GetExporterImage(a *api.DatabaseObserver) string
- func GetExporterPodSecurityContext(a *api.DatabaseObserver) *corev1.PodSecurityContext
- func GetExporterReplicas(a *api.DatabaseObserver) int32
- func GetExporterServicePort(a *api.DatabaseObserver) []corev1.ServicePort
- func GetExporterVersion(a *api.DatabaseObserver) string
- func GetLabels(a *api.DatabaseObserver, customResourceLabels map[string]string) map[string]string
- func GetLogVolumeSource(a *api.DatabaseObserver) corev1.VolumeSource
- func GetMetricsConfig(a *api.DatabaseObserver) string
- func GetSelectorLabel(a *api.DatabaseObserver) map[string]string
- func IsMultipleDatabasesDefined(a *api.DatabaseObserver) bool
- func IsUsingAzureVault(f api.DBAzureVault, v string) bool
- func IsUsingOCIVault(f api.DBOCIVault) bool
Constants ¶
const ( UnknownValue = "UNKNOWN" DefaultValue = "DEFAULT" )
const ( VaultUsernameInUse = "VAULT_USERNAME" VaultPasswordInUse = "VAULT_PASSWORD" VaultIDProvided = "VAULT_ID_PROVIDED" )
Signals
const ( StatusObservabilityPending v4.StatusEnum = "PENDING" StatusObservabilityError v4.StatusEnum = "ERROR" StatusObservabilityReady v4.StatusEnum = "READY" )
Observability Status
const ( LogReconcile = "ObservabilityExporterLogger" LogExportersDeploy = "ObservabilityExporterDeploymentLogger" LogExportersSVC = "ObservabilityExporterServiceLogger" LogExportersServiceMonitor = "ObservabilityExporterServiceMonitorLogger" )
Log Names
const ( DefaultDbUserKey = "username" DefaultDBPasswordKey = "password" DefaultDBConnectionStringKey = "connection" DefaultConfigVolumeString = "metrics-volume" DefaultLogFilename = "alert.log" DefaultLogVolumeString = "log-volume" DefaultLogDestination = "/log" DefaultConfigMountPath = "/config" DefaultConfigVolumeName = "config-volume" DefaultWalletVolumeString = "creds" DefaultOCIConfigVolumeName = "oci-config-volume" DefaultOCIConfigFingerprintKey = "fingerprint" DefaultOCIConfigRegionKey = "region" DefaultOCIConfigTenancyKey = "tenancy" DefaultOCIConfigUserKey = "user" DefaultAzureConfigTenantId = "tenantId" DefaultAzureConfigClientId = "clientId" DefaultAzureConfigClientSecret = "clientSecret" DefaultEnvPasswordSuffix = "_PASSWORD" DefaultEnvUserSuffix = "_USERNAME" DefaultEnvConnectionStringSuffix = "_CONNECT_STRING" DefaultExporterImage = "container-registry.oracle.com/database/observability-exporter:2.0.2" DefaultServicePort = 9161 DefaultServiceTargetPort = 9161 DefaultAppPort = 8080 DefaultPrometheusPort = "metrics" DefaultServiceType = "ClusterIP" DefaultReplicaCount = 1 DefaultExporterConfigMountRootPath = "/oracle/observability" DefaultOracleHome = "/lib/oracle/21/client64/lib" DefaultOracleTNSAdmin = DefaultOracleHome + "/network/admin" DefaultOCIConfigPath = "/.oci" DefaultPrivateKeyFileName = "private.pem" DefaultVaultPrivateKeyAbsolutePath = DefaultOCIConfigPath + "/" + DefaultPrivateKeyFileName DefaultExporterContainerName = "exporter" DefaultSelectorLabelKey = "app" )
Defaults
const ( EnvVarOracleHome = "ORACLE_HOME" EnvVarDataSourceUsername = "DB_USERNAME" EnvVarDataSourcePassword = "DB_PASSWORD" EnvVarDataSourceConnectString = "DB_CONNECT_STRING" EnvVarDataSourceLogDestination = "LOG_DESTINATION" EnvVarDataSourcePwdVaultSecretName = "OCI_VAULT_SECRET_NAME" EnvVarDataSourcePwdVaultId = "OCI_VAULT_ID" EnvVarCustomConfigmap = "CUSTOM_METRICS" EnvVarTNSAdmin = "TNS_ADMIN" EnvVarOCIVaultTenancyOCID = "OCI_CLI_TENANCY" EnvVarOCIVaultUserOCID = "OCI_CLI_USER" EnvVarOCIVaultFingerprint = "OCI_CLI_FINGERPRINT" EnvVarOCIVaultPrivateKeyPath = "OCI_CLI_KEY_FILE" EnvVarOCIVaultRegion = "OCI_CLI_REGION" EnvVarAzureVaultPasswordSecret = "AZ_VAULT_PASSWORD_SECRET" EnvVarAzureVaultUsernameSecret = "AZ_VAULT_USERNAME_SECRET" EnvVarAzureVaultID = "AZ_VAULT_ID" EnvVarAzureTenantID = "AZURE_TENANT_ID" EnvVarAzureClientID = "AZURE_CLIENT_ID" EnvVarAzureClientSecret = "AZURE_CLIENT_SECRET" )
Known environment variables
const ( IsCRAvailable = "ExporterReady" IsExporterDeploymentReady = "DeploymentReady" IsExporterServiceReady = "ServiceReady" IsExporterServiceMonitorReady = "ServiceMonitorReady" )
Positive ConditionTypes
const ( ReasonInitStart = "InitializationStarted" ReasonReadyValidated = "ReadinessValidated" ReasonValidationInProgress = "ReadinessValidationInProgress" ReasonReadyFailed = "ReadinessValidationFailed" ReasonDeploymentSpecValidationFailed = "SpecValidationFailed" ReasonDeploymentSuccessful = "ResourceDeployed" ReasonResourceUpdated = "ResourceUpdated" ReasonResourceUpdateFailed = "ResourceUpdateFailed" ReasonDeploymentFailed = "ResourceDeploymentFailed" ReasonDeploymentPending = "ResourceDeploymentInProgress" ReasonGeneralResourceGenerationFailed = "ResourceGenerationFailed" ReasonGeneralResourceCreated = "ResourceCreated" ReasonGeneralResourceCreationFailed = "ResourceCreationFailed" ReasonGeneralResourceValidationCompleted = "ResourceDeployed" ReasonGeneralResourceValidationFailureDueToError = "ResourceCouldNotBeValidated" )
Reason
const ( ErrorCRRetrieve = "an error occurred with retrieving the cr" ErrorStatusUpdate = "an error occurred with updating the cr status" ErrorSpecValidationFailedDueToAnError = "an error occurred with validating the exporter deployment spec" ErrorDeploymentPodsFailure = "an error occurred with deploying exporter deployment pods" ErrorResourceCreationFailure = "an error occurred with creating databaseobserver resource" ErrorResourceRetrievalFailureDueToAnError = "an error occurred with retrieving databaseobserver resource" LogErrorWithResourceUpdate = "an error occurred with updating resource" )
Log Errors
const ( LogCRStart = "Started DatabaseObserver instance reconciliation" LogCREnd = "Ended DatabaseObserver instance reconciliation, resource must have been deleted." LogResourceCreated = "Created DatabaseObserver resource successfully" LogResourceUpdated = "Updated DatabaseObserver resource successfully" LogResourceFound = "Validated DatabaseObserver resource readiness" LogSuccessWithResourceUpdate = "Updated DatabaseObserver resource successfully" )
Log Infos
const ( MessageCRInitializationStarted = "Started initialization of custom resource" MessageCRValidated = "Completed validation of custom resource readiness successfully" MessageCRValidationFailed = "Failed to validate readiness of custom resource due to an error" MessageCRValidationWaiting = "Waiting for other resources to be ready to fully validate readiness" MessageResourceCreated = "Completed creation of resource successfully" MessageResourceCreationFailed = "Failed to create resource due to an error" MessageResourceReadinessValidated = "Completed validation of resource readiness" MessageResourceReadinessValidationFailed = "Failed to validate resource due to an error retrieving resource" MessageResourceGenerationFailed = "Failed to generate resource due to an error" MessageExporterDeploymentSpecValidationFailed = "Failed to validate export deployment spec due to an error with the spec" MessageExporterResourceUpdateFailed = "Failed to update exporter resource due to an error" MessageExporterResourceUpdated = "Updated exporter resource successfully" MessageExporterDeploymentValidationFailed = "Failed to validate exporter deployment due to an error retrieving resource" MessageExporterDeploymentSuccessful = "Completed validation of exporter deployment readiness" MessageExporterDeploymentFailed = "Failed to deploy exporter deployment due to PodFailure" MessageExporterDeploymentListingFailed = "Failed to list exporter deployment pods" MessageExporterDeploymentPending = "Waiting for exporter deployment pods to be ready" )
Messages
const ( EventReasonFailedCRRetrieval = "ExporterRetrievalFailed" EventMessageFailedCRRetrieval = "Encountered error retrieving databaseObserver instance" EventReasonSpecError = "DeploymentSpecValidationFailed" EventMessageSpecErrorConfigMapSpecifiedMissing = "Spec validation failed due to referenced configMap not found" EventMessageSpecErrorDBConnectionStringSecretMissing = "Spec validation failed due to required dbConnectionString secret not found" EventMessageSpecErrorDBPUserSecretMissing = "Spec validation failed due to dbUser secret not found" EventMessageSpecErrorDBPwdSecretMissing = "Spec validation failed due to dbPassword secret not found" EventMessageSpecErrorDBWalletSecretMissing = "Spec validation failed due to provided dbWallet secret not found" EventReasonUpdateSucceeded = "ExporterDeploymentUpdated" )
Event Recorder Outputs
Variables ¶
This section is empty.
Functions ¶
func AddEnvFromConfigMap ¶
func AddEnvFromSecret ¶
func AddMultiDatabaseEnvs ¶
func AddNamespaceSelector ¶
func AddNamespaceSelector(a *api.DatabaseObserver, spec *monitorv1.ServiceMonitorSpec)
func AddSidecarContainers ¶
func AddSidecarContainers(a *api.DatabaseObserver, listing *[]corev1.Container)
func AddSidecarVolumes ¶
func AddSidecarVolumes(a *api.DatabaseObserver, listing *[]corev1.Volume)
func AddSingleDatabaseEnvs ¶
func GetEndpoints ¶
func GetEndpoints(a *api.DatabaseObserver) []monitorv1.Endpoint
GetEndpoints function
func GetExporterArgs ¶
func GetExporterArgs(a *api.DatabaseObserver) []string
GetExporterArgs retrieves args
func GetExporterCommands ¶
func GetExporterCommands(a *api.DatabaseObserver) []string
GetExporterCommands retrieves commands
func GetExporterDeploymentSecurityContext ¶
func GetExporterDeploymentSecurityContext(a *api.DatabaseObserver) *corev1.SecurityContext
GetExporterDeploymentSecurityContext retrieves security context for container
func GetExporterDeploymentVolumeMounts ¶
func GetExporterDeploymentVolumeMounts(a *api.DatabaseObserver) []corev1.VolumeMount
GetExporterDeploymentVolumeMounts function retrieves volume mounts from a or provides default
func GetExporterDeploymentVolumes ¶
func GetExporterDeploymentVolumes(a *api.DatabaseObserver) []corev1.Volume
GetExporterDeploymentVolumes function retrieves volumes from a or provides default
func GetExporterEnvs ¶
func GetExporterEnvs(a *api.DatabaseObserver) []corev1.EnvVar
GetExporterEnvs function retrieves env from a or provides default
func GetExporterImage ¶
func GetExporterImage(a *api.DatabaseObserver) string
GetExporterImage function retrieves image from a or provides default
func GetExporterPodSecurityContext ¶
func GetExporterPodSecurityContext(a *api.DatabaseObserver) *corev1.PodSecurityContext
GetExporterPodSecurityContext retrieves security context for pods
func GetExporterReplicas ¶
func GetExporterReplicas(a *api.DatabaseObserver) int32
GetExporterReplicas function retrieves replicaCount from a or provides default
func GetExporterServicePort ¶
func GetExporterServicePort(a *api.DatabaseObserver) []corev1.ServicePort
GetExporterServicePort function retrieves exporter service port from a or provides default
func GetExporterVersion ¶
func GetExporterVersion(a *api.DatabaseObserver) string
GetExporterVersion retrieves version of exporter used
func GetLogVolumeSource ¶
func GetLogVolumeSource(a *api.DatabaseObserver) corev1.VolumeSource
GetLogVolumeSource function retrieves the source to help GetExporterDeploymentVolumes
func GetMetricsConfig ¶
func GetMetricsConfig(a *api.DatabaseObserver) string
GetMetricsConfig function retrieves config name for status
func GetSelectorLabel ¶
func GetSelectorLabel(a *api.DatabaseObserver) map[string]string
GetSelectorLabel adds selector label
func IsMultipleDatabasesDefined ¶
func IsMultipleDatabasesDefined(a *api.DatabaseObserver) bool
func IsUsingAzureVault ¶
func IsUsingAzureVault(f api.DBAzureVault, v string) bool
func IsUsingOCIVault ¶
func IsUsingOCIVault(f api.DBOCIVault) bool
Types ¶
This section is empty.