Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reduce the size of KubeKey artifact #1160

Merged
merged 1 commit into from
Apr 2, 2022
Merged

Conversation

24sama
Copy link
Collaborator

@24sama 24sama commented Mar 30, 2022

What type of PR is this?

/kind feature
/kind api-change

What this PR does / why we need it:

Reduce the size of the KubeKey artifact. This PR makes kk use github.com/containers/image to pull images and store these images in OCI format. This allows, in a certain degree, reuse of the base image layer. When we use kk to push images, the kk re-tag images as xxx-arch[-variant] (e.g. xxx-amd64, xxx-arm-v7) and also use this package to copy images to a private registry, after that the kk use github.com/estesp/manifest-tool to push manifest-lists with the original tag of the images.

Which issue(s) this PR fixes:

Fixes #1139

Special notes for reviewers:

Does this PR introduced a user-facing change?

Breaking Change
The next release of KubeKey could not support using the old KubeKey artifact.
Because of the change in image store format, the KubeKey artifact must be re-export by kk.

Additional documentation, usage docs, etc.:


@ks-ci-bot ks-ci-bot added kind/feature Categorizes issue or PR as related to a new feature. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Mar 30, 2022
@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: 24sama

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot ks-ci-bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 30, 2022
@24sama
Copy link
Collaborator Author

24sama commented Mar 30, 2022

/cc @kubesphere/sig-installation

@ks-ci-bot ks-ci-bot requested a review from a team March 30, 2022 01:30
@pixiake pixiake added this to To do in kubekey v2.1 via automation Mar 31, 2022
@pixiake pixiake moved this from To do to In progress in kubekey v2.1 Mar 31, 2022
Signed-off-by: 24sama <jacksama@foxmail.com>
@pixiake
Copy link
Collaborator

pixiake commented Apr 2, 2022

/lgtm

@ks-ci-bot ks-ci-bot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2022
@ks-ci-bot
Copy link
Collaborator

LGTM label has been added.

Git tree hash: 858c445f8579996c282723cd7f72216efd9f214b

@ks-ci-bot ks-ci-bot merged commit 3ba273e into kubesphere:master Apr 2, 2022
kubekey v2.1 automation moved this from In progress to Done Apr 2, 2022
@liulangwa
Copy link

liulangwa commented Aug 3, 2022

这个提交导致无法往http的镜像源推送镜像

kk artifact image push -f config-ks.yaml -y

error: Pipeline[ArtifactImagesPushPipeline] execute failed: Module[CopyImagesToRegistryModule] exec failed: 
failed: [LocalHost] [CopyImagesToRegistry] exec failed after 1 retires: copy image oci:/alex/kubekey/images:kubesphereio:cni:v3.23.2-amd64 to docker://docker.xxx.cn:60001/kube-vnet/kubesphereio/cni:v3.23.2-amd64 failed: trying to reuse blob sha256:a33c29efa196200d3373d4a355138a10786be4a6db0baac21553064cdc30f79a at destination: pinging container registry docker.ctyun.cn:60001: Get "https://docker.ctyun.cn:60001/v2/": http: server gave HTTP response to HTTPS client

@24sama
Copy link
Collaborator Author

24sama commented Aug 3, 2022

这个提交导致无法往http的镜像源推送镜像


kk artifact image push -f config-ks.yaml -y



error: Pipeline[ArtifactImagesPushPipeline] execute failed: Module[CopyImagesToRegistryModule] exec failed: 

failed: [LocalHost] [CopyImagesToRegistry] exec failed after 1 retires: copy image oci:/alex/kubekey/images:kubesphereio:cni:v3.23.2-amd64 to docker://docker.xxx.cn:60001/kube-vnet/kubesphereio/cni:v3.23.2-amd64 failed: trying to reuse blob sha256:a33c29efa196200d3373d4a355138a10786be4a6db0baac21553064cdc30f79a at destination: pinging container registry docker.ctyun.cn:60001: Get "https://docker.ctyun.cn:60001/v2/": http: server gave HTTP response to HTTPS client



I guess you maybe used the old configure method cause this PR is a breaking changes.
Here is the latest:


registry:
    registryMirrors: []
    insecureRegistries: []
    privateRegistry: ""
    namespaceOverride: ""
    auths: # if docker add by `docker login`, if containerd append to `/etc/containerd/config.toml`
      "dockerhub.kubekey.local":
        username: "xxx"
        password: "***"
        skipTLSVerify: false # Allow contacting registries over HTTPS with failed TLS verification.
        plainHTTP: false # Allow contacting registries over HTTP.
        certsPath: "/etc/docker/certs.d/dockerhub.kubekey.local" 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Reduce the size of KubeKey artifact
4 participants