Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for KSM #1056

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -16604,6 +16604,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 @@ -145,6 +145,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down Expand Up @@ -350,6 +352,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down Expand Up @@ -526,6 +530,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 @@ -125,6 +125,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 @@ -16604,6 +16604,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 @@ -145,6 +145,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down Expand Up @@ -350,6 +352,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down Expand Up @@ -526,6 +530,8 @@ spec:
type: string
keystoneAPIImage:
type: string
ksmImage:
type: string
manilaAPIImage:
type: string
manilaSchedulerImage:
Expand Down
2 changes: 2 additions & 0 deletions config/default/manager_default_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ spec:
value: quay.io/podified-antelope-centos9/openstack-ceilometer-notification:current-podified
- name: RELATED_IMAGE_CEILOMETER_SGCORE_IMAGE_URL_DEFAULT
value: quay.io/openstack-k8s-operators/sg-core:v6.0.0
- name: RELATED_IMAGE_KSM_IMAGE_URL_DEFAULT
value: registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0
- name: RELATED_IMAGE_CINDER_API_IMAGE_URL_DEFAULT
value: quay.io/podified-antelope-centos9/openstack-cinder-api:current-podified
- name: RELATED_IMAGE_CINDER_BACKUP_IMAGE_URL_DEFAULT
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 @@ -34,6 +34,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/openstack-k8s-operators/sg-core:v6.0.0
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 @@ -134,6 +134,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
Loading