diff --git a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml index 34c0a28ae..26e53a568 100644 --- a/apis/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/apis/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -457,68 +457,6 @@ spec: - serviceAccount type: object type: object - ceilometer: - properties: - enabled: - default: true - type: boolean - template: - properties: - centralImage: - type: string - computeImage: - type: string - customServiceConfig: - default: '# add your customization here' - type: string - defaultConfigOverwrite: - additionalProperties: - type: string - type: object - ipmiImage: - type: string - networkAttachmentDefinitions: - items: - type: string - type: array - nodeExporterImage: - type: string - notificationImage: - type: string - passwordSelector: - default: - service: CeilometerPassword - properties: - aodhService: - default: AodhPassword - type: string - database: - default: AodhDatabasePassword - type: string - service: - default: CeilometerPassword - type: string - type: object - rabbitMqClusterName: - default: rabbitmq - type: string - secret: - type: string - serviceUser: - default: ceilometer - type: string - sgCoreImage: - type: string - required: - - centralImage - - computeImage - - ipmiImage - - nodeExporterImage - - notificationImage - - secret - - sgCoreImage - type: object - type: object cinder: properties: apiOverride: @@ -15178,6 +15116,211 @@ spec: - swiftStorage type: object type: object + telemetry: + properties: + enabled: + default: true + type: boolean + template: + properties: + autoscaling: + properties: + aodh: + properties: + apiImage: + type: string + customServiceConfig: + default: '# add your customization here' + type: string + databaseInstance: + type: string + databaseUser: + default: aodh + type: string + defaultConfigOverwrite: + additionalProperties: + type: string + type: object + evaluatorImage: + type: string + listenerImage: + type: string + memcachedInstance: + default: memcached + type: string + networkAttachmentDefinitions: + items: + type: string + type: array + notifierImage: + type: string + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + passwordSelector: + default: + aodhService: AodhPassword + database: AodhDatabasePassword + properties: + aodhService: + default: AodhPassword + type: string + database: + default: AodhDatabasePassword + type: string + service: + default: CeilometerPassword + type: string + type: object + preserveJobs: + default: false + type: boolean + rabbitMqClusterName: + default: rabbitmq + type: string + secret: + type: string + serviceUser: + default: aodh + type: string + required: + - apiImage + - databaseInstance + - evaluatorImage + - listenerImage + - memcachedInstance + - notifierImage + - secret + type: object + enabled: + default: false + type: boolean + heatInstance: + default: heat + type: string + prometheus: + properties: + deployPrometheus: + default: false + type: boolean + host: + type: string + port: + format: int32 + maximum: 65535 + minimum: 1 + type: integer + type: object + required: + - heatInstance + type: object + ceilometer: + properties: + centralImage: + type: string + computeImage: + type: string + customServiceConfig: + default: '# add your customization here' + type: string + defaultConfigOverwrite: + additionalProperties: + type: string + type: object + enabled: + default: true + type: boolean + ipmiImage: + type: string + networkAttachmentDefinitions: + items: + type: string + type: array + nodeExporterImage: + type: string + notificationImage: + type: string + passwordSelector: + default: + service: CeilometerPassword + properties: + aodhService: + default: AodhPassword + type: string + database: + default: AodhDatabasePassword + type: string + service: + default: CeilometerPassword + type: string + type: object + rabbitMqClusterName: + default: rabbitmq + type: string + secret: + type: string + serviceUser: + default: ceilometer + type: string + sgCoreImage: + type: string + required: + - centralImage + - computeImage + - ipmiImage + - nodeExporterImage + - notificationImage + - secret + - sgCoreImage + type: object + type: object + type: object tls: default: endpoint: diff --git a/apis/core/v1beta1/conditions.go b/apis/core/v1beta1/conditions.go index 464504546..5729afe3c 100644 --- a/apis/core/v1beta1/conditions.go +++ b/apis/core/v1beta1/conditions.go @@ -105,8 +105,8 @@ const ( // OpenStackControlPlaneCAReadyCondition Status=True condition which indicates if the CAs are configured and operational OpenStackControlPlaneCAReadyCondition condition.Type = "OpenStackControlPlaneCAReadyCondition" - // OpenStackControlPlaneCeilometerReadyCondition Status=True condition which indicates if OpenStack Ceilometer service is configured and operational - OpenStackControlPlaneCeilometerReadyCondition condition.Type = "OpenStackControlPlaneCeilometerReady" + // OpenStackControlPlaneTelemetryReadyCondition Status=True condition which indicates if OpenStack Telemetry service is configured and operational + OpenStackControlPlaneTelemetryReadyCondition condition.Type = "OpenStackControlPlaneTelemetryReady" // OpenStackControlPlaneServiceOverrideReadyCondition Status=True condition which indicates if OpenStack service override has created ok OpenStackControlPlaneServiceOverrideReadyCondition condition.Type = "OpenStackControlPlaneServiceOverrideReady" @@ -355,17 +355,17 @@ const ( // OpenStackControlPlaneDNSReadyErrorMessage OpenStackControlPlaneDNSReadyErrorMessage = "OpenStackControlPlane DNS error occured %s" - // OpenStackControlPlaneCeilometerReadyInitMessage - OpenStackControlPlaneCeilometerReadyInitMessage = "OpenStackControlPlane Ceilometer not started" + // OpenStackControlPlaneTelemetryReadyInitMessage + OpenStackControlPlaneTelemetryReadyInitMessage = "OpenStackControlPlane Telemetry not started" - // OpenStackControlPlaneCeilometerReadyMessage - OpenStackControlPlaneCeilometerReadyMessage = "OpenStackControlPlane Ceilometer completed" + // OpenStackControlPlaneTelemetryReadyMessage + OpenStackControlPlaneTelemetryReadyMessage = "OpenStackControlPlane Telemetry completed" - // OpenStackControlPlaneCeilometerReadyRunningMessage - OpenStackControlPlaneCeilometerReadyRunningMessage = "OpenStackControlPlane Ceilometer in progress" + // OpenStackControlPlaneTelemetryReadyRunningMessage + OpenStackControlPlaneTelemetryReadyRunningMessage = "OpenStackControlPlane Telemetry in progress" - // OpenStackControlPlaneCeilometerReadyErrorMessage - OpenStackControlPlaneCeilometerReadyErrorMessage = "OpenStackControlPlane Ceilometer error occured %s" + // OpenStackControlPlaneTelemetryReadyErrorMessage + OpenStackControlPlaneTelemetryReadyErrorMessage = "OpenStackControlPlane Telemetry error occured %s" // OpenStackControlPlaneOctaviaReadyInitMessage OpenStackControlPlaneOctaviaReadyInitMessage = "OpenStackControlPlane Octavia not started" diff --git a/apis/core/v1beta1/openstackcontrolplane_types.go b/apis/core/v1beta1/openstackcontrolplane_types.go index e8af7c9d7..26d5a5bac 100644 --- a/apis/core/v1beta1/openstackcontrolplane_types.go +++ b/apis/core/v1beta1/openstackcontrolplane_types.go @@ -157,8 +157,8 @@ type OpenStackControlPlaneSpec struct { Horizon HorizonSection `json:"horizon,omitempty"` // +kubebuilder:validation:Optional - // Ceilometer - Parameters related to the OpenStack Ceilometer service - Ceilometer CeilometerSection `json:"ceilometer,omitempty"` + // Telemetry - Parameters related to the OpenStack Telemetry services + Telemetry TelemetrySection `json:"telemetry,omitempty"` // Swift - Parameters related to the Swift service Swift SwiftSection `json:"swift,omitempty"` @@ -554,18 +554,18 @@ type HorizonSection struct { APIOverride Override `json:"apiOverride,omitempty"` } -// CeilometerSection defines the desired state of OpenStack Telemetry services -type CeilometerSection struct { +// TelemetrySection defines the desired state of OpenStack Telemetry services +type TelemetrySection struct { // +kubebuilder:validation:Optional // +kubebuilder:default=true // +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"} - // Enabled - Whether OpenStack Ceilometer servicesshould be deployed and managed + // Enabled - Whether OpenStack Telemetry services should be deployed and managed Enabled bool `json:"enabled"` // +kubebuilder:validation:Optional //+operator-sdk:csv:customresourcedefinitions:type=spec - // Template - Overrides to use when creating the OpenStack Ceilometer service - Template telemetryv1.CeilometerSpec `json:"template,omitempty"` + // Template - Overrides to use when creating the OpenStack Telemetry services + Template telemetryv1.TelemetrySpec `json:"template,omitempty"` } // SwiftSection defines the desired state of Swift service @@ -742,7 +742,7 @@ func (instance *OpenStackControlPlane) InitConditions() { condition.UnknownCondition(OpenStackControlPlaneManilaReadyCondition, condition.InitReason, OpenStackControlPlaneManilaReadyInitMessage), condition.UnknownCondition(OpenStackControlPlaneHorizonReadyCondition, condition.InitReason, OpenStackControlPlaneHorizonReadyInitMessage), condition.UnknownCondition(OpenStackControlPlaneDNSReadyCondition, condition.InitReason, OpenStackControlPlaneDNSReadyInitMessage), - condition.UnknownCondition(OpenStackControlPlaneCeilometerReadyCondition, condition.InitReason, OpenStackControlPlaneCeilometerReadyInitMessage), + condition.UnknownCondition(OpenStackControlPlaneTelemetryReadyCondition, condition.InitReason, OpenStackControlPlaneTelemetryReadyInitMessage), condition.UnknownCondition(OpenStackControlPlaneHeatReadyCondition, condition.InitReason, OpenStackControlPlaneHeatReadyInitMessage), condition.UnknownCondition(OpenStackControlPlaneSwiftReadyCondition, condition.InitReason, OpenStackControlPlaneSwiftReadyInitMessage), condition.UnknownCondition(OpenStackControlPlaneOctaviaReadyCondition, condition.InitReason, OpenStackControlPlaneOctaviaReadyInitMessage), diff --git a/apis/core/v1beta1/openstackcontrolplane_webhook.go b/apis/core/v1beta1/openstackcontrolplane_webhook.go index 59f564738..ebee0db99 100644 --- a/apis/core/v1beta1/openstackcontrolplane_webhook.go +++ b/apis/core/v1beta1/openstackcontrolplane_webhook.go @@ -412,8 +412,8 @@ func (r *OpenStackControlPlane) DefaultServices() { // DNS r.Spec.DNS.Template.Default() - // Ceilometer - r.Spec.Ceilometer.Template.Default() + // Telemetry + r.Spec.Telemetry.Template.Default() // Heat r.Spec.Heat.Template.Default() diff --git a/apis/core/v1beta1/zz_generated.deepcopy.go b/apis/core/v1beta1/zz_generated.deepcopy.go index 54ecdd009..7675c7300 100644 --- a/apis/core/v1beta1/zz_generated.deepcopy.go +++ b/apis/core/v1beta1/zz_generated.deepcopy.go @@ -50,22 +50,6 @@ func (in *BarbicanSection) DeepCopy() *BarbicanSection { return out } -// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. -func (in *CeilometerSection) DeepCopyInto(out *CeilometerSection) { - *out = *in - in.Template.DeepCopyInto(&out.Template) -} - -// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CeilometerSection. -func (in *CeilometerSection) DeepCopy() *CeilometerSection { - if in == nil { - return nil - } - out := new(CeilometerSection) - in.DeepCopyInto(out) - return out -} - // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CinderSection) DeepCopyInto(out *CinderSection) { *out = *in @@ -477,7 +461,7 @@ func (in *OpenStackControlPlaneSpec) DeepCopyInto(out *OpenStackControlPlaneSpec in.Ironic.DeepCopyInto(&out.Ironic) in.Manila.DeepCopyInto(&out.Manila) in.Horizon.DeepCopyInto(&out.Horizon) - in.Ceilometer.DeepCopyInto(&out.Ceilometer) + in.Telemetry.DeepCopyInto(&out.Telemetry) in.Swift.DeepCopyInto(&out.Swift) in.Octavia.DeepCopyInto(&out.Octavia) in.Designate.DeepCopyInto(&out.Designate) @@ -758,3 +742,19 @@ func (in *TLSServiceOverride) DeepCopy() *TLSServiceOverride { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *TelemetrySection) DeepCopyInto(out *TelemetrySection) { + *out = *in + in.Template.DeepCopyInto(&out.Template) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TelemetrySection. +func (in *TelemetrySection) DeepCopy() *TelemetrySection { + if in == nil { + return nil + } + out := new(TelemetrySection) + in.DeepCopyInto(out) + return out +} diff --git a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml index 34c0a28ae..26e53a568 100644 --- a/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml +++ b/config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml @@ -457,68 +457,6 @@ spec: - serviceAccount type: object type: object - ceilometer: - properties: - enabled: - default: true - type: boolean - template: - properties: - centralImage: - type: string - computeImage: - type: string - customServiceConfig: - default: '# add your customization here' - type: string - defaultConfigOverwrite: - additionalProperties: - type: string - type: object - ipmiImage: - type: string - networkAttachmentDefinitions: - items: - type: string - type: array - nodeExporterImage: - type: string - notificationImage: - type: string - passwordSelector: - default: - service: CeilometerPassword - properties: - aodhService: - default: AodhPassword - type: string - database: - default: AodhDatabasePassword - type: string - service: - default: CeilometerPassword - type: string - type: object - rabbitMqClusterName: - default: rabbitmq - type: string - secret: - type: string - serviceUser: - default: ceilometer - type: string - sgCoreImage: - type: string - required: - - centralImage - - computeImage - - ipmiImage - - nodeExporterImage - - notificationImage - - secret - - sgCoreImage - type: object - type: object cinder: properties: apiOverride: @@ -15178,6 +15116,211 @@ spec: - swiftStorage type: object type: object + telemetry: + properties: + enabled: + default: true + type: boolean + template: + properties: + autoscaling: + properties: + aodh: + properties: + apiImage: + type: string + customServiceConfig: + default: '# add your customization here' + type: string + databaseInstance: + type: string + databaseUser: + default: aodh + type: string + defaultConfigOverwrite: + additionalProperties: + type: string + type: object + evaluatorImage: + type: string + listenerImage: + type: string + memcachedInstance: + default: memcached + type: string + networkAttachmentDefinitions: + items: + type: string + type: array + notifierImage: + type: string + override: + properties: + service: + properties: + endpointURL: + type: string + metadata: + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + type: object + spec: + properties: + externalName: + type: string + externalTrafficPolicy: + type: string + internalTrafficPolicy: + type: string + ipFamilyPolicy: + type: string + loadBalancerClass: + type: string + loadBalancerSourceRanges: + items: + type: string + type: array + sessionAffinity: + type: string + sessionAffinityConfig: + properties: + clientIP: + properties: + timeoutSeconds: + format: int32 + type: integer + type: object + type: object + type: + type: string + type: object + type: object + type: object + passwordSelector: + default: + aodhService: AodhPassword + database: AodhDatabasePassword + properties: + aodhService: + default: AodhPassword + type: string + database: + default: AodhDatabasePassword + type: string + service: + default: CeilometerPassword + type: string + type: object + preserveJobs: + default: false + type: boolean + rabbitMqClusterName: + default: rabbitmq + type: string + secret: + type: string + serviceUser: + default: aodh + type: string + required: + - apiImage + - databaseInstance + - evaluatorImage + - listenerImage + - memcachedInstance + - notifierImage + - secret + type: object + enabled: + default: false + type: boolean + heatInstance: + default: heat + type: string + prometheus: + properties: + deployPrometheus: + default: false + type: boolean + host: + type: string + port: + format: int32 + maximum: 65535 + minimum: 1 + type: integer + type: object + required: + - heatInstance + type: object + ceilometer: + properties: + centralImage: + type: string + computeImage: + type: string + customServiceConfig: + default: '# add your customization here' + type: string + defaultConfigOverwrite: + additionalProperties: + type: string + type: object + enabled: + default: true + type: boolean + ipmiImage: + type: string + networkAttachmentDefinitions: + items: + type: string + type: array + nodeExporterImage: + type: string + notificationImage: + type: string + passwordSelector: + default: + service: CeilometerPassword + properties: + aodhService: + default: AodhPassword + type: string + database: + default: AodhDatabasePassword + type: string + service: + default: CeilometerPassword + type: string + type: object + rabbitMqClusterName: + default: rabbitmq + type: string + secret: + type: string + serviceUser: + default: ceilometer + type: string + sgCoreImage: + type: string + required: + - centralImage + - computeImage + - ipmiImage + - nodeExporterImage + - notificationImage + - secret + - sgCoreImage + type: object + type: object + type: object tls: default: endpoint: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 401a26acf..467687bc9 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -457,7 +457,7 @@ rules: - apiGroups: - telemetry.openstack.org resources: - - ceilometers + - telemetries verbs: - create - delete diff --git a/config/samples/core_v1beta1_openstackcontrolplane.yaml b/config/samples/core_v1beta1_openstackcontrolplane.yaml index a7dc95f53..a1fcca643 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane.yaml @@ -148,12 +148,21 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + enabled: false + prometheus: + deployPrometheus: false + aodh: + databaseInstance: openstack + memcachedInstance: memcached + secret: osp-secret + heatInstance: heat + ceilometer: + enabled: true + secret: osp-secret swift: enabled: true template: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml b/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml index 2244d3587..136ab94c6 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_collapsed_cell.yaml @@ -121,9 +121,18 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + enabled: false + prometheus: + deployPrometheus: false + aodh: + databaseInstance: openstack + memcachedInstance: memcached + secret: osp-secret + heatInstance: heat + ceilometer: + enabled: true + secret: osp-secret diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml index 9294d7187..7b5dc99e2 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera.yaml @@ -141,12 +141,21 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + enabled: false + prometheus: + deployPrometheus: false + aodh: + databaseInstance: openstack + memcachedInstance: memcached + secret: osp-secret + heatInstance: heat + ceilometer: + enabled: true + secret: osp-secret swift: enabled: true template: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml index 68a315146..110fffa64 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_3replicas.yaml @@ -131,12 +131,21 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + enabled: false + prometheus: + deployPrometheus: false + aodh: + databaseInstance: openstack + memcachedInstance: memcached + secret: osp-secret + heatInstance: heat + ceilometer: + enabled: true + secret: osp-secret octavia: enabled: false template: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml index a673be024..ac7332188 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation.yaml @@ -315,12 +315,21 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + enabled: false + prometheus: + deployPrometheus: false + aodh: + databaseInstance: openstack + memcachedInstance: memcached + secret: osp-secret + heatInstance: heat + ceilometer: + enabled: true + secret: osp-secret swift: enabled: true proxyOverride: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml index 157b11e1b..d32eab4f3 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_galera_network_isolation_3replicas.yaml @@ -317,12 +317,21 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + enabled: false + prometheus: + deployPrometheus: false + aodh: + databaseInstance: openstack + memcachedInstance: memcached + secret: osp-secret + heatInstance: heat + ceilometer: + enabled: true + secret: osp-secret swift: enabled: true proxyOverride: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml index d6dc7ac73..9ea67b525 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation.yaml @@ -303,12 +303,21 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + enabled: false + prometheus: + deployPrometheus: false + aodh: + databaseInstance: openstack + memcachedInstance: memcached + secret: osp-secret + heatInstance: heat + ceilometer: + enabled: true + secret: osp-secret swift: enabled: true proxyOverride: diff --git a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml index 1d606a1e6..3c5d096ba 100644 --- a/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml +++ b/config/samples/core_v1beta1_openstackcontrolplane_network_isolation_ceph.yaml @@ -358,12 +358,21 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + enabled: false + prometheus: + deployPrometheus: false + aodh: + databaseInstance: openstack + memcachedInstance: memcached + secret: osp-secret + heatInstance: heat + ceilometer: + enabled: true + secret: osp-secret octavia: enabled: false template: diff --git a/controllers/core/openstackcontrolplane_controller.go b/controllers/core/openstackcontrolplane_controller.go index 96aa12198..bb8ff387d 100644 --- a/controllers/core/openstackcontrolplane_controller.go +++ b/controllers/core/openstackcontrolplane_controller.go @@ -94,7 +94,7 @@ func (r *OpenStackControlPlaneReconciler) GetLogger(ctx context.Context) logr.Lo //+kubebuilder:rbac:groups=ovn.openstack.org,resources=ovncontrollers,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=rabbitmq.com,resources=rabbitmqclusters,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=network.openstack.org,resources=dnsmasqs,verbs=get;list;watch;create;update;patch;delete -//+kubebuilder:rbac:groups=telemetry.openstack.org,resources=ceilometers,verbs=get;list;watch;create;update;patch;delete +//+kubebuilder:rbac:groups=telemetry.openstack.org,resources=telemetries,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=swift.openstack.org,resources=swifts,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=octavia.openstack.org,resources=octavias,verbs=get;list;watch;create;update;patch;delete //+kubebuilder:rbac:groups=barbican.openstack.org,resources=barbicans,verbs=get;list;watch;create;update;patch;delete @@ -302,7 +302,7 @@ func (r *OpenStackControlPlaneReconciler) reconcileNormal(ctx context.Context, i return ctrlResult, nil } - ctrlResult, err = openstack.ReconcileCeilometer(ctx, instance, helper) + ctrlResult, err = openstack.ReconcileTelemetry(ctx, instance, helper) if err != nil { return ctrl.Result{}, err } else if (ctrlResult != ctrl.Result{}) { @@ -371,7 +371,7 @@ func (r *OpenStackControlPlaneReconciler) SetupWithManager(mgr ctrl.Manager) err Owns(&heatv1.Heat{}). Owns(&ironicv1.Ironic{}). Owns(&horizonv1.Horizon{}). - Owns(&telemetryv1.Ceilometer{}). + Owns(&telemetryv1.Telemetry{}). Owns(&redisv1.Redis{}). Owns(&octaviav1.Octavia{}). Owns(&designatev1.Designate{}). diff --git a/pkg/openstack/ceilometer.go b/pkg/openstack/ceilometer.go deleted file mode 100644 index 2bb0ad8f6..000000000 --- a/pkg/openstack/ceilometer.go +++ /dev/null @@ -1,82 +0,0 @@ -package openstack - -import ( - "context" - "fmt" - - "github.com/openstack-k8s-operators/lib-common/modules/common/condition" - "github.com/openstack-k8s-operators/lib-common/modules/common/helper" - - corev1beta1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1" - telemetryv1 "github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" -) - -const ( - ceilometerNamespaceLabel = "Ceilometer.Namespace" - ceilometerNameLabel = "Ceilometer.Name" - ceilometerName = "ceilometer" -) - -// ReconcileCeilometer ... -func ReconcileCeilometer(ctx context.Context, instance *corev1beta1.OpenStackControlPlane, helper *helper.Helper) (ctrl.Result, error) { - ceilometer := &telemetryv1.Ceilometer{ - ObjectMeta: metav1.ObjectMeta{ - Name: ceilometerName, - Namespace: instance.Namespace, - }, - } - - Log := GetLogger(ctx) - - if !instance.Spec.Ceilometer.Enabled { - if res, err := EnsureDeleted(ctx, helper, ceilometer); err != nil { - return res, err - } - instance.Status.Conditions.Remove(corev1beta1.OpenStackControlPlaneCeilometerReadyCondition) - return ctrl.Result{}, nil - } - - Log.Info("Reconciling Ceilometer", ceilometerNamespaceLabel, instance.Namespace, ceilometerNameLabel, ceilometerName) - op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), ceilometer, func() error { - instance.Spec.Ceilometer.Template.DeepCopyInto(&ceilometer.Spec) - - if ceilometer.Spec.Secret == "" { - ceilometer.Spec.Secret = instance.Spec.Secret - } - - err := controllerutil.SetControllerReference(helper.GetBeforeObject(), ceilometer, helper.GetScheme()) - if err != nil { - return err - } - return nil - }) - - if err != nil { - instance.Status.Conditions.Set(condition.FalseCondition( - corev1beta1.OpenStackControlPlaneCeilometerReadyCondition, - condition.ErrorReason, - condition.SeverityWarning, - corev1beta1.OpenStackControlPlaneCeilometerReadyErrorMessage, - err.Error())) - return ctrl.Result{}, err - } - if op != controllerutil.OperationResultNone { - Log.Info(fmt.Sprintf("%s %s - %s", ceilometerName, ceilometer.Name, op)) - } - - if ceilometer.IsReady() { - instance.Status.Conditions.MarkTrue(corev1beta1.OpenStackControlPlaneCeilometerReadyCondition, corev1beta1.OpenStackControlPlaneCeilometerReadyMessage) - } else { - instance.Status.Conditions.Set(condition.FalseCondition( - corev1beta1.OpenStackControlPlaneCeilometerReadyCondition, - condition.RequestedReason, - condition.SeverityInfo, - corev1beta1.OpenStackControlPlaneCeilometerReadyRunningMessage)) - } - - return ctrl.Result{}, nil -} diff --git a/pkg/openstack/common.go b/pkg/openstack/common.go index 16e428955..bf78bec23 100644 --- a/pkg/openstack/common.go +++ b/pkg/openstack/common.go @@ -499,8 +499,8 @@ func SetupServiceOperatorDefaults() { // DNS networkv1.SetupDefaults() - // Ceilometer - telemetryv1.SetupDefaultsCeilometer() + // Telemetry + telemetryv1.SetupDefaultsTelemetry() // Swift swiftv1.SetupDefaults() diff --git a/pkg/openstack/heat.go b/pkg/openstack/heat.go index 879a7ff14..7df0f4208 100644 --- a/pkg/openstack/heat.go +++ b/pkg/openstack/heat.go @@ -20,11 +20,15 @@ import ( ctrl "sigs.k8s.io/controller-runtime" ) +const ( + heatName = "heat" +) + // ReconcileHeat - func ReconcileHeat(ctx context.Context, instance *corev1beta1.OpenStackControlPlane, helper *helper.Helper) (ctrl.Result, error) { heat := &heatv1.Heat{ ObjectMeta: metav1.ObjectMeta{ - Name: "heat", + Name: heatName, Namespace: instance.Namespace, }, } diff --git a/pkg/openstack/telemetry.go b/pkg/openstack/telemetry.go new file mode 100644 index 000000000..cbe776dbe --- /dev/null +++ b/pkg/openstack/telemetry.go @@ -0,0 +1,91 @@ +package openstack + +import ( + "context" + "fmt" + + "github.com/openstack-k8s-operators/lib-common/modules/common/condition" + "github.com/openstack-k8s-operators/lib-common/modules/common/helper" + + corev1beta1 "github.com/openstack-k8s-operators/openstack-operator/apis/core/v1beta1" + telemetryv1 "github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1" + + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" +) + +const ( + telemetryNamespaceLabel = "Telemetry.Namespace" + telemetryNameLabel = "Telemetry.Name" + telemetryName = "telemetry" +) + +// ReconcileTelemetry puts telemetry resources to required state +func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackControlPlane, helper *helper.Helper) (ctrl.Result, error) { + telemetry := &telemetryv1.Telemetry{ + ObjectMeta: metav1.ObjectMeta{ + Name: telemetryName, + Namespace: instance.Namespace, + }, + } + + if !instance.Spec.Telemetry.Enabled { + if res, err := EnsureDeleted(ctx, helper, telemetry); err != nil { + return res, err + } + instance.Status.Conditions.Remove(corev1beta1.OpenStackControlPlaneTelemetryReadyCondition) + return ctrl.Result{}, nil + } + + helper.GetLogger().Info("Reconciling Telemetry", telemetryNamespaceLabel, instance.Namespace, telemetryNameLabel, telemetryName) + op, err := controllerutil.CreateOrPatch(ctx, helper.GetClient(), telemetry, func() error { + instance.Spec.Telemetry.Template.DeepCopyInto(&telemetry.Spec) + + if telemetry.Spec.Ceilometer.Secret == "" { + telemetry.Spec.Ceilometer.Secret = instance.Spec.Secret + } + + if telemetry.Spec.Autoscaling.Aodh.DatabaseInstance == "" { + // TODO(mmagr): Fix once this is not hardcoded in rest of the operator + telemetry.Spec.Autoscaling.Aodh.DatabaseInstance = "openstack" + } + if telemetry.Spec.Autoscaling.Aodh.Secret == "" { + telemetry.Spec.Autoscaling.Aodh.Secret = instance.Spec.Secret + } + if telemetry.Spec.Autoscaling.HeatInstance == "" { + telemetry.Spec.Autoscaling.HeatInstance = heatName + } + + err := controllerutil.SetControllerReference(helper.GetBeforeObject(), telemetry, helper.GetScheme()) + if err != nil { + return err + } + return nil + }) + + if err != nil { + instance.Status.Conditions.Set(condition.FalseCondition( + corev1beta1.OpenStackControlPlaneTelemetryReadyCondition, + condition.ErrorReason, + condition.SeverityWarning, + corev1beta1.OpenStackControlPlaneTelemetryReadyErrorMessage, + err.Error())) + return ctrl.Result{}, err + } + if op != controllerutil.OperationResultNone { + helper.GetLogger().Info(fmt.Sprintf("%s %s - %s", telemetryName, telemetry.Name, op)) + } + + if telemetry.IsReady() { + instance.Status.Conditions.MarkTrue(corev1beta1.OpenStackControlPlaneTelemetryReadyCondition, corev1beta1.OpenStackControlPlaneTelemetryReadyMessage) + } else { + instance.Status.Conditions.Set(condition.FalseCondition( + corev1beta1.OpenStackControlPlaneTelemetryReadyCondition, + condition.RequestedReason, + condition.SeverityInfo, + corev1beta1.OpenStackControlPlaneTelemetryReadyRunningMessage)) + } + + return ctrl.Result{}, nil +} diff --git a/tests/kuttl/common/assert-sample-deployment.yaml b/tests/kuttl/common/assert-sample-deployment.yaml index f1a044da6..f134336cf 100644 --- a/tests/kuttl/common/assert-sample-deployment.yaml +++ b/tests/kuttl/common/assert-sample-deployment.yaml @@ -127,12 +127,18 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + aodh: + secret: osp-secret + serviceUser: aodh + ceilometer: + passwordSelector: + service: CeilometerPassword + secret: osp-secret + serviceUser: ceilometer swift: enabled: true template: @@ -190,10 +196,6 @@ status: reason: Ready status: "True" type: OpenStackControlPlaneCAReadyCondition - - message: OpenStackControlPlane Ceilometer completed - reason: Ready - status: "True" - type: OpenStackControlPlaneCeilometerReady - message: OpenStackControlPlane Cinder completed reason: Ready status: "True" @@ -274,3 +276,7 @@ status: reason: Ready status: "True" type: OpenStackControlPlaneSwiftReady + - message: OpenStackControlPlane Telemetry completed + reason: Ready + status: "True" + type: OpenStackControlPlaneTelemetryReady diff --git a/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml b/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml index a07301179..0e6cd2d3f 100644 --- a/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml +++ b/tests/kuttl/tests/collapsed/01-assert-collapsed-cell.yaml @@ -100,12 +100,18 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + aodh: + secret: osp-secret + serviceUser: aodh + ceilometer: + passwordSelector: + service: CeilometerPassword + secret: osp-secret + serviceUser: ceilometer barbican: enabled: true template: @@ -137,10 +143,6 @@ status: reason: Ready status: "True" type: OpenStackControlPlaneCAReadyCondition - - message: OpenStackControlPlane Ceilometer completed - reason: Ready - status: "True" - type: OpenStackControlPlaneCeilometerReady - message: OpenStackControlPlane Cinder completed reason: Ready status: "True" @@ -213,3 +215,7 @@ status: reason: Ready status: "True" type: OpenStackControlPlaneRabbitMQReady + - message: OpenStackControlPlane Telemetry completed + reason: Ready + status: "True" + type: OpenStackControlPlaneTelemetryReady diff --git a/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml b/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml index e84a56d4c..fb8cc8d88 100644 --- a/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml +++ b/tests/kuttl/tests/galera-3replicas/01-assert-galera-3replicas.yaml @@ -121,12 +121,18 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + aodh: + secret: osp-secret + serviceUser: aodh + ceilometer: + passwordSelector: + service: CeilometerPassword + secret: osp-secret + serviceUser: ceilometer tls: endpoint: internal: @@ -147,10 +153,6 @@ status: reason: Ready status: "True" type: OpenStackControlPlaneCAReadyCondition - - message: OpenStackControlPlane Ceilometer completed - reason: Ready - status: "True" - type: OpenStackControlPlaneCeilometerReady - message: OpenStackControlPlane Cinder completed reason: Ready status: "True" @@ -223,3 +225,7 @@ status: reason: Ready status: "True" type: OpenStackControlPlaneRabbitMQReady + - message: OpenStackControlPlane Telemetry completed + reason: Ready + status: "True" + type: OpenStackControlPlaneTelemetryReady diff --git a/tests/kuttl/tests/galera-basic/01-assert-galera.yaml b/tests/kuttl/tests/galera-basic/01-assert-galera.yaml index 16ad79517..b40029991 100644 --- a/tests/kuttl/tests/galera-basic/01-assert-galera.yaml +++ b/tests/kuttl/tests/galera-basic/01-assert-galera.yaml @@ -131,12 +131,18 @@ spec: ironicNeutronAgent: replicas: 1 secret: osp-secret - ceilometer: + telemetry: + enabled: true template: - passwordSelector: - service: CeilometerPassword - secret: osp-secret - serviceUser: ceilometer + autoscaling: + aodh: + secret: osp-secret + serviceUser: aodh + ceilometer: + passwordSelector: + service: CeilometerPassword + secret: osp-secret + serviceUser: ceilometer swift: enabled: true template: @@ -166,10 +172,6 @@ status: reason: Ready status: "True" type: OpenStackControlPlaneCAReadyCondition - - message: OpenStackControlPlane Ceilometer completed - reason: Ready - status: "True" - type: OpenStackControlPlaneCeilometerReady - message: OpenStackControlPlane Cinder completed reason: Ready status: "True" @@ -250,3 +252,7 @@ status: reason: Ready status: "True" type: OpenStackControlPlaneSwiftReady + - message: OpenStackControlPlane Telemetry completed + reason: Ready + status: "True" + type: OpenStackControlPlaneTelemetryReady