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

introduce --private-image-registry flag to karmadactl init #2655

Merged

Conversation

helen-frank
Copy link
Contributor

@helen-frank helen-frank commented Oct 18, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it:
At present, it is mainly used for offline installation karmada to simplify installation commands.
Which issue(s) this PR fixes:
Fixes #
Port of #2541
Special notes for your reviewer:
Test

# go run cmd/karmadactl/karmadactl.go init --image-registry=xxx/xxx --crds /root/crds.tar.gz
I1019 00:34:22.710879 1942695 deploy.go:188] kubeconfig file: /root/.kube/config, kubernetes: https://10.29.12.229:44230
I1019 00:34:22.732691 1942695 deploy.go:208] karmada apiserver ip: [172.18.0.4]
I1019 00:34:23.492457 1942695 cert.go:229] Generate ca certificate success.
I1019 00:34:23.695980 1942695 cert.go:229] Generate karmada certificate success.
I1019 00:34:24.011098 1942695 cert.go:229] Generate apiserver certificate success.
I1019 00:34:24.497476 1942695 cert.go:229] Generate front-proxy-ca certificate success.
I1019 00:34:24.798200 1942695 cert.go:229] Generate front-proxy-client certificate success.
I1019 00:34:25.060485 1942695 cert.go:229] Generate etcd-ca certificate success.
I1019 00:34:25.309735 1942695 cert.go:229] Generate etcd-server certificate success.
I1019 00:34:25.391543 1942695 cert.go:229] Generate etcd-client certificate success.
...
------------------------------------------------------------------------------------------------------
 █████   ████   █████████   ███████████   ██████   ██████   █████████   ██████████     █████████
░░███   ███░   ███░░░░░███ ░░███░░░░░███ ░░██████ ██████   ███░░░░░███ ░░███░░░░███   ███░░░░░███
 ░███  ███    ░███    ░███  ░███    ░███  ░███░█████░███  ░███    ░███  ░███   ░░███ ░███    ░███
 ░███████     ░███████████  ░██████████   ░███░░███ ░███  ░███████████  ░███    ░███ ░███████████
 ░███░░███    ░███░░░░░███  ░███░░░░░███  ░███ ░░░  ░███  ░███░░░░░███  ░███    ░███ ░███░░░░░███
 ░███ ░░███   ░███    ░███  ░███    ░███  ░███      ░███  ░███    ░███  ░███    ███  ░███    ░███
 █████ ░░████ █████   █████ █████   █████ █████     █████ █████   █████ ██████████   █████   █████
░░░░░   ░░░░ ░░░░░   ░░░░░ ░░░░░   ░░░░░ ░░░░░     ░░░░░ ░░░░░   ░░░░░ ░░░░░░░░░░   ░░░░░   ░░░░░
------------------------------------------------------------------------------------------------------
Karmada is installed successfully.

Register Kubernetes cluster to Karmada control plane.

Register cluster with 'Push' mode

Does this PR introduce a user-facing change?:

`karmadactl`: `init` add `--image-registry` flags

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 18, 2022
@karmada-bot karmada-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 18, 2022
@helen-frank helen-frank changed the title add image-registry karmadactl int add image-registry flags Oct 18, 2022
@helen-frank helen-frank changed the title karmadactl int add image-registry flags karmadactl init add image-registry flags Oct 18, 2022
@helen-frank
Copy link
Contributor Author

swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-controller-manager:v1.3.0
swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-scheduler:v1.3.0
swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-webhook:v1.3.0
swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-aggregated-apiserver:v1.3.0
docker.io/alpine:3.15.1
registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.3-0
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.25.2
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.25.2

Currently testing image-registry needs to push these images into the image repository.

@helen-frank
Copy link
Contributor Author

swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-controller-manager:v1.3.0
swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-scheduler:v1.3.0
swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-webhook:v1.3.0
swr.ap-southeast-1.myhuaweicloud.com/karmada/karmada-aggregated-apiserver:v1.3.0
docker.io/alpine:3.15.1
registry.cn-hangzhou.aliyuncs.com/google_containers/etcd:3.5.3-0
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver:v1.25.2
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager:v1.25.2

Currently testing image-registry needs to push these images into the image repository.

I will develop image-tag after this pr (tentative name)

@helen-frank
Copy link
Contributor Author

helen-frank commented Oct 19, 2022

For quick testing, I have provided a mirror warehouse here.

./karmadactl init --image-registry=daocloud.io/atsctoo

@lonelyCZ
Copy link
Member

Thanks for your contribute. I will review it!

/assign

releaseVer = &version.ReleaseVersion{} // initialize to avoid panic
}
// image registry
flags.StringVarP(&opts.ImageRegistry, "image-registry", "", "", "Image registry.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add more detail description for image-registry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image registry. Registry containing karmada all image

Whether such a description is readable ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, you can look up and refer other projects. Then we can compare and determine a good description.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good.

cc @RainbowMango

pkg/karmadactl/cmdinit/kubernetes/deploy.go Outdated Show resolved Hide resolved
@karmada-bot karmada-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Oct 31, 2022
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Oct 31, 2022
@helen-frank
Copy link
Contributor Author

export karmada_registry="harbor.xxx.xx/xxx"

karmadactl init --etcd-image=$karmada_registry/etcd:3.5.3-0 \
--etcd-init-image=$karmada_registry/alpine:3.15.1 \
--karmada-aggregated-apiserver-image=$karmada_registry/karmada-aggregated-apiserver:v1.3.1 \
--karmada-apiserver-image=$karmada_registry/kube-apiserver:v1.18.20 \
--karmada-controller-manager-image=$karmada_registry/karmada-controller-manager:v1.3.1 \
--karmada-kube-controller-manager-image=$karmada_registry/kube-controller-manager:v1.18.20 \
--karmada-scheduler-image=$karmada_registry/karmada-scheduler:v1.3.1 \
--karmada-webhook-image=$karmada_registry/karmada-webhook:v1.3.1 \
--crds=./crds.tar.gz

In yesterday's document, I need to give the command of karmada offline installation, which makes me a little painful.🥲
/cc @RainbowMango

@helen-frank
Copy link
Contributor Author

/cc @RainbowMango

@RainbowMango
Copy link
Member

@lonelyCZ Do you have any other comments?

@lonelyCZ
Copy link
Member

lonelyCZ commented Nov 7, 2022

Looks good, I will test it in my env today.

@lonelyCZ
Copy link
Member

lonelyCZ commented Nov 7, 2022

Hi, @helen-frank could you please help to resolve the conflicts? I will test it ASAP.

@karmada-bot karmada-bot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. do-not-merge/contains-merge-commits Indicates a PR which contains merge commits. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 7, 2022
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 15, 2022
@helen-frank helen-frank requested review from RainbowMango and lonelyCZ and removed request for carlory, prodanlabs, RainbowMango and lonelyCZ November 15, 2022 14:11
@RainbowMango
Copy link
Member

Generally looks good to me. But I didn't test it on my side.
Leave approval to @lonelyCZ

@lonelyCZ
Copy link
Member

It works fine in my env. :)

Thanks @helen-frank

/lgtm
/approve

And please update Does this PR introduce a user-facing change? in this PR.

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 16, 2022
@RainbowMango
Copy link
Member

/retitle introduce --private-image-registry flag to karmadactl init

@karmada-bot karmada-bot changed the title karmadactl init add image-registry flags introduce --private-image-registry flag to karmadactl init Nov 17, 2022
@RainbowMango
Copy link
Member

In addition to the release notes that @lonelyCZ asked for above, please also update the PR descriptions as per the latest content.

@helen-frank
Copy link
Contributor Author

OK, I rested earlier yesterday and updated it immediately.

Signed-off-by: helen <haitao.zhang@daocloud.io>
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2022
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lonelyCZ

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2022
@lonelyCZ
Copy link
Member

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2022
@karmada-bot karmada-bot merged commit 9a4a668 into karmada-io:master Nov 17, 2022
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/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants