Skip to content

Commit a91d332

Browse files
authored
Merge branch 'openstack-k8s-operators:main' into clean-compute-node-config
2 parents 62548b5 + b520fae commit a91d332

File tree

18 files changed

+278
-76
lines changed

18 files changed

+278
-76
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,9 @@ This operator deploys a multiple telemetry agents, both in the control plane and
6666
7. Scale down telemetry-operator and openstack-operator
6767

6868
```bash
69-
oc patch csv openstack-operator.v0.0.1 --type='json' -p='[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value":0}]' -n openstack-operators
69+
oc scale deployments/openstack-operator-controller-operator --replicas 0 -n openstack-operators
70+
71+
oc scale deployments/openstack-operator-controller-manager --replicas 0 -n openstack-operators
7072
7173
oc scale deployments/telemetry-operator-controller-manager --replicas 0 -n openstack-operators
7274
```

api/go.mod

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ go 1.21
55
require (
66
github.com/onsi/ginkgo/v2 v2.20.1
77
github.com/onsi/gomega v1.34.1
8-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250513115636-b549982a5d8f
9-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250508141203-be026d3164f7
8+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250707164913-ecb62273f7b5
9+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250605082218-a58074898dd7
1010
github.com/rhobs/observability-operator v0.3.1
1111
k8s.io/api v0.29.15
1212
k8s.io/apimachinery v0.29.15
@@ -21,7 +21,7 @@ require (
2121
github.com/emicklei/go-restful/v3 v3.12.0 // indirect
2222
github.com/evanphx/json-patch/v5 v5.9.0 // indirect
2323
github.com/fsnotify/fsnotify v1.7.0 // indirect
24-
github.com/go-logr/logr v1.4.2 // indirect
24+
github.com/go-logr/logr v1.4.3 // indirect
2525
github.com/go-logr/zapr v1.3.0 // indirect
2626
github.com/go-openapi/jsonpointer v0.21.0 // indirect
2727
github.com/go-openapi/jsonreference v0.21.0 // indirect
@@ -75,6 +75,3 @@ require (
7575
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
7676
sigs.k8s.io/yaml v1.4.0 // indirect
7777
)
78-
79-
// custom RabbitmqClusterSpecCore for OpenStackControlplane (v2.6.0_patches_tag)
80-
replace github.com/rabbitmq/cluster-operator/v2 => github.com/openstack-k8s-operators/rabbitmq-cluster-operator/v2 v2.6.1-0.20241017142550-a3524acedd49 //allow-merging

api/go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ github.com/evanphx/json-patch/v5 v5.9.0 h1:kcBlZQbplgElYIlo/n1hJbls2z/1awpXxpRi0
1414
github.com/evanphx/json-patch/v5 v5.9.0/go.mod h1:VNkHZ/282BpEyt/tObQO8s5CMPmYYq14uClGH4abBuQ=
1515
github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA=
1616
github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM=
17-
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
18-
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
17+
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
18+
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
1919
github.com/go-logr/zapr v1.3.0 h1:XGdV8XW8zdwFiwOA2Dryh1gj2KRQyOOoNmBy4EplIcQ=
2020
github.com/go-logr/zapr v1.3.0/go.mod h1:YKepepNBd1u/oyhd/yQmtjVXmm9uML4IXUgMOwR8/Gg=
2121
github.com/go-openapi/jsonpointer v0.21.0 h1:YgdVicSA9vH5RiHs9TZW5oyafXZFc6+2Vc1rr/O9oNQ=
@@ -72,10 +72,10 @@ github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo
7272
github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
7373
github.com/onsi/gomega v1.34.1 h1:EUMJIKUjM8sKjYbtxQI9A4z2o+rruxnzNvpknOXie6k=
7474
github.com/onsi/gomega v1.34.1/go.mod h1:kU1QgUvBDLXBJq618Xvm2LUX6rSAfRaFRTcdOeDLwwY=
75-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250513115636-b549982a5d8f h1:b3WGatQCIBoNj8RvbVGNITL9RuQLwkXzXAgt7s/D5zc=
76-
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250513115636-b549982a5d8f/go.mod h1:47iJk3vedZWnBkZyNyYij4ma2HjG4l2VCqKz3f+XDkQ=
77-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250508141203-be026d3164f7 h1:c3h1q3fDoit3NmvNL89xUL9A12bJivaTF+IOPEOAwLc=
78-
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250508141203-be026d3164f7/go.mod h1:UwHXRIrMSPJD3lFqrA4oKmRXVLFQCRkLAj9x6KLEHiQ=
75+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250707164913-ecb62273f7b5 h1:ur8OBhMf/ryfhq6Z1wMgn3kQV5hI0TgTOJiLZvfZtfM=
76+
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20250707164913-ecb62273f7b5/go.mod h1:HMeEFVPJOatbQQc4XcpVrF6BpCEOEq9EPG9jSxcyQXw=
77+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250605082218-a58074898dd7 h1:bx5LfMQHLnYE3QvY8aRXHVfgTwDROnTqH96UL84a9Mw=
78+
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20250605082218-a58074898dd7/go.mod h1:P+7F1wiwZUxOy4myYXFyc/uBtGATDFpk3yAllXe1Vzk=
7979
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
8080
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
8181
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=

api/v1beta1/ceilometer_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const (
4242
// KubeStateMetricsImage - default fall-back image for KSM
4343
KubeStateMetricsImage = "registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.10.0"
4444
// MysqldExporterImage - default fall-back image for mysqld_exporter
45-
MysqldExporterContainerImage = "quay.io/prometheus/mysqld-exporter:v0.16.0"
45+
MysqldExporterContainerImage = "quay.io/prometheus/mysqld-exporter:v0.15.1"
4646
)
4747

4848
// CeilometerSpec defines the desired state of Ceilometer

ci/deploy-telemetry-with-ceph.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
- name: "Deploy telemetry in a job with ceph"
3+
hosts: "{{ cifmw_target_hook_host | default('localhost') }}"
4+
gather_facts: false
5+
environment:
6+
KUBECONFIG: "{{ cifmw_openshift_kubeconfig }}"
7+
PATH: "{{ cifmw_path }}"
8+
tasks:
9+
- name: Deploy logging dependencies
10+
ansible.builtin.import_role:
11+
name: deploy-logging-dependencies
12+
- name: Copy controlplane kustomization
13+
ansible.builtin.copy:
14+
dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/90-kustomize-controlplane-telemetry.yaml"
15+
content: |-
16+
apiVersion: kustomize.config.k8s.io/v1beta1
17+
kind: Kustomization
18+
namespace: openstack
19+
patches:
20+
- patch: |-
21+
apiVersion: core.openstack.org/v1beta1
22+
kind: OpenStackControlPlane
23+
metadata:
24+
name: unused
25+
spec:
26+
swift: # required for smoketests to pass
27+
enabled: true
28+
heat: # required for autoscaling
29+
enabled: true
30+
telemetry: # enable all telemetry controlplane services
31+
enabled: true
32+
template:
33+
metricStorage:
34+
enabled: true
35+
monitoringStack:
36+
alertingEnabled: false
37+
autoscaling:
38+
enabled: true
39+
logging:
40+
enabled: true
41+
ceilometer:
42+
enabled: true
43+
mysqldExporterEnabled: true
44+
target:
45+
kind: OpenStackControlPlane
46+
- patch: |-
47+
apiVersion: core.openstack.org/v1beta1
48+
kind: OpenStackControlPlane
49+
metadata:
50+
name: unused
51+
spec:
52+
telemetry:
53+
template:
54+
metricStorage:
55+
dashboardsEnabled: true
56+
target:
57+
kind: OpenStackControlPlane
58+
59+
# Deploy telemetry services and all their prerequisities on the dataplane
60+
- name: Copy dataplane nodeset kustomization
61+
ansible.builtin.copy:
62+
dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/dataplane/60-kustomize-dataplane-telemetry-service.yaml"
63+
content: |-
64+
apiVersion: kustomize.config.k8s.io/v1beta1
65+
kind: Kustomization
66+
resources:
67+
namespace: {{ cifmw_install_yamls_defaults['NAMESPACE'] }}
68+
patches:
69+
- target:
70+
kind: OpenStackDataPlaneNodeSet
71+
name: .*
72+
patch: |-
73+
- op: add
74+
path: /spec/services/-
75+
value: install-certs
76+
- op: add
77+
path: /spec/services/-
78+
value: ovn
79+
- op: add
80+
path: /spec/services/-
81+
value: libvirt
82+
- op: add
83+
path: /spec/services/-
84+
value: telemetry
85+
- op: add
86+
path: /spec/services/-
87+
value: telemetry-power-monitoring
88+
- op: add
89+
path: /spec/services/-
90+
value: logging

ci/files/containers.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
# tcib container images used by cloudops team for telemetry testing
3+
container_images:
4+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-aodh-api:current-tested
5+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-aodh-evaluator:current-tested
6+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-aodh-listener:current-tested
7+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-aodh-notifier:current-tested
8+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-ceilometer-central:current-tested
9+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-ceilometer-compute:current-tested
10+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-ceilometer-notification:current-tested
11+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-ceilometer-ipmi:current-tested
12+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-cloudkitty-api:current-tested
13+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-cloudkitty-processor:current-tested
14+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-heat-api-cfn:current-tested
15+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-heat-api:current-tested
16+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-heat-engine:current-tested
17+
- imagename: quay.rdoproject.org/podified-master-centos10/openstack-tempest-all:current-tested

ci/vars-telemetry-with-ceph.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
cifmw_run_tests: false
3+
cifmw_edpm_prepare_timeout: 60
4+
cifmw_deploy_obs: true
5+
cifmw_openshift_obs_definition:
6+
apiVersion: operators.coreos.com/v1alpha1
7+
kind: Subscription
8+
metadata:
9+
name: observability-operator
10+
namespace: openshift-operators
11+
spec:
12+
channel: stable
13+
installPlanApproval: Automatic
14+
name: cluster-observability-operator
15+
source: redhat-operators
16+
sourceNamespace: openshift-marketplace
17+
pre_deploy_deploy_telemetry_services:
18+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/deploy-telemetry-with-ceph.yml"
19+
type: playbook

controllers/autoscaling_controller.go

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,11 @@ func (r *AutoscalingReconciler) Reconcile(ctx context.Context, req ctrl.Request)
148148
// Always patch the instance status when exiting this function so we can
149149
// persist any changes.
150150
defer func() {
151+
// Don't update the status, if reconciler Panics
152+
if r := recover(); r != nil {
153+
Log.Info(fmt.Sprintf("panic during reconcile %v\n", r))
154+
panic(r)
155+
}
151156
condition.RestoreLastTransitionTimes(
152157
&instance.Status.Conditions, savedConditions)
153158
if instance.Status.Conditions.IsUnknown(condition.ReadyCondition) {
@@ -950,7 +955,7 @@ func (r *AutoscalingReconciler) SetupWithManager(ctx context.Context, mgr ctrl.M
950955
func (r *AutoscalingReconciler) findObjectsForSrc(ctx context.Context, src client.Object) []reconcile.Request {
951956
requests := []reconcile.Request{}
952957

953-
l := log.FromContext(ctx).WithName("Controllers").WithName("Autoscaling")
958+
Log := r.GetLogger(ctx)
954959

955960
for _, field := range autoscalingAllWatchFields {
956961
crList := &telemetryv1.AutoscalingList{}
@@ -964,7 +969,7 @@ func (r *AutoscalingReconciler) findObjectsForSrc(ctx context.Context, src clien
964969
}
965970

966971
for _, item := range crList.Items {
967-
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
972+
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
968973

969974
requests = append(requests,
970975
reconcile.Request{
@@ -983,20 +988,20 @@ func (r *AutoscalingReconciler) findObjectsForSrc(ctx context.Context, src clien
983988
func (r *AutoscalingReconciler) findObjectForSrc(ctx context.Context, src client.Object) []reconcile.Request {
984989
requests := []reconcile.Request{}
985990

986-
l := log.FromContext(ctx).WithName("Controllers").WithName("Autoscaling")
991+
Log := r.GetLogger(ctx)
987992

988993
crList := &telemetryv1.AutoscalingList{}
989994
listOps := &client.ListOptions{
990995
Namespace: src.GetNamespace(),
991996
}
992997
err := r.Client.List(ctx, crList, listOps)
993998
if err != nil {
994-
l.Error(err, fmt.Sprintf("listing %s for namespace: %s", crList.GroupVersionKind().Kind, src.GetNamespace()))
999+
Log.Error(err, fmt.Sprintf("listing %s for namespace: %s", crList.GroupVersionKind().Kind, src.GetNamespace()))
9951000
return requests
9961001
}
9971002

9981003
for _, item := range crList.Items {
999-
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
1004+
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
10001005

10011006
requests = append(requests,
10021007
reconcile.Request{

controllers/ceilometer_controller.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,11 @@ func (r *CeilometerReconciler) Reconcile(ctx context.Context, req ctrl.Request)
151151
// Always patch the instance status when exiting this function so we can
152152
// persist any changes.
153153
defer func() {
154+
// Don't update the status, if reconciler Panics
155+
if r := recover(); r != nil {
156+
Log.Info(fmt.Sprintf("panic during reconcile %v\n", r))
157+
panic(r)
158+
}
154159
condition.RestoreLastTransitionTimes(
155160
&instance.Status.Conditions, savedConditions)
156161
if instance.Status.Conditions.IsUnknown(condition.ReadyCondition) {
@@ -1821,7 +1826,7 @@ func (r *CeilometerReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Ma
18211826
func (r *CeilometerReconciler) findObjectsForSrc(ctx context.Context, src client.Object) []reconcile.Request {
18221827
requests := []reconcile.Request{}
18231828

1824-
l := log.FromContext(ctx).WithName("Controllers").WithName("Ceilometer")
1829+
Log := r.GetLogger(ctx)
18251830

18261831
for _, field := range ceilometerWatchFields {
18271832
crList := &telemetryv1.CeilometerList{}
@@ -1831,12 +1836,12 @@ func (r *CeilometerReconciler) findObjectsForSrc(ctx context.Context, src client
18311836
}
18321837
err := r.Client.List(ctx, crList, listOps)
18331838
if err != nil {
1834-
l.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
1839+
Log.Error(err, fmt.Sprintf("listing %s for field: %s - %s", crList.GroupVersionKind().Kind, field, src.GetNamespace()))
18351840
return requests
18361841
}
18371842

18381843
for _, item := range crList.Items {
1839-
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
1844+
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
18401845

18411846
requests = append(requests,
18421847
reconcile.Request{
@@ -1855,20 +1860,20 @@ func (r *CeilometerReconciler) findObjectsForSrc(ctx context.Context, src client
18551860
func (r *CeilometerReconciler) findObjectForSrc(ctx context.Context, src client.Object) []reconcile.Request {
18561861
requests := []reconcile.Request{}
18571862

1858-
l := log.FromContext(ctx).WithName("Controllers").WithName("Ceilometer")
1863+
Log := r.GetLogger(ctx)
18591864

18601865
crList := &telemetryv1.CeilometerList{}
18611866
listOps := &client.ListOptions{
18621867
Namespace: src.GetNamespace(),
18631868
}
18641869
err := r.Client.List(ctx, crList, listOps)
18651870
if err != nil {
1866-
l.Error(err, fmt.Sprintf("listing %s for namespace: %s", crList.GroupVersionKind().Kind, src.GetNamespace()))
1871+
Log.Error(err, fmt.Sprintf("listing %s for namespace: %s", crList.GroupVersionKind().Kind, src.GetNamespace()))
18671872
return requests
18681873
}
18691874

18701875
for _, item := range crList.Items {
1871-
l.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
1876+
Log.Info(fmt.Sprintf("input source %s changed, reconcile: %s - %s", src.GetName(), item.GetName(), item.GetNamespace()))
18721877

18731878
requests = append(requests,
18741879
reconcile.Request{

controllers/logging_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ func (r *LoggingReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re
115115
// Always patch the instance status when exiting this function so we can
116116
// persist any changes.
117117
defer func() {
118+
// Don't update the status, if reconciler Panics
119+
if r := recover(); r != nil {
120+
Log.Info(fmt.Sprintf("panic during reconcile %v\n", r))
121+
panic(r)
122+
}
118123
condition.RestoreLastTransitionTimes(
119124
&instance.Status.Conditions, savedConditions)
120125
if instance.Status.Conditions.IsUnknown(condition.ReadyCondition) {

0 commit comments

Comments
 (0)