Skip to content

Commit c223c8b

Browse files
committed
Merge branch 'main' into cloudkitty_separate
2 parents a25975a + 9d18f92 commit c223c8b

14 files changed

+111
-52
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ build: generate fmt vet ## Build manager binary.
127127
.PHONY: run
128128
run: export METRICS_PORT?=8080
129129
run: export HEALTH_PORT?=8081
130+
run: export PPROF_PORT?=8082
130131
run: export ENABLE_WEBHOOKS?=false
131132
run: manifests generate fmt vet ## Run a controller from your host.
132133
/bin/bash hack/clean_local_webhook.sh
133-
go run ./main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)"
134+
go run ./main.go -metrics-bind-address ":$(METRICS_PORT)" -health-probe-bind-address ":$(HEALTH_PORT)" -pprof-bind-address ":$(PPROF_PORT)"
134135

135136
# Extra vars which will be passed to the Docker-build
136137
DOCKER_BUILD_ARGS ?=
@@ -351,6 +352,7 @@ SKIP_CERT ?=false
351352
.PHONY: run-with-webhook
352353
run-with-webhook: export METRICS_PORT?=8080
353354
run-with-webhook: export HEALTH_PORT?=8081
355+
run-with-webhook: export PPROF_PORT?=8082
354356
run-with-webhook: manifests generate fmt vet ## Run a controller from your host.
355357
/bin/bash hack/run_with_local_webhook.sh
356358

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ 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 patch csv openstack-operator.v0.3.0 --type='json' -p='[{"op": "replace", "path": "/spec/install/spec/deployments/0/spec/replicas", "value":0}]' -n openstack-operators
7070
7171
oc scale deployments/telemetry-operator-controller-manager --replicas 0 -n openstack-operators
7272
```

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/configure-autoscaling.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
- name: "Create the kustomization for deploying autoscaling"
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: Copy controlplane kustomization
10+
ansible.builtin.copy:
11+
dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/90-kustomize-controlplane-autoscaling.yaml"
12+
content: |-
13+
apiVersion: kustomize.config.k8s.io/v1beta1
14+
kind: Kustomization
15+
namespace: openstack
16+
patches:
17+
- patch: |-
18+
apiVersion: core.openstack.org/v1beta1
19+
kind: OpenStackControlPlane
20+
metadata:
21+
name: unused
22+
spec:
23+
heat:
24+
enabled: true
25+
telemetry:
26+
enabled: true
27+
template:
28+
metricStorage:
29+
enabled: true
30+
monitoringStack:
31+
alertingEnabled: false
32+
autoscaling:
33+
enabled: true
34+
ceilometer:
35+
enabled: true
36+
mysqldExporterEnabled: true
37+
target:
38+
kind: OpenStackControlPlane
39+
- patch: |-
40+
apiVersion: core.openstack.org/v1beta1
41+
kind: OpenStackControlPlane
42+
metadata:
43+
name: unused
44+
spec:
45+
telemetry:
46+
template:
47+
metricStorage:
48+
dashboardsEnabled: true
49+
target:
50+
kind: OpenStackControlPlane

ci/deploy-logging-dependencies.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,25 @@
2525
- op: add
2626
path: /spec/services/-
2727
value: logging
28+
29+
- name: Copy controlplane kustomization
30+
ansible.builtin.copy:
31+
dest: "{{ cifmw_basedir }}/artifacts/manifests/kustomizations/controlplane/90-kustomize-controlplane-logging.yaml"
32+
content: |-
33+
apiVersion: kustomize.config.k8s.io/v1beta1
34+
kind: Kustomization
35+
namespace: openstack
36+
patches:
37+
- patch: |-
38+
apiVersion: core.openstack.org/v1beta1
39+
kind: OpenStackControlPlane
40+
metadata:
41+
name: unused
42+
spec:
43+
telemetry:
44+
enabled: true
45+
template:
46+
logging:
47+
enabled: true
48+
target:
49+
kind: OpenStackControlPlane

ci/vars-autoscaling.yml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -15,31 +15,6 @@ cifmw_openshift_obs_definition:
1515
source: redhat-operators
1616
sourceNamespace: openshift-marketplace
1717

18-
cifmw_edpm_prepare_kustomizations:
19-
- apiVersion: kustomize.config.k8s.io/v1beta1
20-
kind: Kustomization
21-
namespace: openstack
22-
patches:
23-
- patch: |-
24-
apiVersion: core.openstack.org/v1beta1
25-
kind: OpenStackControlPlane
26-
metadata:
27-
name: unused
28-
spec:
29-
heat:
30-
enabled: true
31-
telemetry:
32-
enabled: true
33-
template:
34-
metricStorage:
35-
enabled: true
36-
monitoringStack:
37-
alertingEnabled: false
38-
dashboardsEnabled: true
39-
autoscaling:
40-
enabled: true
41-
ceilometer:
42-
enabled: true
43-
mysqldExporterEnabled: true
44-
target:
45-
kind: OpenStackControlPlane
18+
pre_deploy_kustomize_autoscaling:
19+
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/configure-autoscaling.yml"
20+
type: playbook

ci/vars-logging.yml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,3 @@ cifmw_run_tests: false
33
pre_deploy_deploy_logging_dependencies:
44
source: "{{ ansible_user_dir }}/{{ zuul.projects['github.com/openstack-k8s-operators/telemetry-operator'].src_dir }}/ci/deploy-logging-dependencies.yml"
55
type: playbook
6-
cifmw_edpm_prepare_kustomizations:
7-
- apiVersion: kustomize.config.k8s.io/v1beta1
8-
kind: Kustomization
9-
namespace: openstack
10-
patches:
11-
- patch: |-
12-
apiVersion: core.openstack.org/v1beta1
13-
kind: OpenStackControlPlane
14-
metadata:
15-
name: unused
16-
spec:
17-
telemetry:
18-
enabled: true
19-
template:
20-
logging:
21-
enabled: true
22-
target:
23-
kind: OpenStackControlPlane

controllers/autoscaling_controller.go

Lines changed: 5 additions & 0 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) {

controllers/ceilometer_controller.go

Lines changed: 5 additions & 0 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) {

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)