From d5af068a5d430fa989b7177da48a611eeac38c55 Mon Sep 17 00:00:00 2001 From: yetone Date: Thu, 5 Jan 2023 13:25:01 +0000 Subject: [PATCH] feat(docs): install yatai-image-builder-crds --- docs/source/installation/yatai_deployment.rst | 3 +- .../installation/yatai_image_builder.rst | 28 +++++++-- docs/source/upgrade/yatai-image-builder.rst | 62 +++++++++++++++++-- 3 files changed, 82 insertions(+), 11 deletions(-) diff --git a/docs/source/installation/yatai_deployment.rst b/docs/source/installation/yatai_deployment.rst index a0e1654b..f0731599 100644 --- a/docs/source/installation/yatai_deployment.rst +++ b/docs/source/installation/yatai_deployment.rst @@ -387,8 +387,7 @@ The output of the command above should look something like this: --set dockerRegistry.password=$DOCKER_REGISTRY_PASSWORD \ --set dockerRegistry.secure=$DOCKER_REGISTRY_SECURE \ --set dockerRegistry.bentoRepositoryName=$DOCKER_REGISTRY_BENTO_REPOSITORY_NAME \ - --set layers.network.ingressClass=$INGRESS_CLASS \ - --skip-crds + --set layers.network.ingressClass=$INGRESS_CLASS 4. Verify the yatai-deployment installation """"""""""""""""""""""""""""""""""""""""""" diff --git a/docs/source/installation/yatai_image_builder.rst b/docs/source/installation/yatai_image_builder.rst index 94f084d4..ccf04591 100644 --- a/docs/source/installation/yatai_image_builder.rst +++ b/docs/source/installation/yatai_image_builder.rst @@ -211,7 +211,7 @@ Installation Steps Store the :code:`repositoryArn` returned by the command for later use. - 4. Create an IAM policy for ECR push access for the bento image builder pod of yatai-deployment + 4. Create an IAM policy for ECR push access for the bento image builder pod of yatai-image-builder Create a file named :code:`yatai-image-builder-pod-ecr-policy.json` with the following content: @@ -430,12 +430,31 @@ Installation Steps 4. Install yatai-image-builder ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -1. Install yatai-image-builder CRDs +1. Install yatai-image-builder-crds """"""""""""""""""""""""""""""""""" .. code:: bash - kubectl apply --server-side -f https://raw.githubusercontent.com/bentoml/yatai-image-builder/main/helm/yatai-image-builder/crds/bentorequest.yaml + helm upgrade --install yatai-image-builder-crds yatai-image-builder-crds \ + --repo https://bentoml.github.io/helm-charts \ + -n yatai-image-builder + +.. warning:: + + If you encounter error like this: + + .. code:: bash + + Error: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "bentodeployments.serving.yatai.ai" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "yatai-image-builder-crds"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "yatai-image-builder" + + It means you already have BentoDeployment CRD, you should use this command to fix it: + + .. code:: bash + + kubectl label crd bentodeployments.serving.yatai.ai app.kubernetes.io/managed-by=Helm + kubectl annotate crd bentodeployments.serving.yatai.ai meta.helm.sh/release-name=yatai-image-builder-crds meta.helm.sh/release-namespace=yatai-image-builder + + Then reinstall the ``yatai-image-builder-crds``. 2. Verify that the CRDs of yatai-image-builder has been established """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" @@ -465,8 +484,7 @@ The output of the command above should look something like this: --set dockerRegistry.username=$DOCKER_REGISTRY_USERNAME \ --set dockerRegistry.password=$DOCKER_REGISTRY_PASSWORD \ --set dockerRegistry.secure=$DOCKER_REGISTRY_SECURE \ - --set dockerRegistry.bentoRepositoryName=$DOCKER_REGISTRY_BENTO_REPOSITORY_NAME \ - --skip-crds + --set dockerRegistry.bentoRepositoryName=$DOCKER_REGISTRY_BENTO_REPOSITORY_NAME .. note:: diff --git a/docs/source/upgrade/yatai-image-builder.rst b/docs/source/upgrade/yatai-image-builder.rst index 7331ece9..cc48c875 100644 --- a/docs/source/upgrade/yatai-image-builder.rst +++ b/docs/source/upgrade/yatai-image-builder.rst @@ -12,8 +12,62 @@ Prerequisites Upgrade Steps ------------- -1. Check current version -^^^^^^^^^^^^^^^^^^^^^^^^ +1. Check yatai-image-builder-crds current version +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. code-block:: bash + + helm list -f "^yatai-image-builder-crds$" -A + +You should see something like this: + +.. code-block:: bash + + NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION + yatai-image-builder-crds yatai-image-builder 1 2023-01-03 13:03:02.783856038 +0000 UTC deployed yatai-image-builder-crds-1.1.0-d12 1.1.0-d12 + +As you can see, the current version is ``1.1.0-d12``. + +2. Upgrade yatai-image-builder-crds to the target version +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you want to upgrade to ``1.1.0-d13``, you can run the following command: + +.. warning:: + + If the minor version of the target version is different from the current version, you need to skip this step and follow the migration guide to complete this upgrade. + +.. note:: + + If your release name is not ``yatai-image-builder-crds``, you need to replace ``yatai-image-builder-crds`` with your release name in the following command. + If your namespace is not ``yatai-image-builder``, you need to replace ``yatai-image-builder`` with your namespace in the following command. + +.. code-block:: bash + + helm upgrade yatai-image-builder-crds yatai-image-builder-crds \ + --repo https://bentoml.github.io/helm-charts \ + --version 1.1.0-d13 \ + --namespace yatai-image-builder + +.. warning:: + + If you encounter error like this: + + .. code:: bash + + Error: rendered manifests contain a resource that already exists. Unable to continue with install: CustomResourceDefinition "bentodeployments.serving.yatai.ai" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key "app.kubernetes.io/managed-by": must be set to "Helm"; annotation validation error: missing key "meta.helm.sh/release-name": must be set to "yatai-image-builder-crds"; annotation validation error: missing key "meta.helm.sh/release-namespace": must be set to "yatai-image-builder" + + It means you already have BentoDeployment CRD, you should use this command to fix it: + + .. code:: bash + + kubectl label crd bentodeployments.serving.yatai.ai app.kubernetes.io/managed-by=Helm + kubectl annotate crd bentodeployments.serving.yatai.ai meta.helm.sh/release-name=yatai-image-builder-crds meta.helm.sh/release-namespace=yatai-image-builder + + Then upgrade the ``yatai-image-builder-crds`` again. + +3. Check yatai-image-builder current version +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. code-block:: bash @@ -28,8 +82,8 @@ You should see something like this: As you can see, the current version is ``1.1.0-d12``. -2. Upgrade to the target version -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +4. Upgrade yatai-image-builder to the target version +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you want to upgrade to ``1.1.0-d13``, you can run the following command: