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

unify image pull policy by helm to be same as other installation method #4313

Merged
merged 1 commit into from
Nov 26, 2023

Conversation

chaosi-zju
Copy link
Member

@chaosi-zju chaosi-zju commented Nov 23, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

  • unify image pull policy by helm to be same as other installation method
  • reduced installation time if images are ready

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

TestReport:

I tested it by the commit of #4307, it haven't merged, so the latest karmada image doesn't have this feature.
Then I build it locally and helm installed by the script in #4045 (notes that this script load local image to kind in advance, if after installation the karmada support #4307 feature, means pullPolicy: IfNotPresent works).

here is the result:

➜  karmada git:(feat-gpu) ✗ hack/local-up-karmada-helm.sh
Creating cluster "karmada-host" ...
Context "kind-karmada-host" renamed to "karmada-host".
Cluster "kind-karmada-host" set.
cluster "karmada-host" is created successfully!
You can now use your cluster with:
kubectl cluster-info --context karmada-host --kubeconfig /Users/chaosi/.kube/karmada-host.config
Creating cluster "member2" ...
Context "kind-member2" renamed to "member2".
Cluster "kind-member2" set.
cluster "member2" is created successfully!
You can now use your cluster with:
kubectl cluster-info --context member2 --kubeconfig /Users/chaosi/.kube/members.config
kubeconfig file is existed, new config will append to it.
Creating cluster "member3" ...
Context "kind-member3" renamed to "member3".
Cluster "kind-member3" set.
cluster "member3" is created successfully!
You can now use your cluster with:
kubectl cluster-info --context member3 --kubeconfig /Users/chaosi/.kube/members.config
kubeconfig file is existed, new config will append to it.
Creating cluster "member1" ...
Context "kind-member1" renamed to "member1".
Cluster "kind-member1" set.
cluster "member1" is created successfully!
You can now use your cluster with:
kubectl cluster-info --context member1 --kubeconfig /Users/chaosi/.kube/members.config
########## start installing karmada control plane ##########
Image: "docker.io/cfssl/cfssl:latest" with ID "sha256:26481dbb191497260dc29de99397340a500bcdfff4ae6e9b7a496420903e9b64" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/bitnami/kubectl:latest" with ID "sha256:49241ca0d2ce971a959f934925180028d3aa0ae74cf4c9337f1b93e66fd08ac1" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/karmada/karmada-scheduler:latest" with ID "sha256:8b161bb65e0dfe779b2ba826caaa98dc58347f47c0ba96e88911c6c1be62be1e" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/karmada/karmada-webhook:latest" with ID "sha256:1c433355464bdcc352251c806bf6c0140bcc4e3d437034e4d98a89d2c2d6da55" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/karmada/karmada-controller-manager:latest" with ID "sha256:bf36ee44ce0f73a36f4d52572ee71395d60118478bdf03a208e443e1adb6e7d9" not yet present on node "karmada-host-control-plane", loading...
Image: "registry.k8s.io/kube-apiserver:v1.25.4" with ID "sha256:00631e54acba3a4d507a9f7b7095a81151b8a8f909f93e50f64269ea39daf2cf" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/karmada/karmada-aggregated-apiserver:latest" with ID "sha256:1f108e74c0aacb461df2e0938fff8e61428a2d6cdc20bfd19e16b328f99c72a3" not yet present on node "karmada-host-control-plane", loading...
Image: "registry.k8s.io/kube-controller-manager:v1.25.4" with ID "sha256:8f59f6dfaed60b6613fdb2b50a9dd31584e52f56513b01ce4bb779da5ee0cbd1" not yet present on node "karmada-host-control-plane", loading...
Image: "registry.k8s.io/etcd:3.5.9-0" with ID "sha256:73deb9a3f702532592a4167455f8bf2e5f5d900bcc959ba2fd2d35c321de1af9" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/karmada/karmada-agent:latest" with ID "sha256:25f529d2b068705a706bbc2cbf9522daa306f1df984315417f415c427b47b2fe" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/karmada/karmada-scheduler-estimator:latest" with ID "sha256:65bce7581fea47b47b48965ecab906f30f5632357d936dcbd53deb185ac5b295" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/karmada/karmada-descheduler:latest" with ID "sha256:ed4c6c4131f5e47e25347b9b7df20b58847c164ff3ac385ae2fbf1d9e2fed2e1" not yet present on node "karmada-host-control-plane", loading...
Image: "docker.io/karmada/karmada-search:latest" with ID "sha256:cc23d133ae9e840fd762318fc29a2fa236cf40133b86d0e0b5ba9838e4a12069" not yet present on node "karmada-host-control-plane", loading...
NAME: karmada
LAST DEPLOYED: Thu Nov 23 21:55:04 2023
NAMESPACE: karmada-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
########## end installing karmada control plane success ##########
########## start deploying member clusters ##########
Image: "docker.io/karmada/karmada-agent:latest" with ID "sha256:25f529d2b068705a706bbc2cbf9522daa306f1df984315417f415c427b47b2fe" not yet present on node "member3-control-plane", loading...
cluster(member1) is joined successfully
cluster(member2) is joined successfully
NAME: karmada-agent
LAST DEPLOYED: Thu Nov 23 21:56:44 2023
NAMESPACE: karmada-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
########## end deploying member clusters success ##########
waiting for member clusters ready...
waiting for member clusters ready...
waiting for member clusters ready...
NAME      VERSION   MODE   READY   AGE   APIENDPOINT
member1   v1.27.3   Push   True    12s   https://172.18.0.6:6443
member2   v1.27.3   Push   True    8s    https://172.18.0.3:6443
member3   v1.27.3   Pull   True    2s    

Then I tested whether karmada supports extension resource:

➜  ~ for cluster in "member1" "member2"; do
  kubectl --context karmada-apiserver patch cluster ${cluster} -n karmada-system --type='json' -p '[
      {"op": "add", "path": "/spec/resourceModels/0/ranges/-", "value": {"name": "karmada.io/gpu", "min": "0", "max": "4"}},
      {"op": "add", "path": "/spec/resourceModels/1/ranges/-", "value": {"name": "karmada.io/gpu", "min": "4", "max": "8"}},
      {"op": "add", "path": "/spec/resourceModels/2/ranges/-", "value": {"name": "karmada.io/gpu", "min": "8", "max": "12"}},
      {"op": "add", "path": "/spec/resourceModels/3/ranges/-", "value": {"name": "karmada.io/gpu", "min": "12", "max": "16"}},
      {"op": "add", "path": "/spec/resourceModels/4/ranges/-", "value": {"name": "karmada.io/gpu", "min": "16", "max": "20"}},
      {"op": "add", "path": "/spec/resourceModels/5/ranges/-", "value": {"name": "karmada.io/gpu", "min": "20", "max": "24"}},
      {"op": "add", "path": "/spec/resourceModels/6/ranges/-", "value": {"name": "karmada.io/gpu", "min": "24", "max": "28"}},
      {"op": "add", "path": "/spec/resourceModels/7/ranges/-", "value": {"name": "karmada.io/gpu", "min": "28", "max": "32"}},
      {"op": "add", "path": "/spec/resourceModels/8/ranges/-", "value": {"name": "karmada.io/gpu", "min": "32", "max": "9223372036854775807"}},
  ]'
done
cluster.cluster.karmada.io/member1 patched
cluster.cluster.karmada.io/member2 patched

you can see cluster.cluster.karmada.io/member1 patched, so it works

Does this PR introduce a user-facing change?:

none

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Nov 23, 2023
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 23, 2023
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (5b8a7f7) 52.00% compared to head (d7ac853) 52.01%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4313   +/-   ##
=======================================
  Coverage   52.00%   52.01%           
=======================================
  Files         242      242           
  Lines       23993    23993           
=======================================
+ Hits        12478    12480    +2     
+ Misses      10834    10832    -2     
  Partials      681      681           
Flag Coverage Δ
unittests 52.01% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chaosi-zju
Copy link
Member Author

Test report added CC @RainbowMango

@jwcesign
Copy link
Member

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 24, 2023
@zhzhuang-zju
Copy link
Contributor

/lgtm

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

/approve

@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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 26, 2023
@karmada-bot karmada-bot merged commit 1c10def into karmada-io:master Nov 26, 2023
13 checks passed
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants