-
Notifications
You must be signed in to change notification settings - Fork 441
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support leader election for katib-controller (#1713)
* support leader election for katib-controller * keep consistent with default flag name generated by kubebuilder Co-authored-by: Ce Gao <ce.gao@outlook.com> * fix developer guide * fix e2e test * modify directory structure for manifests * fix e2e test * review: turn off leader-election by default * Update manifests/v1beta1/installs/katib-leader-election/leader-election-rbac.yaml Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com> * Update manifests/v1beta1/installs/katib-leader-election/leader-election-rbac.yaml Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com> * Update manifests/v1beta1/installs/katib-leader-election/leader-election-rbac.yaml Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com> * Update manifests/v1beta1/installs/katib-leader-election/leader-election-rbac.yaml Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com> Co-authored-by: Ce Gao <ce.gao@outlook.com> Co-authored-by: Andrey Velichkevich <andrey.velichkevich@gmail.com>
- Loading branch information
1 parent
b8622d6
commit f802295
Showing
6 changed files
with
66 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
manifests/v1beta1/installs/katib-leader-election/kustomization.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
26 changes: 26 additions & 0 deletions
26
manifests/v1beta1/installs/katib-leader-election/leader-election-rbac.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: Role | ||
metadata: | ||
name: leader-election | ||
namespace: kubeflow | ||
rules: | ||
- apiGroups: | ||
- coordination.k8s.io | ||
resources: | ||
- leases | ||
verbs: | ||
- "*" | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: RoleBinding | ||
metadata: | ||
name: leader-election | ||
namespace: kubeflow | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: Role | ||
name: leader-election | ||
subjects: | ||
- kind: ServiceAccount | ||
name: katib-controller | ||
namespace: kubeflow |
3 changes: 3 additions & 0 deletions
3
manifests/v1beta1/installs/katib-leader-election/patches/controller.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters