automation: Optimize cluster-up time#2
Draft
ormergi wants to merge 3 commits intoAlonaKaplan:mainfrom
Draft
Conversation
06dcec8 to
ebfc4ad
Compare
Creating cluster takes may take long time (10 minutes, depends on connection). The most time consuming operations is pulling cluster components images (e.g.: Kubevirt, Multus) and building OVN-k8s image. Every time the cluster is deleted, all images are discarded and has to be pulled again next time the cluster is created. Setup a local registry that will serve as a cache for the cluster components images. The local registry data is backed by a container volume therefore all images are persisted and will be used next time the cluster is created. 'KIND_LOCAL_REGISTRY_NAME' enviroment variable is set to make 'kind.sh' realize local registry exist and work with it. 'local-kind-registry' parameter is set to make 'kind.sh' configure the cluster to use the local registry. Signed-off-by: Or Mergi <ormergi@redhat.com>
By default, 'kind.sh' script build ovn-k8s container images from sources and deploy ovn-k8s in the cluster. Buiding ovn-k8s from sources takes time and has some less common prequisites (e.g.: Jinja, templating tool). Use OVN-Kubernetes image that is provided by ovn-org/ovn-kubernetes repo [1] instead of building it from sources. The image is pulled (to the local container runtime registry) to enable 'kind.sh' script detect its digest and use it in ovn-k8s manifests, then the image is pushed to the tests local registery to have it persisted. [1] https://github.com/ovn-org/ovn-kubernetes/pkgs/container/ovn-kubernetes%2Fovn-kube-f Signed-off-by: Or Mergi <ormergi@redhat.com>
'kind.sh' script enable deploying Muluts, but there is no control which images will be used, and its not possilbe to use chached images. Once the cluster is deleted the image is discarded and pulled again next time the cluster is created, which is wasteful. Deploy Multus outside 'kind.sh' script, pull the images before creating the cluster and store them in the the local registry. Since the local registry data is backed by a container volume, all images are persisted and will be reused next time the cluster is created. Multus manifest is patched to use the local image tag, stored at the local registry. Export waiting for Kubevirt ready logic to enable deploying Multus & Kubevirt in parallel, optimizing Multus & Kubevirt deployment time. Signed-off-by: Or Mergi <ormergi@redhat.com>
Open
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rebased on #1 (first two commits)
Creating cluster takes may take long time, about 10 minutes (depends on connection).
The most time consuming operations is pulling cluster components images
(e.g.:
Kubevirt,Multus) and building OVN-Kubernetes images.Every time the cluster is deleted, all images are discarded and has to be pulled
again next time the cluster is created.
This PR setup a local registry that serves will serve as a cache for the cluster components images.
persisted and can be reused next time the cluster is created.
This PR also:
Kubevirt andMultus outsidekind.shscript in a way all images are persisted in the local registry.With this PR changes cluster-up time is reduced to about 4 minutes.
[1] https://github.com/ovn-org/ovn-kubernetes/pkgs/container/ovn-kubernetes%2Fovn-kube-f