Skip to content

Commit

Permalink
Merge pull request #240 from vyzigold/telemetry
Browse files Browse the repository at this point in the history
Rewrite telemetry resource
  • Loading branch information
openshift-merge-bot[bot] authored Nov 21, 2023
2 parents 5fdafd0 + cfcdea8 commit dd28e47
Show file tree
Hide file tree
Showing 10 changed files with 281 additions and 102 deletions.
23 changes: 17 additions & 6 deletions api/bases/telemetry.openstack.org_telemetries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ spec:
description: TelemetrySpec defines the desired state of Telemetry
properties:
autoscaling:
description: Autoscaling - Spec definition for the Autoscaling service
of this Telemetry deployment
description: Autoscaling - Parameters related to the autoscaling service
properties:
aodh:
description: Aodh spec
Expand Down Expand Up @@ -318,6 +317,11 @@ spec:
- notifierImage
- secret
type: object
enabled:
default: false
description: Enabled - Whether OpenStack autoscaling service should
be deployed and managed
type: boolean
heatInstance:
default: heat
description: Heat instance name.
Expand Down Expand Up @@ -345,8 +349,7 @@ spec:
- heatInstance
type: object
ceilometer:
description: Ceilometer - Spec definition for the Ceilometer service
of this Telemetry deployment
description: Ceilometer - Parameters related to the ceilometer service
properties:
centralImage:
type: string
Expand All @@ -368,6 +371,11 @@ spec:
also be used to add additional files. Those get added to the
service config dir in /etc/<service> . TODO: -> implement'
type: object
enabled:
default: true
description: Enabled - Whether OpenStack Ceilometer service should
be deployed and managed
type: boolean
ipmiImage:
type: string
networkAttachmentDefinitions:
Expand Down Expand Up @@ -427,9 +435,12 @@ spec:
- secret
- sgCoreImage
type: object
secret:
description: Secret containing OpenStack password information for
telemetry services
type: string
required:
- autoscaling
- ceilometer
- secret
type: object
status:
description: TelemetryStatus defines the observed state of Telemetry
Expand Down
12 changes: 12 additions & 0 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,30 @@ const (
// CeilometerReadyInitMessage
CeilometerReadyInitMessage = "Ceilometer not started"

// CeilometerReadyMessage
CeilometerReadyMessage = "Ceilometer completed"

// CeilometerReadyErrorMessage
CeilometerReadyErrorMessage = "Ceilometer error occured %s"

// CeilometerReadyRunningMessage
CeilometerReadyRunningMessage = "Ceilometer in progress"

//
// AutoscalingReady condition messages
//
// AutoscalingReadyInitMessage
AutoscalingReadyInitMessage = "Autoscaling not started"

// AutoscalingReadyMessage
AutoscalingReadyMessage = "Autoscaling completed"

// AutoscalingReadyErrorMessage
AutoscalingReadyErrorMessage = "Autoscaling error occured %s"

// AutoscalingReadyRunningMessage
AutoscalingReadyRunningMessage = "Autoscaling in progress"

// HeatReadyInitMessage
HeatReadyInitMessage = "Heat not started"

Expand Down
45 changes: 39 additions & 6 deletions api/v1beta1/telemetry_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,46 @@ type PasswordsSelector struct {

// TelemetrySpec defines the desired state of Telemetry
type TelemetrySpec struct {
// +kubebuilder:validation:Required
// Autoscaling - Spec definition for the Autoscaling service of this Telemetry deployment
Autoscaling AutoscalingSpec `json:"autoscaling"`
// +kubebuilder:validation:Optional
// Autoscaling - Parameters related to the autoscaling service
Autoscaling AutoscalingSection `json:"autoscaling,omitempty"`

// +kubebuilder:validation:Optional
// Ceilometer - Parameters related to the ceilometer service
Ceilometer CeilometerSection `json:"ceilometer,omitempty"`

// Secret containing OpenStack password information for telemetry services
// +kubebuilder:validation:Required
Secret string `json:"secret"`

}

// CeilometerSection defines the desired state of the ceilometer service
type CeilometerSection 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 service 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
CeilometerSpec `json:",inline"`
}

// +kubebuilder:validation:Required
// Ceilometer - Spec definition for the Ceilometer service of this Telemetry deployment
Ceilometer CeilometerSpec `json:"ceilometer"`
// AutoscalingSection defines the desired state of the autoscaling service
type AutoscalingSection struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// +operator-sdk:csv:customresourcedefinitions:type=spec,xDescriptors={"urn:alm:descriptor:com.tectonic.ui:booleanSwitch"}
// Enabled - Whether OpenStack autoscaling service 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 autoscaling service
AutoscalingSpec `json:",inline"`
}

// TelemetryStatus defines the observed state of Telemetry
Expand Down
40 changes: 20 additions & 20 deletions api/v1beta1/telemetry_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,35 +72,35 @@ func (r *Telemetry) Default() {

// Default - set defaults for this Telemetry spec
func (spec *TelemetrySpec) Default() {
if spec.Ceilometer.CentralImage == "" {
spec.Ceilometer.CentralImage = telemetryDefaults.CentralContainerImageURL
if spec.Ceilometer.CeilometerSpec.CentralImage == "" {
spec.Ceilometer.CeilometerSpec.CentralImage = telemetryDefaults.CentralContainerImageURL
}
if spec.Ceilometer.ComputeImage == "" {
spec.Ceilometer.ComputeImage = telemetryDefaults.ComputeContainerImageURL
if spec.Ceilometer.CeilometerSpec.ComputeImage == "" {
spec.Ceilometer.CeilometerSpec.ComputeImage = telemetryDefaults.ComputeContainerImageURL
}
if spec.Ceilometer.IpmiImage == "" {
spec.Ceilometer.IpmiImage = telemetryDefaults.IpmiContainerImageURL
if spec.Ceilometer.CeilometerSpec.IpmiImage == "" {
spec.Ceilometer.CeilometerSpec.IpmiImage = telemetryDefaults.IpmiContainerImageURL
}
if spec.Ceilometer.NotificationImage == "" {
spec.Ceilometer.NotificationImage = telemetryDefaults.NotificationContainerImageURL
if spec.Ceilometer.CeilometerSpec.NotificationImage == "" {
spec.Ceilometer.CeilometerSpec.NotificationImage = telemetryDefaults.NotificationContainerImageURL
}
if spec.Ceilometer.SgCoreImage == "" {
spec.Ceilometer.SgCoreImage = telemetryDefaults.SgCoreContainerImageURL
if spec.Ceilometer.CeilometerSpec.SgCoreImage == "" {
spec.Ceilometer.CeilometerSpec.SgCoreImage = telemetryDefaults.SgCoreContainerImageURL
}
if spec.Ceilometer.NodeExporterImage == "" {
spec.Ceilometer.NodeExporterImage = telemetryDefaults.NodeExporterContainerImageURL
if spec.Ceilometer.CeilometerSpec.NodeExporterImage == "" {
spec.Ceilometer.CeilometerSpec.NodeExporterImage = telemetryDefaults.NodeExporterContainerImageURL
}
if spec.Autoscaling.Aodh.APIImage == "" {
spec.Autoscaling.Aodh.APIImage = telemetryDefaults.AodhAPIContainerImageURL
if spec.Autoscaling.AutoscalingSpec.Aodh.APIImage == "" {
spec.Autoscaling.AutoscalingSpec.Aodh.APIImage = telemetryDefaults.AodhAPIContainerImageURL
}
if spec.Autoscaling.Aodh.EvaluatorImage == "" {
spec.Autoscaling.Aodh.EvaluatorImage = telemetryDefaults.AodhEvaluatorContainerImageURL
if spec.Autoscaling.AutoscalingSpec.Aodh.EvaluatorImage == "" {
spec.Autoscaling.AutoscalingSpec.Aodh.EvaluatorImage = telemetryDefaults.AodhEvaluatorContainerImageURL
}
if spec.Autoscaling.Aodh.NotifierImage == "" {
spec.Autoscaling.Aodh.NotifierImage = telemetryDefaults.AodhNotifierContainerImageURL
if spec.Autoscaling.AutoscalingSpec.Aodh.NotifierImage == "" {
spec.Autoscaling.AutoscalingSpec.Aodh.NotifierImage = telemetryDefaults.AodhNotifierContainerImageURL
}
if spec.Autoscaling.Aodh.ListenerImage == "" {
spec.Autoscaling.Aodh.ListenerImage = telemetryDefaults.AodhListenerContainerImageURL
if spec.Autoscaling.AutoscalingSpec.Aodh.ListenerImage == "" {
spec.Autoscaling.AutoscalingSpec.Aodh.ListenerImage = telemetryDefaults.AodhListenerContainerImageURL
}

}
Expand Down
32 changes: 32 additions & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 17 additions & 6 deletions config/crd/bases/telemetry.openstack.org_telemetries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ spec:
description: TelemetrySpec defines the desired state of Telemetry
properties:
autoscaling:
description: Autoscaling - Spec definition for the Autoscaling service
of this Telemetry deployment
description: Autoscaling - Parameters related to the autoscaling service
properties:
aodh:
description: Aodh spec
Expand Down Expand Up @@ -318,6 +317,11 @@ spec:
- notifierImage
- secret
type: object
enabled:
default: false
description: Enabled - Whether OpenStack autoscaling service should
be deployed and managed
type: boolean
heatInstance:
default: heat
description: Heat instance name.
Expand Down Expand Up @@ -345,8 +349,7 @@ spec:
- heatInstance
type: object
ceilometer:
description: Ceilometer - Spec definition for the Ceilometer service
of this Telemetry deployment
description: Ceilometer - Parameters related to the ceilometer service
properties:
centralImage:
type: string
Expand All @@ -368,6 +371,11 @@ spec:
also be used to add additional files. Those get added to the
service config dir in /etc/<service> . TODO: -> implement'
type: object
enabled:
default: true
description: Enabled - Whether OpenStack Ceilometer service should
be deployed and managed
type: boolean
ipmiImage:
type: string
networkAttachmentDefinitions:
Expand Down Expand Up @@ -427,9 +435,12 @@ spec:
- secret
- sgCoreImage
type: object
secret:
description: Secret containing OpenStack password information for
telemetry services
type: string
required:
- autoscaling
- ceilometer
- secret
type: object
status:
description: TelemetryStatus defines the observed state of Telemetry
Expand Down
13 changes: 11 additions & 2 deletions config/samples/telemetry_v1beta1_telemetry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,17 @@ apiVersion: telemetry.openstack.org/v1beta1
kind: Telemetry
metadata:
name: telemetry
namespace: openstack
spec:
autoscaling:
enabled: false
prometheus:
deployPrometheus: false
deployPrometheus: true
aodh:
passwordSelectors:
databaseUser: aodh
databaseInstance: openstack
memcachedInstance: memcached
heatInstance: heat
ceilometer:
enabled: true
secret: osp-secret
Loading

0 comments on commit dd28e47

Please sign in to comment.