kyma-project / lifecycle-manager

Controller that manages the lifecycle of Kyma Modules in your cluster.
http://kyma-project.io
Apache License 2.0
10 stars 30 forks source link

[Restricted Market] Support Docker image localization #1858

Open ruanxin opened 1 month ago

ruanxin commented 1 month ago

Description

kyma module in different landscape will use it's transfered container images, in order to support unified deployment, ocm community come up with so called localization concept, and implmented this concept using localization controller.

For Kyma image localization, since all image sources are managed by us internally, we will use a simplified version based on the decision mentioned in ADR

To ensure the Kyma Lifecycle Manager (KLM) can replace localized module images during deployment, all required images must be listed in the Module Operator Deployment Kubernetes resource. All images must be published and signed in the central image registry: europe-docker.pkg.dev/kyma-project/prod

With those precondition, it allow us make localization possible using simple replace machanism.

  1. scan Deployment or StatefulSet yaml, replace all image with europe-docker.pkg.dev/kyma-project/prod/[name]:[tag] to it's related localized image [localized host]/[name]:[tag]
  2. Deploy this modified resource.

Example

New OCM format https://github.com/kyma-project/lifecycle-manager/blob/2342670c9be72df6b33c4cd6ce0d12ccbb65b371/tests/moduletemplates/moduletemplate_template_operator_regular_new_ocm.yaml#L33-L43

In target landscape, this image resource will be replaced to:

resources:
  - access:
      imageReference: [target host]/template-operator:1.0.0
      type: ociArtifact
    digest:
      hashAlgorithm: SHA-256
      normalisationAlgorithm: ociArtifactDigest/v1
      value: 03a194e1dca2421755cec5ec1e946de744407e6e1ca3b671f715fee939e8d1fb
    name: module-image
    relation: external
    type: ociArtifact
    version: 1.0.0

Reasons

Support kyma module deployment in other landscapes.

Acceptance Criteria

Feature Testing

Integration tests, End-to-End tests

Testing approach

No response

Attachments

related issue: https://github.com/kyma-project/lifecycle-manager/issues/1867

janmedrek commented 10 hours ago

Epic: https://github.com/kyma-project/lifecycle-manager/issues/1867