zncdatadev / trino-operator

Operator for Trino, the distributed SQL query engine for big data
Apache License 2.0
3 stars 5 forks source link

[Feature]: Product image selection #120

Open whg517 opened 3 months ago

whg517 commented 3 months ago

Duplicates

I have searched the existing issues

Summary 💡

Select an appropriate image and correct deployment logic based on the image tag design rules and compatibility with operator.

trace:

Examples 🌈

backgeound: Current kubedoop version is 0.1.0 and we have already adapted trino 450, and 450 is recommonded for this version.

glance

image:
    # custom: my.repo.company.org/trino:450    # when use custom repository, please set image with tag
    repo: quay.io/zncdatadev       # This is official image repository
    productVersion: 450          # The version is trino in image
    kubedoopVersion: 0.1.0                # This is kubedoop version

CASE-1

# nothing

==

image:
    repo: quay.io/zncdatadev
    productVersion: 450
    kubedoopVersion: 0.1.0

Use the official repository and the current kubedoop version, and select the best product version to compose the final image: quay.io/zncdatadev/trino:450-kubedoop0.1.0

CASE-2

image:
    productVersion: 455

==

image:
    repo: quay.io/zncdatadev
    productVersion: 455
    kubedoopVersion: 0.1.0

Using the official repository and the current kubedoop version, using the specified product version 455, compose the final image: quay.io/zncdatadev/trino:455-kubedoop0.1.0

⚠️Note: If this image does not exists in the official repository, the service cannot be deployed successfully. If the current version of kubedoop 0.1.0 does not support the specified product version 455, operator throws an exception and does not create the deployment resource.

CASE-3

image:
    repo: my.repo.company.org/zncdatadev

==

image:
    repo: my.repo.company.org/zncdatadev
    productVersion: 450
    kubedoopVersion: 0.1.0

If you proxy the official repository, you can specify your own repository using the repo. The image tag rules in the custom repository MUST be the same as those in the official repository, otherwise an Image cannot be found error may occur. Compose the final image: my.repo.company.org/zncdatadev/trino:450-kubedoop0.1.0

CASE-4

image:
    custom: my.repo.company.org/trino:450
    productVersion: 450   # When use custom repository, productVersion is MUST be set
    # kubedoopVersion: 0.1.0       # In custom, this value will ignore

==

image:
    custom: my.repo.company.org/trino:450
    productVersion: 450

With a custom Image, you must specify the product version in the Image to tell the operator what logic to use to deploy it. Compose the final image: my.repo.company.org/trino:450

⚠️Note: If no product version is specified when using a custom image, an exception is thrown and no resource is created.

Other-CASE

image:
    kubedoopVersion: 0.1.0

If the final image quay.io/zncdatadev/trino:450-kubedoop0.1.0 done not exist, the deployed resource will fail.

image:
    custom: my.repo.company.org/trino:450
    productVersion: 455

The trino version productVersion: 455 received by the operator does not match the trino version my.repo.company.org/trino:450 in the customized image. As a result, the configurations created by the operator for the trino may be incorrect. So, unknown problems such as service exceptions or trino startup failures may occur.

Motivation 🔦

No response