Merge branch 'master' into mp/146-fix-licenses-in-scaffolded-files

This commit is contained in:
azadeh khojandi 2020-02-17 17:48:52 +11:00 коммит произвёл GitHub
Родитель 674d15ba59 984e6ed5de
Коммит 700a2446ca
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 32 добавлений и 0 удалений

Просмотреть файл

@ -20,3 +20,5 @@ spec:
secretKeyRef:
name: dbrickssettings
key: DatabricksToken
- name: MAX_CONCURRENT_RUN_RECONCILES
value: "1"

Просмотреть файл

@ -27,6 +27,8 @@ package controllers
import (
"context"
"fmt"
"os"
"strconv"
"time"
"github.com/go-logr/logr"
@ -39,8 +41,11 @@ import (
"sigs.k8s.io/controller-runtime/pkg/client"
databricksv1alpha1 "github.com/microsoft/azure-databricks-operator/api/v1alpha1"
ctrl_controller "sigs.k8s.io/controller-runtime/pkg/controller"
)
const maxConcurrentReconcilesEnvName = "MAX_CONCURRENT_RUN_RECONCILES"
// RunReconciler reconciles a Run object
type RunReconciler struct {
client.Client
@ -118,5 +123,18 @@ func (r *RunReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
func (r *RunReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
For(&databricksv1alpha1.Run{}).
WithOptions(ctrl_controller.Options{
MaxConcurrentReconciles: getMaxConcurrentReconciles(),
}).
Complete(r)
}
func getMaxConcurrentReconciles() int {
concurrentReconciles, err := strconv.Atoi(os.Getenv(maxConcurrentReconcilesEnvName))
if err != nil || concurrentReconciles < 1 {
return 1
}
return concurrentReconciles
}

Просмотреть файл

@ -19,6 +19,8 @@ wget https://github.com/microsoft/azure-databricks-operator/releases/latest/down
unzip release.zip
```
> (optional) [Configure maximum number of run reconcilers](##configure-maximum-number-of-run-reconcilers)
2. Create the `azure-databricks-operator-system` namespace:
```sh
@ -40,6 +42,16 @@ kubectl --namespace azure-databricks-operator-system \
kubectl apply -f release/config
```
## Configure maximum number of run reconcilers
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
```yaml
- name: MAX_CONCURRENT_RUN_RECONCILES
value: "1"
```
> By default `MAX_CONCURRENT_RUN_RECONCILES` is set to 1
## Use kustomize to customise your deployment
1. Clone the source code: