Skip to content
This repository was archived by the owner on Jan 28, 2022. It is now read-only.

Commit f11b077

Browse files
Merge branch 'master' into ds/f-fixmakefile
2 parents 62743ae + 984e6ed commit f11b077

3 files changed

Lines changed: 32 additions & 0 deletions

File tree

config/default/manager_image_patch.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ spec:
2020
secretKeyRef:
2121
name: dbrickssettings
2222
key: DatabricksToken
23+
- name: MAX_CONCURRENT_RUN_RECONCILES
24+
value: "1"

controllers/run_controller.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package controllers
1919
import (
2020
"context"
2121
"fmt"
22+
"os"
23+
"strconv"
2224
"time"
2325

2426
"github.com/go-logr/logr"
@@ -31,8 +33,11 @@ import (
3133
"sigs.k8s.io/controller-runtime/pkg/client"
3234

3335
databricksv1alpha1 "github.com/microsoft/azure-databricks-operator/api/v1alpha1"
36+
ctrl_controller "sigs.k8s.io/controller-runtime/pkg/controller"
3437
)
3538

39+
const maxConcurrentReconcilesEnvName = "MAX_CONCURRENT_RUN_RECONCILES"
40+
3641
// RunReconciler reconciles a Run object
3742
type RunReconciler struct {
3843
client.Client
@@ -110,5 +115,18 @@ func (r *RunReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
110115
func (r *RunReconciler) SetupWithManager(mgr ctrl.Manager) error {
111116
return ctrl.NewControllerManagedBy(mgr).
112117
For(&databricksv1alpha1.Run{}).
118+
WithOptions(ctrl_controller.Options{
119+
MaxConcurrentReconciles: getMaxConcurrentReconciles(),
120+
}).
113121
Complete(r)
114122
}
123+
124+
func getMaxConcurrentReconciles() int {
125+
concurrentReconciles, err := strconv.Atoi(os.Getenv(maxConcurrentReconcilesEnvName))
126+
127+
if err != nil || concurrentReconciles < 1 {
128+
return 1
129+
}
130+
131+
return concurrentReconciles
132+
}

docs/deploy.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ wget https://github.com/microsoft/azure-databricks-operator/releases/latest/down
1919
unzip release.zip
2020
```
2121

22+
> (optional) [Configure maximum number of run reconcilers](##configure-maximum-number-of-run-reconcilers)
23+
2224
2. Create the `azure-databricks-operator-system` namespace:
2325

2426
```sh
@@ -40,6 +42,16 @@ kubectl --namespace azure-databricks-operator-system \
4042
kubectl apply -f release/config
4143
```
4244

45+
## Configure maximum number of run reconcilers
46+
47+
1. Change the `MAX_CONCURRENT_RUN_RECONCILES` value in `config/default/manager_image_patch.yaml` under the `env` section with the desired number of reconcilers
48+
```yaml
49+
- name: MAX_CONCURRENT_RUN_RECONCILES
50+
value: "1"
51+
```
52+
53+
> By default `MAX_CONCURRENT_RUN_RECONCILES` is set to 1
54+
4355
## Use kustomize to customise your deployment
4456

4557
1. Clone the source code:

0 commit comments

Comments
 (0)