Skip to content

Commit ffc4567

Browse files
authored
Release core 0.0.40 and bundles to 0.0.53 (#677)
## Changes - Fixed deduplication for migrations - Added parallel reconcile options for datasources - Improve nova external scheduler request body logging
2 parents b769b21 + 81d6886 commit ffc4567

17 files changed

Lines changed: 104 additions & 84 deletions

File tree

cmd/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,6 @@ func main() {
509509
Client: multiclusterClient,
510510
Scheme: mgr.GetScheme(),
511511
Monitor: monitor,
512-
Conf: conf.GetConfigOrDie[openstack.OpenStackDatasourceReconcilerConfig](),
513512
}).SetupWithManager(mgr, multiclusterClient); err != nil {
514513
setupLog.Error(err, "unable to create controller", "controller", "OpenStackDatasourceReconciler")
515514
os.Exit(1)

helm/bundles/cortex-cinder/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: v2
55
name: cortex-cinder
66
description: A Helm chart deploying Cortex for Cinder.
77
type: application
8-
version: 0.0.52
8+
version: 0.0.53
99
appVersion: 0.1.0
1010
dependencies:
1111
# from: file://../../library/cortex-postgres
@@ -16,12 +16,12 @@ dependencies:
1616
# from: file://../../library/cortex
1717
- name: cortex
1818
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
19-
version: 0.0.39
19+
version: 0.0.40
2020
alias: cortex-knowledge-controllers
2121
# from: file://../../library/cortex
2222
- name: cortex
2323
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
24-
version: 0.0.39
24+
version: 0.0.40
2525
alias: cortex-scheduling-controllers
2626

2727
# Owner info adds a configmap to the kubernetes cluster with information on

helm/bundles/cortex-crds/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ apiVersion: v2
55
name: cortex-crds
66
description: A Helm chart deploying Cortex CRDs.
77
type: application
8-
version: 0.0.52
8+
version: 0.0.53
99
appVersion: 0.1.0
1010
dependencies:
1111
# from: file://../../library/cortex
1212
- name: cortex
1313
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
14-
version: 0.0.39
14+
version: 0.0.40
1515

1616
# Owner info adds a configmap to the kubernetes cluster with information on
1717
# the service owner. This makes it easier to find out who to contact in case

helm/bundles/cortex-ironcore/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ apiVersion: v2
55
name: cortex-ironcore
66
description: A Helm chart deploying Cortex for IronCore.
77
type: application
8-
version: 0.0.52
8+
version: 0.0.53
99
appVersion: 0.1.0
1010
dependencies:
1111
# from: file://../../library/cortex
1212
- name: cortex
1313
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
14-
version: 0.0.39
14+
version: 0.0.40
1515

1616
# Owner info adds a configmap to the kubernetes cluster with information on
1717
# the service owner. This makes it easier to find out who to contact in case

helm/bundles/cortex-manila/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: v2
55
name: cortex-manila
66
description: A Helm chart deploying Cortex for Manila.
77
type: application
8-
version: 0.0.52
8+
version: 0.0.53
99
appVersion: 0.1.0
1010
dependencies:
1111
# from: file://../../library/cortex-postgres
@@ -16,12 +16,12 @@ dependencies:
1616
# from: file://../../library/cortex
1717
- name: cortex
1818
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
19-
version: 0.0.39
19+
version: 0.0.40
2020
alias: cortex-knowledge-controllers
2121
# from: file://../../library/cortex
2222
- name: cortex
2323
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
24-
version: 0.0.39
24+
version: 0.0.40
2525
alias: cortex-scheduling-controllers
2626

2727
# Owner info adds a configmap to the kubernetes cluster with information on

helm/bundles/cortex-nova/Chart.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ apiVersion: v2
55
name: cortex-nova
66
description: A Helm chart deploying Cortex for Nova.
77
type: application
8-
version: 0.0.52
8+
version: 0.0.53
99
appVersion: 0.1.0
1010
dependencies:
1111
# from: file://../../library/cortex-postgres
@@ -16,12 +16,12 @@ dependencies:
1616
# from: file://../../library/cortex
1717
- name: cortex
1818
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
19-
version: 0.0.39
19+
version: 0.0.40
2020
alias: cortex-knowledge-controllers
2121
# from: file://../../library/cortex
2222
- name: cortex
2323
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
24-
version: 0.0.39
24+
version: 0.0.40
2525
alias: cortex-scheduling-controllers
2626

2727
# Owner info adds a configmap to the kubernetes cluster with information on

helm/bundles/cortex-nova/alerts/nova.alerts.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,9 @@ groups:
627627
the datasource controller's workqueue overprioritizing other datasources.
628628
629629
- alert: CortexNovaExistingDatasourcesLackingBehind
630-
expr: sum by(datasource) (cortex_datasource_seconds_until_reconcile{queued="true",domain="nova"}) < -600
630+
expr: |
631+
sum by(datasource) (cortex_datasource_seconds_until_reconcile{queued="true",domain="nova"}) < -600
632+
and on(datasource) cortex_datasource_state{state="ready",domain="nova"} == 1
631633
for: 10m
632634
labels:
633635
context: datasources

helm/bundles/cortex-pods/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ apiVersion: v2
55
name: cortex-pods
66
description: A Helm chart deploying Cortex for Pods.
77
type: application
8-
version: 0.0.52
8+
version: 0.0.53
99
appVersion: 0.1.0
1010
dependencies:
1111
# from: file://../../library/cortex
1212
- name: cortex
1313
repository: oci://ghcr.io/cobaltcore-dev/cortex/charts
14-
version: 0.0.39
14+
version: 0.0.40
1515

1616
# Owner info adds a configmap to the kubernetes cluster with information on
1717
# the service owner. This makes it easier to find out who to contact in case

helm/library/cortex/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: cortex
33
description: A Helm chart to distribute cortex.
44
type: application
5-
version: 0.0.39
6-
appVersion: "sha-f437366b"
5+
version: 0.0.40
6+
appVersion: "sha-be8840bc"
77
icon: "https://example.com/icon.png"
88
dependencies: []

internal/knowledge/datasources/plugins/openstack/controller.go

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import (
1212
"github.com/cobaltcore-dev/cortex/api/v1alpha1"
1313
"github.com/cobaltcore-dev/cortex/internal/knowledge/datasources"
1414
"github.com/cobaltcore-dev/cortex/internal/knowledge/db"
15+
"github.com/cobaltcore-dev/cortex/pkg/conf"
1516
"github.com/cobaltcore-dev/cortex/pkg/keystone"
1617
"github.com/cobaltcore-dev/cortex/pkg/multicluster"
1718
"github.com/cobaltcore-dev/cortex/pkg/sso"
@@ -24,20 +25,25 @@ import (
2425
"k8s.io/apimachinery/pkg/runtime"
2526
ctrl "sigs.k8s.io/controller-runtime"
2627
"sigs.k8s.io/controller-runtime/pkg/client"
28+
"sigs.k8s.io/controller-runtime/pkg/controller"
2729
"sigs.k8s.io/controller-runtime/pkg/event"
2830
"sigs.k8s.io/controller-runtime/pkg/handler"
2931
logf "sigs.k8s.io/controller-runtime/pkg/log"
3032
"sigs.k8s.io/controller-runtime/pkg/manager"
3133
"sigs.k8s.io/controller-runtime/pkg/predicate"
34+
"sigs.k8s.io/controller-runtime/pkg/reconcile"
3235
)
3336

34-
type OpenStackDatasourceReconcilerConfig struct {
37+
type config struct {
3538
// The controller will only touch resources with this scheduling domain.
3639
SchedulingDomain v1alpha1.SchedulingDomain `json:"schedulingDomain"`
3740
// Secret ref to keystone credentials stored in a k8s secret.
3841
KeystoneSecretRef corev1.SecretReference `json:"keystoneSecretRef"`
3942
// Secret ref to SSO credentials stored in a k8s secret, if applicable.
4043
SSOSecretRef *corev1.SecretReference `json:"ssoSecretRef"`
44+
// The number of parallel reconciles to allow for the controller.
45+
// By default, this will be set to 1.
46+
ParallelReconciles *int `json:"openstackDatasourceControllerParallelReconciles,omitempty"`
4147
}
4248

4349
type Syncer interface {
@@ -54,8 +60,9 @@ type OpenStackDatasourceReconciler struct {
5460
Scheme *runtime.Scheme
5561
// Datasources monitor.
5662
Monitor datasources.Monitor
63+
5764
// Config for the reconciler.
58-
Conf OpenStackDatasourceReconcilerConfig
65+
conf config
5966
}
6067

6168
// Reconcile is part of the main kubernetes reconciliation loop which aims to
@@ -281,16 +288,21 @@ func predicateIgnoreStatusConditions() predicate.Predicate {
281288
}
282289

283290
func (r *OpenStackDatasourceReconciler) SetupWithManager(mgr manager.Manager, mcl *multicluster.Client) error {
291+
var err error
292+
r.conf, err = conf.GetConfig[config]()
293+
if err != nil {
294+
return err
295+
}
284296
bldr := multicluster.BuildController(mcl, mgr)
285297
// Watch datasource changes across all clusters.
286-
bldr, err := bldr.WatchesMulticluster(
298+
bldr, err = bldr.WatchesMulticluster(
287299
&v1alpha1.Datasource{},
288300
&handler.EnqueueRequestForObject{},
289301
predicate.NewPredicateFuncs(func(obj client.Object) bool {
290302
// Only react to datasources matching the operator.
291303
ds := obj.(*v1alpha1.Datasource)
292304
// Ignore all datasources outside our scheduling domain.
293-
if ds.Spec.SchedulingDomain != r.Conf.SchedulingDomain {
305+
if ds.Spec.SchedulingDomain != r.conf.SchedulingDomain {
294306
return false
295307
}
296308
// Ignore all datasources that are not of type openstack.
@@ -305,5 +317,14 @@ func (r *OpenStackDatasourceReconciler) SetupWithManager(mgr manager.Manager, mc
305317
return err
306318
}
307319
return bldr.Named("cortex-openstack-datasource").
320+
WithOptions(controller.TypedOptions[reconcile.Request]{
321+
// Allow parallel reconciles if configured, otherwise default to 1.
322+
MaxConcurrentReconciles: func() int {
323+
if r.conf.ParallelReconciles != nil {
324+
return *r.conf.ParallelReconciles
325+
}
326+
return 1
327+
}(),
328+
}).
308329
Complete(r)
309330
}

0 commit comments

Comments
 (0)