Skip to content

Commit

Permalink
Merge pull request openstack-k8s-operators#309 from paramite/telemetr…
Browse files Browse the repository at this point in the history
…y-operator

Telemetry operator
  • Loading branch information
openshift-merge-robot authored May 24, 2023
2 parents 7ecc277 + 3701859 commit 9e70bf1
Show file tree
Hide file tree
Showing 23 changed files with 466 additions and 2 deletions.
107 changes: 107 additions & 0 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10758,6 +10758,113 @@ spec:
type: string
storageClass:
type: string
telemetry:
properties:
enabled:
default: true
type: boolean
template:
properties:
ceilometerCentral:
properties:
centralImage:
type: string
customServiceConfig:
default: '# add your customization here'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
description:
default: A ceilometer agent
type: string
initImage:
type: string
networkAttachmentDefinitions:
items:
type: string
type: array
notificationImage:
type: string
passwordSelector:
default:
service: CeilometerPassword
properties:
service:
default: CeilometerPassword
type: string
type: object
secret:
default: osp-secret
type: string
serviceUser:
default: ceilometer
type: string
sgCoreImage:
type: string
transportURLSecret:
type: string
required:
- centralImage
- initImage
- notificationImage
- sgCoreImage
type: object
ceilometerCompute:
properties:
computeImage:
type: string
customServiceConfig:
default: '# add your customization here'
type: string
dataplaneInventoryConfigMap:
default: dataplanerole-edpm-compute
type: string
dataplaneSSHSecret:
default: dataplane-ansible-ssh-private-key-secret
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
description:
default: A ceilometer compute agent
type: string
initImage:
type: string
passwordSelector:
default:
service: CeilometerPassword
properties:
service:
default: CeilometerPassword
type: string
type: object
playbook:
default: deploy-ceilometer.yaml
type: string
secret:
default: osp-secret
type: string
serviceUser:
default: ceilometer
type: string
transportURLSecret:
type: string
type: object
description:
default: A ceilometer agent
type: string
rabbitMqClusterName:
default: rabbitmq
type: string
required:
- ceilometerCentral
- ceilometerCompute
- rabbitMqClusterName
type: object
type: object
required:
- secret
- storageClass
Expand Down
15 changes: 15 additions & 0 deletions apis/core/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ const (
// OpenStackControlPlaneDNSReadyCondition Status=True condition which indicates if DNSMasq is configured and operational
OpenStackControlPlaneDNSReadyCondition condition.Type = "OpenStackControlPlaneDNSReadyCondition"

// OpenStackControlPlaneTelemetryReadyCondition Status=True condition which indicates if OpenStack Telemetry services are configured and operational
OpenStackControlPlaneTelemetryReadyCondition condition.Type = "OpenStackControlPlaneTelemetryReady"

// OpenStackControlPlaneManilaReadyInitMessage
OpenStackControlPlaneManilaReadyInitMessage = "OpenStackControlPlane Manila not started"

Expand Down Expand Up @@ -276,4 +279,16 @@ const (

// OpenStackControlPlaneDNSReadyErrorMessage
OpenStackControlPlaneDNSReadyErrorMessage = "OpenStackControlPlane DNS error occured %s"

// OpenStackControlPlaneTelemetryReadyInitMessage
OpenStackControlPlaneTelemetryReadyInitMessage = "OpenStackControlPlane Telemetry not started"

// OpenStackControlPlaneTelemetryReadyMessage
OpenStackControlPlaneTelemetryReadyMessage = "OpenStackControlPlane Telemetry completed"

// OpenStackControlPlaneTelemetryReadyRunningMessage
OpenStackControlPlaneTelemetryReadyRunningMessage = "OpenStackControlPlane Telemetry in progress"

// OpenStackControlPlaneTelemetryReadyErrorMessage
OpenStackControlPlaneTelemetryReadyErrorMessage = "OpenStackControlPlane Telemetry error occured %s"
)
20 changes: 20 additions & 0 deletions apis/core/v1beta1/openstackcontrolplane_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import (
ovnv1 "github.com/openstack-k8s-operators/ovn-operator/api/v1beta1"
ovsv1 "github.com/openstack-k8s-operators/ovs-operator/api/v1beta1"
placementv1 "github.com/openstack-k8s-operators/placement-operator/api/v1beta1"
telemetryv1 "github.com/openstack-k8s-operators/telemetry-operator/api/v1beta1"
rabbitmqv1 "github.com/rabbitmq/cluster-operator/api/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
Expand Down Expand Up @@ -132,6 +133,9 @@ type OpenStackControlPlaneSpec struct {
Horizon HorizonSection `json:"horizon,omitempty"`

// +kubebuilder:validation:Optional
// Telemetry - Parameters related to the OpenStack Telemetry services
Telemetry TelemetrySection `json:"telemetry,omitempty"`

// ExtraMounts containing conf files and credentials that should be provided
// to the underlying operators.
// This struct can be defined in the top level CR and propagated to the
Expand Down Expand Up @@ -415,6 +419,20 @@ type HorizonSection struct {
Template horizonv1.HorizonSpec `json:"template,omitempty"`
}

// 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 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 Telemetry services
Template telemetryv1.TelemetrySpec `json:"template,omitempty"`
}

// OpenStackControlPlaneStatus defines the observed state of OpenStackControlPlane
type OpenStackControlPlaneStatus struct {
//+operator-sdk:csv:customresourcedefinitions:type=status,xDescriptors={"urn:alm:descriptor:io.kubernetes.conditions"}
Expand Down Expand Up @@ -500,6 +518,8 @@ func (instance OpenStackControlPlane) InitConditions() {
condition.UnknownCondition(OpenStackControlPlaneManilaReadyCondition, condition.InitReason, OpenStackControlPlaneManilaReadyInitMessage),
condition.UnknownCondition(OpenStackControlPlaneHorizonReadyCondition, condition.InitReason, OpenStackControlPlaneHorizonReadyInitMessage),
condition.UnknownCondition(OpenStackControlPlaneDNSReadyCondition, condition.InitReason, OpenStackControlPlaneDNSReadyInitMessage),
condition.UnknownCondition(OpenStackControlPlaneTelemetryReadyCondition, condition.InitReason, OpenStackControlPlaneTelemetryReadyInitMessage),

// Also add the overall status condition as Unknown
condition.UnknownCondition(condition.ReadyCondition, condition.InitReason, condition.ReadyInitMessage),
)
Expand Down
5 changes: 5 additions & 0 deletions apis/core/v1beta1/openstackcontrolplane_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,9 @@ func (r *OpenStackControlPlane) DefaultServices() {
if r.Spec.DNS.Enabled {
r.Spec.DNS.Template.Default()
}

// Telemetry
if r.Spec.Telemetry.Enabled {
r.Spec.Telemetry.Template.Default()
}
}
17 changes: 17 additions & 0 deletions apis/core/v1beta1/zz_generated.deepcopy.go

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

1 change: 1 addition & 0 deletions apis/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/openstack-k8s-operators/nova-operator/api v0.0.0-20230522134320-2f2ff8167e57
github.com/openstack-k8s-operators/ovn-operator/api v0.0.0-20230522062547-12905139513e
github.com/openstack-k8s-operators/placement-operator/api v0.0.0-20230517142510-5ebb403dc2f7
github.com/openstack-k8s-operators/telemetry-operator/api v0.0.0-20230518150301-7e9c6a99c4e8
github.com/rabbitmq/cluster-operator v1.14.0
k8s.io/apimachinery v0.26.3
sigs.k8s.io/controller-runtime v0.14.6
Expand Down
4 changes: 3 additions & 1 deletion apis/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ github.com/openstack-k8s-operators/ovs-operator/api v0.0.0-20230517053110-2821a8
github.com/openstack-k8s-operators/ovs-operator/api v0.0.0-20230517053110-2821a8dc05fd/go.mod h1:KiYMGv1D3BcCS6RGrJ69uzsRLz0/b12VL8JGxbwNrgM=
github.com/openstack-k8s-operators/placement-operator/api v0.0.0-20230517142510-5ebb403dc2f7 h1:Y1y8ElTKnWM1JUX93xYRH5pL4pPI0gfIp9wFMfXq90E=
github.com/openstack-k8s-operators/placement-operator/api v0.0.0-20230517142510-5ebb403dc2f7/go.mod h1:B8j7ZNmgxranbjtKk6jzt5p3x0rCsqOJItjO/8r5jok=
github.com/openstack-k8s-operators/telemetry-operator/api v0.0.0-20230518150301-7e9c6a99c4e8 h1:5ysH++xPJKmKWnyLrIx7XOO0QSCkzJaJ66o6kqPX138=
github.com/openstack-k8s-operators/telemetry-operator/api v0.0.0-20230518150301-7e9c6a99c4e8/go.mod h1:YOXMu9ifbPTMd/t/QnSjg82gw4uVITpedcvOkTpLwJk=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
Expand Down Expand Up @@ -181,8 +183,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV
github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y=
Expand Down
2 changes: 2 additions & 0 deletions cmd/csv-merger/csv-merger.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ var (
baremetalCsv = flag.String("baremetal-csv", "", "Baremetal CSV filename")
manilaCsv = flag.String("manila-csv", "", "Manila CSV filename")
placementCsv = flag.String("placement-csv", "", "Placement CSV filename")
telemetryCsv = flag.String("telemetry-csv", "", "Telemetry CSV filename")
ovnCsv = flag.String("ovn-csv", "", "OVN CSV filename")
ovsCsv = flag.String("ovs-csv", "", "OVS CSV filename")
cinderCsv = flag.String("cinder-csv", "", "Cinder CSV filename")
Expand Down Expand Up @@ -150,6 +151,7 @@ func main() {
*ironicCsv,
*baremetalCsv,
*placementCsv,
*telemetryCsv,
*ovnCsv,
*ovsCsv,
*cinderCsv,
Expand Down
107 changes: 107 additions & 0 deletions config/crd/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10758,6 +10758,113 @@ spec:
type: string
storageClass:
type: string
telemetry:
properties:
enabled:
default: true
type: boolean
template:
properties:
ceilometerCentral:
properties:
centralImage:
type: string
customServiceConfig:
default: '# add your customization here'
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
description:
default: A ceilometer agent
type: string
initImage:
type: string
networkAttachmentDefinitions:
items:
type: string
type: array
notificationImage:
type: string
passwordSelector:
default:
service: CeilometerPassword
properties:
service:
default: CeilometerPassword
type: string
type: object
secret:
default: osp-secret
type: string
serviceUser:
default: ceilometer
type: string
sgCoreImage:
type: string
transportURLSecret:
type: string
required:
- centralImage
- initImage
- notificationImage
- sgCoreImage
type: object
ceilometerCompute:
properties:
computeImage:
type: string
customServiceConfig:
default: '# add your customization here'
type: string
dataplaneInventoryConfigMap:
default: dataplanerole-edpm-compute
type: string
dataplaneSSHSecret:
default: dataplane-ansible-ssh-private-key-secret
type: string
defaultConfigOverwrite:
additionalProperties:
type: string
type: object
description:
default: A ceilometer compute agent
type: string
initImage:
type: string
passwordSelector:
default:
service: CeilometerPassword
properties:
service:
default: CeilometerPassword
type: string
type: object
playbook:
default: deploy-ceilometer.yaml
type: string
secret:
default: osp-secret
type: string
serviceUser:
default: ceilometer
type: string
transportURLSecret:
type: string
type: object
description:
default: A ceilometer agent
type: string
rabbitMqClusterName:
default: rabbitmq
type: string
required:
- ceilometerCentral
- ceilometerCompute
- rabbitMqClusterName
type: object
type: object
required:
- secret
- storageClass
Expand Down
Loading

0 comments on commit 9e70bf1

Please sign in to comment.