Upgrading a Kubeflow Deployment

Upgrading your deployment to a later version of Kubeflow

Upgrading from Kubeflow v0.7.0 or later

Alpha version

This feature is currently in Alpha with limited support. The Kubeflowteam is interested in any feedback you may have, in particular with regards tousability of the feature.

Upgrading your Kubeflow deployment is supported if your deployment is v0.7.0 or later.

Prerequisites

  • Download the latest kfctl binary from theKubeflow releases page.

  • Ensure that your Kubeflow namespace is annotated with thecontrol-plane: kubeflow label. You can verify this by doing:

  1. kubectl get namespace $NAMESPACE -o yaml

You should see something like:

  1. metadata:
  2. labels:
  3. control-plane: kubeflow

If the label is not present, you can patch the namespace by doing

  1. kubectl label namespace $NAMESPACE control-plane=kubeflow
  • You must have a local Kubeflow application directory matching your currentdeployment. We’ll call this ${KF_DIR}.

    • This should be present if you deployed Kubeflow using the kfctl tool.
    • If you deployed Kubeflow using some other method (e.g. theDeployment UI),you will need to first create a local deployment directory:

      • Follow the instructions for environment preparations.
        • Make sure that the ${PROJECT}, ${ZONE}, and ${KF_NAME}variables match exactly with your deployment.
        • For ${CONFIG_URI}, use the kfctl_gcp_iap file if your deploymentuses Cloud IAP for authentication. Use the kfctl_gcp_basic_auth file if your deployment uses username and password.
      • Create your local deployment files:
  1. mkdir -p ${KF_DIR}
  2. cd ${KF_DIR}
  3. kfctl build -V -f ${CONFIG_URI}

Upgrade instructions

Prepare your upgrade specification:

  • Create an upgrade specification in the parent directory of your ${KF_DIR}. For example, to upgradea v0.7.0 deployment to v0.7.1, usethis specification.Your directory structure should look like:
  1. ${PARENT_DIR}
  2. |----${KF_DIR}
  3. |----kfctl_upgrade_spec.yaml
  • Modify the contents of the upgrade specification for your deployment:
  1. apiVersion: kfupgrade.apps.kubeflow.org/v1alpha1
  2. kind: KfUpgrade
  3. metadata:
  4. name: kf-upgrade-v0.7.1
  5. spec:
  6. currentKfDef:
  7. # Replace with the name of your Kubeflow app
  8. name: kubeflow-app
  9. version: v0.7.0
  10. newKfDef:
  11. # Replace with the name of your kubeflow app
  12. name: kubeflow-app
  13. version: v0.7.1
  14. # Replace this with the path to the KfDef that you are upgrading to
  15. baseConfigPath: https://raw.githubusercontent.com/kubeflow/manifests/v0.7-branch/kfdef/kfctl_gcp_iap.0.7.1.yaml

If you don’t need to change any kustomize parameter values in your configuration, run the applycommand now to upgrade your deployment:

  1. kfctl apply -f ${UPGRADE_SPEC} -V

Alternatively you can follow these steps to change the configuration before applying the upgrade:

  • Run a build command:
  1. kfctl build -f ${UPGRADE_SPEC} -V

The above command creates a new Kubeflow application in the same directory, with a namein the form of a 7-character long hash value. The directory structure should look like:

  1. ${PARENT_DIR}
  2. |----${KF_DIR}
  3. |----${UPGRADE_DIR}
  4. |----kfctl_upgrade_spec.yaml

You can examine and change the kustomize parameter values in${UPGRADE_DIR}.

  • Run the apply command to upgrade the deployment:
  1. kfctl apply -f ${UPGRADE_SPEC} -V

Upgrades from earlier versions of Kubeflow

For earlier versions, Kubeflow makes no promises of backwards compatibility orupgradeability. Nonetheless, here are some instructions for updating your deployment:

  • Check your Kubeflow configuration directory (${KF_DIR}) into source controlas a backup.

  • Delete your existing Kubeflow cluster:

  1. kfctl delete -V
  1. tar -xvf kfctl_<release tag>_<platform>.tar.gz
  • Update your kustomize manifests:
  1. export CONFIG_FILE=<the path to your Kubeflow config file>
  2. kfctl build -V -f ${CONFIG_FILE}

The ${CONFIG_FILE} environment variable must contain the path to theKubeflow configuration file in your ${KF_DIR} directory. For example,${KF_DIR}/kfctl_k8s_istio.0.7.1.yaml or ${KF_DIR}/kfctl_existing_arrikto.yaml

  • Re-apply any customizations that you need.

  • Update the deployment:

  1. kfctl apply -V -f ${CONFIG_FILE}

Upgrading Kubeflow Pipelines

See the Kubeflow Pipelines upgrade guide.