forked from kubeflow/kubeflow
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support K8s 1.22 in profile controller (kubeflow#6491)
* profile-controller: Delete old kubebuilder v1 project Signed-off-by: Apotolos Gerakaris <apoger@arrikto.com> * profile-controller: Initialize Kubebuilder v3 project go module name: github.com/kubeflow/kubeflow/components/profile-controller project domain: kubeflow.org Changes: * Go Version got upgraded from v1.15 to v1.17 * With Kubebuilder V3 our project dependencies got updated to a more up-to-date version. * controller-runtime library got updated from v0.2.0 to v0.12.1. Signed-off-by: Apotolos Gerakaris <apoger@arrikto.com> * profile-controller: create placeholder API types and controller logic files We created the Profile API types v1: kubebuilder create api --version v1 kind Profile v1beta1: kubebuilder create api --version v1beta1 Profile We copied over the API definitions from the old project to the new one (Note: Currently KFAM uses the v1beta1 version of Profile to provide fine-grain user-namespace level access control) Signed-off-by: Apotolos Gerakaris <apoger@arrikto.com> * profile-controller: copy controllers logic from old project to the new one * Copied the files under controller/ dir from the old to our new project Signed-off-by: Apotolos Gerakaris <apoger@arrikto.com> * profile-controller: Code modifications to fix profile-controller With Kubebuilder V3 the dependencies of our project got updated to a more up-to-date version. Newer versions of certain packages resulted to broken code parts that we had to fix. More specifically: * In this project we are using a namespace-labels-data ConfigMap to set certain labels on every Profile namespace. Every change in this ConfigMap produces an event and for every event we construct a list of reconcile.Requests that contains the name and namespace of every Profile in our system. Thus we introduced a mapEventToRequest MapFunc (profile_controller.go) that maps an event to reconcile requests for all Profiles. This change was necessary because controller-runtime library got updated from v0.6.3 to v0.12.1 * Kubebuilder V3 introduced for the profile-controller: 1) a livenessprobe (/healthz) on port :8081 2) a readinessProbe (/readyz) on port :8081 We have a conflict here as KFAM Service uses the :8081 port as well. Therefore, we switched the port to :9876 for the above Probes. Signed-off-by: Apotolos Gerakaris <apoger@arrikto.com> * profile-controller: Fix manifests, Makefile, Dockerfile Makefile: * Add image (build + push) target * Add test-overlays target * Build image using public.ecr.aws registry instead of gcr.io. Dockerfile: * fix Dockerfile to build our controller correclty Manifests * Add base/ and overlays/ manifests * Fix the manifests to be in sync with upstream other changes: Update README.md file Signed-off-by: Apotolos Gerakaris <apoger@arrikto.com> * profile-controller: Add test files Signed-off-by: Apotolos Gerakaris <apoger@arrikto.com> * profile-controller: Fix Makefile * Set the correct IMG:TAG * Remove test dependency Signed-off-by: Apotolos Gerakaris <apoger@arrikto.com>
- Loading branch information
Showing
46 changed files
with
1,103 additions
and
725 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
# Ignore build and test binaries. | ||
bin/ | ||
testbin/ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,22 @@ | ||
version: "2" | ||
domain: kubeflow.org | ||
repo: github.com/kubeflow/kubeflow | ||
layout: | ||
- go.kubebuilder.io/v3 | ||
projectName: profile-controller | ||
repo: github.com/kubeflow/kubeflow/components/profile-controller | ||
resources: | ||
- group: profile | ||
- api: | ||
crdVersion: v1 | ||
namespaced: true | ||
controller: true | ||
domain: kubeflow.org | ||
kind: Profile | ||
path: github.com/kubeflow/kubeflow/components/profile-controller/api/v1 | ||
version: v1 | ||
- api: | ||
crdVersion: v1 | ||
namespaced: true | ||
domain: kubeflow.org | ||
kind: Profile | ||
path: github.com/kubeflow/kubeflow/components/profile-controller/api/v1beta1 | ||
version: v1beta1 | ||
version: "3" |
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
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
2 changes: 2 additions & 0 deletions
2
components/profile-controller/api/v1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
2 changes: 2 additions & 0 deletions
2
components/profile-controller/api/v1beta1/zz_generated.deepcopy.go
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.