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

Commit 700a244

Browse files
Merge branch 'master' into mp/146-fix-licenses-in-scaffolded-files
2 parents 674d15b + 984e6ed commit 700a244

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
@@ -27,6 +27,8 @@ package controllers
2727
import (
2828
"context"
2929
"fmt"
30+
"os"
31+
"strconv"
3032
"time"
3133

3234
"github.com/go-logr/logr"
@@ -39,8 +41,11 @@ import (
3941
"sigs.k8s.io/controller-runtime/pkg/client"
4042

4143
databricksv1alpha1 "github.com/microsoft/azure-databricks-operator/api/v1alpha1"
44+
ctrl_controller "sigs.k8s.io/controller-runtime/pkg/controller"
4245
)
4346

47+
const maxConcurrentReconcilesEnvName = "MAX_CONCURRENT_RUN_RECONCILES"
48+
4449
// RunReconciler reconciles a Run object
4550
type RunReconciler struct {
4651
client.Client
@@ -118,5 +123,18 @@ func (r *RunReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
118123
func (r *RunReconciler) SetupWithManager(mgr ctrl.Manager) error {
119124
return ctrl.NewControllerManagedBy(mgr).
120125
For(&databricksv1alpha1.Run{}).
126+
WithOptions(ctrl_controller.Options{
127+
MaxConcurrentReconciles: getMaxConcurrentReconciles(),
128+
}).
121129
Complete(r)
122130
}
131+
132+
func getMaxConcurrentReconciles() int {
133+
concurrentReconciles, err := strconv.Atoi(os.Getenv(maxConcurrentReconcilesEnvName))
134+
135+
if err != nil || concurrentReconciles < 1 {
136+
return 1
137+
}
138+
139+
return concurrentReconciles
140+
}

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)