Skip to content

Commit

Permalink
KSM
Browse files Browse the repository at this point in the history
  • Loading branch information
paramite committed Oct 14, 2024
1 parent b70fd8a commit 6b48a53
Show file tree
Hide file tree
Showing 11 changed files with 61 additions and 3 deletions.
2 changes: 2 additions & 0 deletions apis/bases/core.openstack.org_openstackcontrolplanes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18352,6 +18352,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down
6 changes: 6 additions & 0 deletions apis/bases/core.openstack.org_openstackversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down Expand Up @@ -354,6 +356,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down Expand Up @@ -532,6 +536,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down
1 change: 1 addition & 0 deletions apis/core/v1beta1/openstackversion_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ type ContainerTemplate struct {
IronicPxeImage *string `json:"ironicPxeImage,omitempty"`
IronicPythonAgentImage *string `json:"ironicPythonAgentImage,omitempty"`
KeystoneAPIImage *string `json:"keystoneAPIImage,omitempty"`
KsmImage *string `json:"ksmImage,omitempty"`
ManilaAPIImage *string `json:"manilaAPIImage,omitempty"`
ManilaSchedulerImage *string `json:"manilaSchedulerImage,omitempty"`
MariadbImage *string `json:"mariadbImage,omitempty"`
Expand Down
5 changes: 5 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.

Original file line number Diff line number Diff line change
Expand Up @@ -18352,6 +18352,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/core.openstack.org_openstackversions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down Expand Up @@ -354,6 +356,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down Expand Up @@ -532,6 +536,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ require (
github.com/openstack-k8s-operators/ovn-operator/api v0.4.1-0.20241007075619-241535441881
github.com/openstack-k8s-operators/placement-operator/api v0.4.1-0.20241007064654-9a07132ad7dd
github.com/openstack-k8s-operators/swift-operator/api v0.4.1-0.20240930070251-1f0a2f5e19b0
github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.20241007090220-a9bf21aa9e25
github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.20241011103118-cc54e508ef4e
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20241007130221-f2ce22b18486
github.com/rabbitmq/cluster-operator/v2 v2.9.0
go.uber.org/zap v1.27.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.2024071
github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20240719064129-c0201810c8f5/go.mod h1:Axs7PDfgI3M/gtHSqr/rXqZLKOqwHkRAHEDFi5El5u4=
github.com/openstack-k8s-operators/swift-operator/api v0.4.1-0.20240930070251-1f0a2f5e19b0 h1:ktuCfb4EBrcvHRJ1Ox1O23vstZEOoJlHgVVYLciYSwA=
github.com/openstack-k8s-operators/swift-operator/api v0.4.1-0.20240930070251-1f0a2f5e19b0/go.mod h1:vEry4bUk3JoOt31oh/FDAWsP2/oQpuzUdrYkk6Q/qBk=
github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.20241007090220-a9bf21aa9e25 h1:gtAmQ/JOi8nynNHsdR/d2SeghtJRlOwR/pSHlqBcA+k=
github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.20241007090220-a9bf21aa9e25/go.mod h1:aeqjPtBNs/16t96iTpir4gPpDJ7EBgMENW1/RwGLfzo=
github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.20241011103118-cc54e508ef4e h1:Aivqxn+Qw4m34jQUyndkuCYktz1H1o2xLrWIN7NmKpo=
github.com/openstack-k8s-operators/telemetry-operator/api v0.4.1-0.20241011103118-cc54e508ef4e/go.mod h1:aeqjPtBNs/16t96iTpir4gPpDJ7EBgMENW1/RwGLfzo=
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20241007130221-f2ce22b18486 h1:/WURj+cwRq+bAGOIrIFK5BmIWVE1YZohDFF0F0OSAms=
github.com/openstack-k8s-operators/test-operator/api v0.0.0-20241007130221-f2ce22b18486/go.mod h1:s1/uB2hSPldPAiTLQ13v/5ZET//E2T/VMvHhrg2bdc4=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down
1 change: 1 addition & 0 deletions hack/export_related_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ export RELATED_IMAGE_CEILOMETER_COMPUTE_IMAGE_URL_DEFAULT=quay.io/podified-antel
export RELATED_IMAGE_CEILOMETER_NOTIFICATION_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ceilometer-notification:current-podified
export RELATED_IMAGE_CEILOMETER_IPMI_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-ceilometer-ipmi:current-podified
export RELATED_IMAGE_CEILOMETER_SGCORE_IMAGE_URL_DEFAULT=quay.io/infrawatch/sg-core:v5.2.0-nextgen
export RELATED_IMAGE_KSM_IMAGE_URL_DEFAULT=registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0
export RELATED_IMAGE_AODH_API_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-aodh-api:current-podified
export RELATED_IMAGE_AODH_EVALUATOR_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-aodh-evaluator:current-podified
export RELATED_IMAGE_AODH_NOTIFIER_IMAGE_URL_DEFAULT=quay.io/podified-antelope-centos9/openstack-aodh-notifier:current-podified
Expand Down
34 changes: 34 additions & 0 deletions pkg/openstack/telemetry.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont
instance.Spec.Telemetry.Template.Autoscaling.Aodh.TLS = telemetry.Spec.Autoscaling.Aodh.TLS
instance.Spec.Telemetry.Template.MetricStorage.PrometheusTLS = telemetry.Spec.MetricStorage.PrometheusTLS
instance.Spec.Telemetry.Template.Ceilometer.TLS = telemetry.Spec.Ceilometer.TLS
instance.Spec.Telemetry.Template.Ceilometer.KSMTLS = telemetry.Spec.Ceilometer.KSMTLS
}
instance.Spec.Telemetry.Template.Autoscaling.Aodh.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName
instance.Spec.Telemetry.Template.Ceilometer.TLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName
instance.Spec.Telemetry.Template.Ceilometer.KSMTLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName
instance.Spec.Telemetry.Template.MetricStorage.PrometheusTLS.CaBundleSecretName = instance.Status.TLS.CaBundleSecretName

aodhSvcs, err := service.GetServicesListWithLabel(
Expand Down Expand Up @@ -123,6 +125,15 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont
if err != nil {
return ctrl.Result{}, err
}
ksmSvcs, err := service.GetServicesListWithLabel(
ctx,
helper,
instance.Namespace,
map[string]string{common.AppSelector: "kube-state-metrics"},
)
if err != nil {
return ctrl.Result{}, err
}

// make sure to get to EndpointConfig when all service got created
if len(aodhSvcs.Items) == len(instance.Spec.Telemetry.Template.Autoscaling.Aodh.Override.Service) {
Expand Down Expand Up @@ -231,6 +242,27 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont
}
// update TLS settings with cert secret
instance.Spec.Telemetry.Template.Ceilometer.TLS.SecretName = endpointDetails.GetEndptCertSecret(service.EndpointInternal)

// NOTE: We don't have svc overrides for KSM objects too.
ksmEpDetails, ctrlResult, err := EnsureEndpointConfig(
ctx,
instance,
helper,
telemetry,
ksmSvcs,
nil,
corev1beta1.Override{},
corev1beta1.OpenStackControlPlaneExposeTelemetryReadyCondition,
false, // TODO (mschuppert) could be removed when all integrated service support TLS
tls.API{},
)
if err != nil {
return ctrlResult, err
} else if (ctrlResult != ctrl.Result{}) {
return ctrlResult, nil
}
// update TLS settings with cert secret
instance.Spec.Telemetry.Template.Ceilometer.KSMTLS.SecretName = ksmEpDetails.GetEndptCertSecret(service.EndpointInternal)
}

helper.GetLogger().Info("Reconciling Telemetry", telemetryNamespaceLabel, instance.Namespace, telemetryNameLabel, telemetryName)
Expand All @@ -251,6 +283,7 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont
telemetry.Spec.Ceilometer.NotificationImage = *version.Status.ContainerImages.CeilometerNotificationImage
telemetry.Spec.Ceilometer.SgCoreImage = *version.Status.ContainerImages.CeilometerSgcoreImage
telemetry.Spec.Ceilometer.ProxyImage = *version.Status.ContainerImages.CeilometerProxyImage
telemetry.Spec.Ceilometer.KSMImage = *version.Status.ContainerImages.KsmImage
telemetry.Spec.Autoscaling.AutoscalingSpec.Aodh.APIImage = *version.Status.ContainerImages.AodhAPIImage
telemetry.Spec.Autoscaling.AutoscalingSpec.Aodh.EvaluatorImage = *version.Status.ContainerImages.AodhEvaluatorImage
telemetry.Spec.Autoscaling.AutoscalingSpec.Aodh.NotifierImage = *version.Status.ContainerImages.AodhNotifierImage
Expand Down Expand Up @@ -298,6 +331,7 @@ func ReconcileTelemetry(ctx context.Context, instance *corev1beta1.OpenStackCont
instance.Status.ContainerImages.CeilometerNotificationImage = version.Status.ContainerImages.CeilometerNotificationImage
instance.Status.ContainerImages.CeilometerSgcoreImage = version.Status.ContainerImages.CeilometerSgcoreImage
instance.Status.ContainerImages.CeilometerProxyImage = version.Status.ContainerImages.CeilometerProxyImage
instance.Status.ContainerImages.KsmImage = version.Status.ContainerImages.KsmImage
instance.Status.ContainerImages.AodhAPIImage = version.Status.ContainerImages.AodhAPIImage
instance.Status.ContainerImages.AodhEvaluatorImage = version.Status.ContainerImages.AodhEvaluatorImage
instance.Status.ContainerImages.AodhNotifierImage = version.Status.ContainerImages.AodhNotifierImage
Expand Down
1 change: 1 addition & 0 deletions pkg/openstack/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func GetContainerImages(defaults *corev1beta1.ContainerDefaults, instance corev1
IronicPxeImage: getImg(instance.Spec.CustomContainerImages.IronicPxeImage, defaults.IronicPxeImage),
IronicPythonAgentImage: getImg(instance.Spec.CustomContainerImages.IronicPythonAgentImage, defaults.IronicPythonAgentImage),
KeystoneAPIImage: getImg(instance.Spec.CustomContainerImages.KeystoneAPIImage, defaults.KeystoneAPIImage),
KsmImage: getImg(instance.Spec.CustomContainerImages.KsmImage, defaults.KsmImage),
ManilaAPIImage: getImg(instance.Spec.CustomContainerImages.ManilaAPIImage, defaults.ManilaAPIImage),
ManilaSchedulerImage: getImg(instance.Spec.CustomContainerImages.ManilaSchedulerImage, defaults.ManilaSchedulerImage),
MariadbImage: getImg(instance.Spec.CustomContainerImages.MariadbImage, defaults.MariadbImage),
Expand Down

0 comments on commit 6b48a53

Please sign in to comment.