@@ -40,6 +40,8 @@ const (
4040 CeilometerProxyContainerImage = "quay.io/podified-antelope-centos9/openstack-aodh-api:current-podified"
4141 // KubeStateMetricsImage - default fall-back image for KSM
4242 KubeStateMetricsImage = "registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0"
43+ // MysqldExporterImage - default fall-back image for mysqld_exporter
44+ MysqldExporterContainerImage = "quay.io/prometheus/mysqld-exporter:v0.16.0"
4345)
4446
4547// CeilometerSpec defines the desired state of Ceilometer
@@ -66,6 +68,9 @@ type CeilometerSpec struct {
6668
6769 // +kubebuilder:validation:Optional
6870 KSMImage string `json:"ksmImage"`
71+
72+ // +kubebuilder:validation:Optional
73+ MysqldExporterImage string `json:"mysqldExporterImage"`
6974}
7075
7176// CeilometerSpecCore defines the desired state of Ceilometer. This version is used by the OpenStackControlplane (no image parameters)
@@ -108,6 +113,18 @@ type CeilometerSpecCore struct {
108113 // NetworkAttachmentDefinitions list of network attachment definitions the service pod gets attached to
109114 NetworkAttachmentDefinitions []string `json:"networkAttachmentDefinitions,omitempty"`
110115
116+ // Whether mysqld_exporter should be deployed
117+ // +kubebuilder:validation:optional
118+ MysqldExporterEnabled * bool `json:"mysqldExporterEnabled,omitempty"`
119+
120+ // MysqldExporterDatabaseAccountPrefix - Database account prefix for the mysqld-exporter.
121+ // A mariadbaccount CR named "<mysqldExporterDatabaseAccountPrefix>-<galera CR name>" for each
122+ // galera instance needs to be either created by the user or if it's missing, it'll be
123+ // created by the telemetry-operator automatically.
124+ // +kubebuilder:validation:optional
125+ // +kubebuilder:default=mysqld-exporter
126+ MysqldExporterDatabaseAccountPrefix string `json:"mysqldExporterDatabaseAccountPrefix,omitempty"`
127+
111128 // +kubebuilder:validation:Optional
112129 // +operator-sdk:csv:customresourcedefinitions:type=spec
113130 // TLS - Parameters related to the TLS
@@ -118,6 +135,11 @@ type CeilometerSpecCore struct {
118135 // KSMTLS - Parameters related to the TLS for kube-state-metrics
119136 KSMTLS tls.SimpleService `json:"ksmTls,omitempty"`
120137
138+ // +kubebuilder:validation:Optional
139+ // +operator-sdk:csv:customresourcedefinitions:type=spec
140+ // MysqldExporterTLS - Parameters related to the TLS for mysqld_exporter
141+ MysqldExporterTLS tls.SimpleService `json:"mysqldExporterTLS,omitempty"`
142+
121143 // +kubebuilder:validation:Optional
122144 // NodeSelector to target subset of worker nodes running this service
123145 NodeSelector * map [string ]string `json:"nodeSelector,omitempty"`
@@ -145,6 +167,8 @@ type CeilometerStatus struct {
145167 // then the controller has not processed the latest changes injected by
146168 // the openstack-operator in the top-level CR (e.g. the ContainerImage)
147169 ObservedGeneration int64 `json:"observedGeneration,omitempty"`
170+
171+ MysqldExporterStatus MysqldExporterStatus `json:"mysqldExporterStatus,omitempty"`
148172}
149173
150174// KSMStatus defines the observed state of kube-state-metrics
@@ -165,6 +189,21 @@ type KSMStatus struct {
165189 ObservedGeneration int64 `json:"observedGeneration,omitempty"`
166190}
167191
192+ // MysqldExporterStatus defines the observed state of mysqld_exporter
193+ type MysqldExporterStatus struct {
194+ // ReadyCount of mysqld_exporter instances
195+ ReadyCount int32 `json:"readyCount,omitempty"`
196+
197+ // Map of hashes to track e.g. job status
198+ Hash map [string ]string `json:"hash,omitempty"`
199+
200+ // Conditions
201+ Conditions condition.Conditions `json:"conditions,omitempty" optional:"true"`
202+
203+ // List of galera CRs, which are being exported with mysqld_exporter
204+ ExportedGaleras []string `json:"exportedGaleras,omitempty"`
205+ }
206+
168207//+kubebuilder:object:root=true
169208//+kubebuilder:subresource:status
170209//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[0].status",description="Status"
@@ -218,13 +257,14 @@ func (instance Ceilometer) RbacResourceName() string {
218257func SetupDefaultsCeilometer () {
219258 // Acquire environmental defaults and initialize Telemetry defaults with them
220259 ceilometerDefaults := CeilometerDefaults {
221- CentralContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_CENTRAL_IMAGE_URL_DEFAULT" , CeilometerCentralContainerImage ),
222- SgCoreContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_SGCORE_IMAGE_URL_DEFAULT" , CeilometerSgCoreContainerImage ),
223- NotificationContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT" , CeilometerNotificationContainerImage ),
224- ComputeContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT" , CeilometerComputeContainerImage ),
225- IpmiContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_IPMI_IMAGE_URL_DEFAULT" , CeilometerIpmiContainerImage ),
226- ProxyContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_APACHE_IMAGE_URL_DEFAULT" , CeilometerProxyContainerImage ),
227- KSMContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_KSM_IMAGE_URL_DEFAULT" , KubeStateMetricsImage ),
260+ CentralContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_CENTRAL_IMAGE_URL_DEFAULT" , CeilometerCentralContainerImage ),
261+ SgCoreContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_SGCORE_IMAGE_URL_DEFAULT" , CeilometerSgCoreContainerImage ),
262+ NotificationContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT" , CeilometerNotificationContainerImage ),
263+ ComputeContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT" , CeilometerComputeContainerImage ),
264+ IpmiContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_CEILOMETER_IPMI_IMAGE_URL_DEFAULT" , CeilometerIpmiContainerImage ),
265+ ProxyContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_APACHE_IMAGE_URL_DEFAULT" , CeilometerProxyContainerImage ),
266+ KSMContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_KSM_IMAGE_URL_DEFAULT" , KubeStateMetricsImage ),
267+ MysqldExporterContainerImageURL : util .GetEnvVar ("RELATED_IMAGE_MYSQLD_EXPORTER_IMAGE_URL_DEFAULT" , MysqldExporterContainerImage ),
228268 }
229269
230270 SetupCeilometerDefaults (ceilometerDefaults )
0 commit comments