Skip to content

Commit

Permalink
review: turn off leader-election by default
Browse files Browse the repository at this point in the history
  • Loading branch information
tenzen-y committed Oct 28, 2021
1 parent b72daa8 commit c55bd42
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 64 deletions.
2 changes: 1 addition & 1 deletion cmd/katib-controller/v1beta1/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func main() {
flag.Var(&trialResources, "trial-resources", "The list of resources that can be used as trial template, in the form: Kind.version.group (e.g. TFJob.v1.kubeflow.org)")
flag.IntVar(&webhookPort, "webhook-port", 8443, "The port number to be used for admission webhook server.")
// For leader election
flag.BoolVar(&enableLeaderElection, "enable-leader-election", true, "Enable leader election for katib-controller. Enabling this will ensure there is only one active katib-controller.")
flag.BoolVar(&enableLeaderElection, "enable-leader-election", false, "Enable leader election for katib-controller. Enabling this will ensure there is only one active katib-controller.")
flag.StringVar(&leaderElectionID, "leader-election-id", "3fbc96e9.katib.kubeflow.org", "The ID for leader election.")

// TODO (andreyvelich): Currently it is not possible to set different webhook service name.
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Below is a list of command-line flags accepted by Katib controller:
| trial-resources | []schema.GroupVersionKind | null | The list of resources that can be used as trial template, in the form: Kind.version.group (e.g. TFJob.v1.kubeflow.org) |
| webhook-inject-securitycontext | bool | false | Inject the securityContext of container[0] in the sidecar |
| webhook-port | int | 8443 | The port number to be used for admission webhook server |
| enable-leader-election | bool | true | Enable leader election for katib-controller. Enabling this will ensure there is only one active katib-controller. |
| enable-leader-election | bool | false | Enable leader election for katib-controller. Enabling this will ensure there is only one active katib-controller. |
| leader-election-id | string | "3fbc96e9.katib.kubeflow.org" | The ID for leader election. |

## Workflow design
Expand Down

This file was deleted.

11 changes: 0 additions & 11 deletions manifests/v1beta1/installs/ha/katib-external-db/kustomization.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions manifests/v1beta1/installs/ha/katib-openshift/kustomization.yaml

This file was deleted.

11 changes: 0 additions & 11 deletions manifests/v1beta1/installs/ha/katib-standalone/kustomization.yaml

This file was deleted.

This file was deleted.

5 changes: 0 additions & 5 deletions manifests/v1beta1/installs/ha/overlays/kustomization.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: kubeflow
resources:
- ../katib-standalone
# rbac for leader-election
- leader-election-rbac.yaml
replicas:
- name: katib-controller
count: 2
patchesJson6902:
- target:
group: apps
version: v1
kind: Deployment
name: katib-controller
path: ./patches/controller.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: add
path: /spec/template/spec/containers/0/args/-
value: "--enable-leader-election"
2 changes: 1 addition & 1 deletion scripts/v1beta1/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ set -o xtrace
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../..

cd ${SCRIPT_ROOT}
kustomize build manifests/v1beta1/installs/ha/katib-standalone | kubectl apply -f -
kustomize build manifests/v1beta1/installs/katib-standalone | kubectl apply -f -
2 changes: 1 addition & 1 deletion scripts/v1beta1/undeploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ sleep 10
SCRIPT_ROOT=$(dirname ${BASH_SOURCE})/../..

cd ${SCRIPT_ROOT}
kustomize build manifests/v1beta1/installs/ha/katib-standalone | kubectl delete -f -
kustomize build manifests/v1beta1/installs/katib-standalone | kubectl delete -f -

0 comments on commit c55bd42

Please sign in to comment.