Skip to content

Commit

Permalink
KSM
Browse files Browse the repository at this point in the history
  • Loading branch information
paramite committed Oct 10, 2024
1 parent 4f77c60 commit 68fd10e
Show file tree
Hide file tree
Showing 9 changed files with 58 additions and 0 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
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 68fd10e

Please sign in to comment.