-
Notifications
You must be signed in to change notification settings - Fork 41
feat: migration script for V1 to V2 components #162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 10 commits
ae66bf2
f2c4684
6f84e02
35a4ea2
23fb0f7
41e1cbb
11f879c
953cdfe
a725173
186408a
66e2345
4691fd5
be7d1cf
5cf0e01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ | |
| It exposes the access controlled web interfaces for Kubeflow components and more. | ||
|
|
||
| > ⚠️ __Note__ ⚠️ | ||
| > | ||
| > | ||
| > We are currently moving the Kubeflow Dashboard codebase from [`kubeflow/kubeflow`](https://github.com/kubeflow/kubeflow) to this repository ([`kubeflow/dashboard`](https://github.com/kubeflow/dashboard)). | ||
| > Please see [`kubeflow/kubeflow#7549`](https://github.com/kubeflow/kubeflow/issues/7549) for more information. | ||
|
|
||
|
|
@@ -38,6 +38,34 @@ Please refer to the [Installing Kubeflow](https://www.kubeflow.org/docs/started/ | |
|
|
||
| The official documentation for Kubeflow Dashboard can be found [here](https://www.kubeflow.org/docs/components/central-dash/). | ||
|
|
||
| ## Migrate from V1 | ||
|
|
||
| In the past, up until the Kubeflow 1.10 release, the components hosed in this repository were living in the | ||
| [`kubeflow/kubeflow`](https://github.com/kubeflow/kubeflow) repository. | ||
|
|
||
| To accomodate the migration, the first `v2.0.0` release of this repository contains the same artifacts | ||
| from the corresponding [`v1.10.0`](https://github.com/kubeflow/kubeflow/releases/tag/v1.10.0) tag from the `kubeflow/kubeflow` repo. This was done to ensure a smooth transition | ||
| between the components of the different repos. You can find more details about the migration in https://github.com/kubeflow/dashboard/issues/118. | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| 1. A Kubeflow cluster with 1.10.0 or above | ||
| 2. `kubectl` configured for access to the above cluster | ||
|
|
||
| ### Script | ||
|
|
||
| You can use the following script to perform the migration from `v1.10.0` components to the `v2.0.0` ones from this repository. The script will | ||
| perform the following actions: | ||
| 1. Remove the existing components of CentralDashboard, Profiles Controller and PodDefaults Webhook | ||
| * The script will not remove any CR (Custom Resource) or CRD (Custom Resource Definition), to ensure no data loss | ||
| * Only Kubernetes resources relevant to the Deployments will be removed (Deployment, ServiceAccount, Service etc) | ||
| * The [`NetworkPolicy`](https://github.com/kubeflow/manifests/blob/v1.10-branch/common/networkpolicies/base/centraldashboard.yaml) from the `kubeflow/manifests` repo, of the CentralDashboard, will be removed | ||
| 2. Install the manifests from this repository for the Dashboard, Profiles Controller and PodDefaults webhook | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Asking b/c I have no idea - but is it "safe" to assume the overlays this script is using when deploying to any potential client (?)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd say yes, for:
The only one with a bit of a debate would be the dashboard, as the script uses the Adding a small note in the README. LMKWDYT
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| ```bash | ||
| ./scripts/upgrade_v1_to_v1.sh | ||
kimwnasptd marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| ``` | ||
|
|
||
| ## Community | ||
|
|
||
| Kubeflow Dashboard is part of the Kubeflow project, refer to the [Kubeflow Community](https://www.kubeflow.org/docs/about/community/) page for more information. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
|
|
||
| echo "--------------------------------------------------------------------------------------" | ||
| echo "Running the upgrade script to migrate the Kubeflow Dashboard components to V2 release." | ||
| echo "--------------------------------------------------------------------------------------" | ||
|
|
||
| PROFILES_LABELS=kustomize.component=profiles | ||
| DASHBOARD_LABELS=app.kubernetes.io/component=centraldashboard | ||
| PODDEFAULT_LABELS=app.kubernetes.io/component=poddefaults | ||
|
|
||
| # Helper function for removing all K8s resources of a Kubeflow Component. This will include all resources | ||
| # relevant to the Deployment, but not CRDs. This is done to ensure we don't accidentally delete CRs | ||
| # (like PodDefaults) in user namespace. | ||
| remove-component() { | ||
| label=$1 | ||
| namespace_resources="deployment service role rolebinding configmap serviceaccount virtualservice authorizationpolicy certificate secret" | ||
| cluster_resources="clusterrole clusterrolebinding mutatingwebhookconfigurations" | ||
|
|
||
| echo -e "\nWill remove namespaced resources with labels: $label" | ||
| for resource in $namespace_resources; do | ||
| echo "Removing all $resource objects..." | ||
| kubectl delete -n kubeflow -l $label $resource | ||
|
||
| echo "Successfully removed all $resource objects" | ||
| done | ||
|
|
||
| for resource in $cluster_resources; do | ||
| echo "Removing all $resource objects..." | ||
| kubectl delete -l $label $resource | ||
|
||
| echo "Successfully removed all $resource objects" | ||
| done | ||
| } | ||
|
|
||
|
|
||
| echo -e "\nRemoving PodDefaults component..." | ||
| remove-component $PODDEFAULT_LABELS | ||
| echo -e "\nSuccessfully removed PodDefaults!" | ||
|
|
||
| echo -e "\nRemoving Profiles component..." | ||
| remove-component $PROFILES_LABELS | ||
| echo -e "\nSuccessfully removed Profiles!\n" | ||
|
|
||
| echo -e "\nRemoving Centraldashboard component..." | ||
| remove-component $DASHBOARD_LABELS | ||
| echo "Removing NetworkPolicy created by kubeflow/manifests repository..." | ||
| kubectl delete networkpolicy -n kubeflow centraldashboard || echo "No NetworkPolicy from manifests repository found. Continuing..." | ||
| echo -e "\nSuccessfully removed Centraldashboard!" | ||
|
|
||
| echo "-----------------------------------------------" | ||
| echo "Installing the updated Dashboard V2 components." | ||
| echo "-----------------------------------------------" | ||
|
|
||
| echo -e "\nApplying Dashboard component..." | ||
|
||
| echo -e "--------------------------------" | ||
| kustomize build \ | ||
| $SCRIPT_DIR/../components/centraldashboard/manifests/overlays/istio \ | ||
| | kubectl apply -f - | ||
|
|
||
| echo "Waiting for Dashboard Deployment to become available..." | ||
| kubectl wait -n kubeflow \ | ||
| --for=condition=Available \ | ||
| deployment \ | ||
| dashboard \ | ||
| --timeout=5m | ||
| echo -e "Successfully applied the Dashboard component!" | ||
|
|
||
| echo -e "\nApplying PodDefaults component..." | ||
| echo -e "----------------------------------" | ||
| kustomize build \ | ||
| $SCRIPT_DIR/../components/poddefaults-webhooks/manifests/overlays/cert-manager \ | ||
| | kubectl apply -f - | ||
|
|
||
| echo "Waiting for PodDefaults Webhook Deployment to become available..." | ||
| kubectl wait -n kubeflow \ | ||
| --for=condition=Available \ | ||
| deployment \ | ||
| poddefaults-webhook-deployment \ | ||
| --timeout=5m | ||
| echo -e "Successfully applied the PodDefaults component!" | ||
|
|
||
| echo -e "\nApplying Profile Controller component..." | ||
| echo -e "-----------------------------------------" | ||
| kustomize build \ | ||
| $SCRIPT_DIR/../components/profile-controller/config/overlays/kubeflow/ \ | ||
| | kubectl apply -f - | ||
|
|
||
| echo "Waiting for Profiles Controller Deployment to become available..." | ||
| kubectl wait -n kubeflow \ | ||
| --for=condition=Available \ | ||
| deployment \ | ||
| profiles-deployment \ | ||
| --timeout=5m | ||
| echo -e "Successfully applied the Profile Controller component!" | ||
|
|
||
| echo -e "\nSuccessfully applied Dashboard V2 components!\n" | ||

Uh oh!
There was an error while loading. Please reload this page.