Skip to content

Commit

Permalink
Merge pull request #360 from vyzigold/defaulting
Browse files Browse the repository at this point in the history
Improve defaulting
  • Loading branch information
openshift-merge-bot[bot] authored Apr 24, 2024
2 parents 7fa8bec + 7e7fabc commit 1b2235e
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 0 deletions.
14 changes: 14 additions & 0 deletions api/bases/telemetry.openstack.org_autoscalings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ spec:
description: AutoscalingSpec defines the desired state of Autoscaling
properties:
aodh:
default:
apiImage: ""
databaseAccount: aodh
databaseInstance: openstack
evaluatorImage: ""
listenerImage: ""
notifierImage: ""
passwordSelector:
aodhService: AodhPassword
rabbitMqClusterName: rabbitmq
secret: osp-secret
serviceUser: aodh
description: Aodh spec
properties:
apiImage:
Expand All @@ -54,6 +66,7 @@ spec:
used for aodh DB, defaults to aodh
type: string
databaseInstance:
default: openstack
description: MariaDB instance name Right now required by the maridb-operator
to get the credentials from the instance to create the DB Might
not be required in future
Expand Down Expand Up @@ -288,6 +301,7 @@ spec:
that is created and used in Aodh
type: string
secret:
default: osp-secret
description: Secret containing OpenStack password information
for aodh
type: string
Expand Down
1 change: 1 addition & 0 deletions api/bases/telemetry.openstack.org_ceilometers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ spec:
that is created and used in Telemetry
type: string
secret:
default: osp-secret
description: Secret containing OpenStack password information for
ceilometer
type: string
Expand Down
15 changes: 15 additions & 0 deletions api/bases/telemetry.openstack.org_telemetries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ spec:
description: Autoscaling - Parameters related to the autoscaling service
properties:
aodh:
default:
apiImage: ""
databaseAccount: aodh
databaseInstance: openstack
evaluatorImage: ""
listenerImage: ""
notifierImage: ""
passwordSelector:
aodhService: AodhPassword
rabbitMqClusterName: rabbitmq
secret: osp-secret
serviceUser: aodh
description: Aodh spec
properties:
apiImage:
Expand All @@ -57,6 +69,7 @@ spec:
name used for aodh DB, defaults to aodh
type: string
databaseInstance:
default: openstack
description: MariaDB instance name Right now required by the
maridb-operator to get the credentials from the instance
to create the DB Might not be required in future
Expand Down Expand Up @@ -301,6 +314,7 @@ spec:
that is created and used in Aodh
type: string
secret:
default: osp-secret
description: Secret containing OpenStack password information
for aodh
type: string
Expand Down Expand Up @@ -434,6 +448,7 @@ spec:
that is created and used in Telemetry
type: string
secret:
default: osp-secret
description: Secret containing OpenStack password information
for ceilometer
type: string
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/autoscaling_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ type AodhCore struct {
RabbitMqClusterName string `json:"rabbitMqClusterName,omitempty"`

// +kubebuilder:validation:Required
// +kubebuilder:default=openstack
// MariaDB instance name
// Right now required by the maridb-operator to get the credentials from the instance to create the DB
// Might not be required in future
Expand All @@ -84,6 +85,7 @@ type AodhCore struct {

// Secret containing OpenStack password information for aodh
// +kubebuilder:validation:Required
// +kubebuilder:default=osp-secret
Secret string `json:"secret"`

// CustomServiceConfig - customize the service config using this parameter to change service defaults,
Expand Down Expand Up @@ -128,6 +130,7 @@ type AutoscalingSpec struct {
AutoscalingSpecBase `json:",inline"`

// Aodh spec
// +kubebuilder:default={rabbitMqClusterName: rabbitmq, databaseAccount: aodh, passwordSelector: {aodhService: AodhPassword}, serviceUser: aodh, apiImage: "", evaluatorImage: "", notifierImage: "", listenerImage: "", databaseInstance: "openstack", secret: "osp-secret"}
Aodh Aodh `json:"aodh,omitempty"`
}

Expand All @@ -136,6 +139,7 @@ type AutoscalingSpecCore struct {
AutoscalingSpecBase `json:",inline"`

// Aodh spec
// +kubebuilder:default={rabbitMqClusterName: rabbitmq, databaseAccount: aodh, passwordSelector: {aodhService: AodhPassword}, serviceUser: aodh, databaseInstance: "openstack", secret: "osp-secret"}
Aodh AodhCore `json:"aodh,omitempty"`
}

Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/ceilometer_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ type CeilometerSpecCore struct {

// Secret containing OpenStack password information for ceilometer
// +kubebuilder:validation:Required
// +kubebuilder:default=osp-secret
Secret string `json:"secret"`

// CustomServiceConfig - customize the service config using this parameter to change service defaults,
Expand Down
6 changes: 6 additions & 0 deletions api/v1beta1/metricstorage_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ func (spec *MetricStorageSpec) Default() {
// and we don't have a way of distinguishing if the value was left
// empty or set to false by the user in the spec.MonitoringStack.Default()
spec.MonitoringStack.AlertingEnabled = true

// NOTE: If we want to enable dashboards in the future by default, set
// it here like Alerting above
}
if spec.MonitoringStack != nil {
spec.MonitoringStack.Default()
Expand All @@ -62,6 +65,9 @@ func (ms *MonitoringStack) Default() {
if ms.ScrapeInterval == "" {
ms.ScrapeInterval = "30s"
}
if ms.DataplaneNetwork == "" {
ms.DataplaneNetwork = "ctlplane"
}
ms.Storage.Default()
}

Expand Down
14 changes: 14 additions & 0 deletions config/crd/bases/telemetry.openstack.org_autoscalings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ spec:
description: AutoscalingSpec defines the desired state of Autoscaling
properties:
aodh:
default:
apiImage: ""
databaseAccount: aodh
databaseInstance: openstack
evaluatorImage: ""
listenerImage: ""
notifierImage: ""
passwordSelector:
aodhService: AodhPassword
rabbitMqClusterName: rabbitmq
secret: osp-secret
serviceUser: aodh
description: Aodh spec
properties:
apiImage:
Expand All @@ -54,6 +66,7 @@ spec:
used for aodh DB, defaults to aodh
type: string
databaseInstance:
default: openstack
description: MariaDB instance name Right now required by the maridb-operator
to get the credentials from the instance to create the DB Might
not be required in future
Expand Down Expand Up @@ -288,6 +301,7 @@ spec:
that is created and used in Aodh
type: string
secret:
default: osp-secret
description: Secret containing OpenStack password information
for aodh
type: string
Expand Down
1 change: 1 addition & 0 deletions config/crd/bases/telemetry.openstack.org_ceilometers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ spec:
that is created and used in Telemetry
type: string
secret:
default: osp-secret
description: Secret containing OpenStack password information for
ceilometer
type: string
Expand Down
15 changes: 15 additions & 0 deletions config/crd/bases/telemetry.openstack.org_telemetries.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@ spec:
description: Autoscaling - Parameters related to the autoscaling service
properties:
aodh:
default:
apiImage: ""
databaseAccount: aodh
databaseInstance: openstack
evaluatorImage: ""
listenerImage: ""
notifierImage: ""
passwordSelector:
aodhService: AodhPassword
rabbitMqClusterName: rabbitmq
secret: osp-secret
serviceUser: aodh
description: Aodh spec
properties:
apiImage:
Expand All @@ -57,6 +69,7 @@ spec:
name used for aodh DB, defaults to aodh
type: string
databaseInstance:
default: openstack
description: MariaDB instance name Right now required by the
maridb-operator to get the credentials from the instance
to create the DB Might not be required in future
Expand Down Expand Up @@ -301,6 +314,7 @@ spec:
that is created and used in Aodh
type: string
secret:
default: osp-secret
description: Secret containing OpenStack password information
for aodh
type: string
Expand Down Expand Up @@ -434,6 +448,7 @@ spec:
that is created and used in Telemetry
type: string
secret:
default: osp-secret
description: Secret containing OpenStack password information
for ceilometer
type: string
Expand Down

0 comments on commit 1b2235e

Please sign in to comment.