Skip to content

Commit

Permalink
feat(docs): install yatai-image-builder-crds
Browse files Browse the repository at this point in the history
  • Loading branch information
yetone committed Jan 5, 2023
1 parent 1f3e57e commit d5af068
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 11 deletions.
3 changes: 1 addition & 2 deletions docs/source/installation/yatai_deployment.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
"""""""""""""""""""""""""""""""""""""""""""
Expand Down
28 changes: 23 additions & 5 deletions docs/source/installation/yatai_image_builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Expand Down Expand Up @@ -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::
Expand Down
62 changes: 58 additions & 4 deletions docs/source/upgrade/yatai-image-builder.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand Down

0 comments on commit d5af068

Please sign in to comment.