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

support config karmada components resources #4059

Conversation

wawa0210
Copy link
Member

@wawa0210 wawa0210 commented Sep 13, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

The karmada operator does not support users to explicitly set the resource scale of each component. But resource planning will be different in different scenarios, so we can provide explicit configuration

Which issue(s) this PR fixes:
from #3732 (comment)

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

`karmada-operator`: Support config required resources for each Karmada component.

Test Results

karmada instance yaml with resources config

apiVersion: operator.karmada.io/v1alpha1
kind: Karmada
metadata:
  name: karmada-demo
  namespace: test
spec:
  components:
    etcd:
      local:
        imageRepository: k8s.m.daocloud.io/etcd
        imageTag: 3.5.9-0
        replicas: 1
        resources:
          requests:
            cpu: 216m
    karmadaMetricsAdapter:
      resources:
        requests:
          cpu: 111m
    karmadaAPIServer:
      imageRepository: k8s.m.daocloud.io/kube-apiserver
      imageTag: v1.25.4
      replicas: 1
      serviceType: NodePort
      serviceSubnet: 10.96.0.0/12
      resources:
        requests:
          cpu: 276m
    karmadaAggregatedAPIServer:
      imageRepository: docker.io/karmada/karmada-aggregated-apiserver
      imageTag: v1.6.0
      replicas: 1
      resources:
        requests:
          cpu: 279m
    karmadaControllerManager:
      imageRepository: docker.io/karmada/karmada-controller-manager
      imageTag: v1.6.0
      replicas: 1
      resources:
        requests:
          cpu: 290m
    karmadaScheduler:
      imageRepository: docker.io/karmada/karmada-scheduler
      imageTag: v1.6.0
      replicas: 1
      resources:
        requests:
          cpu: 370m
    karmadaWebhook:
      imageRepository: docker.io/karmada/karmada-webhook
      imageTag: v1.6.0
      replicas: 1
      resources:
        requests:
          cpu: 470m
    kubeControllerManager:
      imageRepository: k8s.m.daocloud.io/kube-controller-manager
      imageTag: v1.25.4
      replicas: 1
      resources:
        requests:
          cpu: 550m

actual effect

➜  karmada git:(support-config-karmada-component-resources) ✗ kubectl get karmada -n test
NAME            READY   AGE
karmada-demo   True    27m


➜  karmada git:(support-config-karmada-component-resources) ✗ kubectl get po -n test  -w
NAME                                                     READY   STATUS    RESTARTS   AGE
karmada-demo-aggregated-apiserver-f4b494875-5xwkf       1/1     Running   0          24m
karmada-demo-apiserver-579bd4875f-26bpn                 1/1     Running   0          25m
karmada-demo1-controller-manager-5f5fb98c4-448lc         1/1     Running   0          24m
karmada-demo-etcd-0                                     1/1     Running   0          25m
karmada-demo-kube-controller-manager-5b8bfdd9fd-psbq7   1/1     Running   0          24m
karmada-demo-metrics-adapter-98dbbdc79-4djc5            1/1     Running   0          24m
karmada-demo-metrics-adapter-98dbbdc79-xbhwq            1/1     Running   0          24m
karmada-demo-scheduler-bf6fc95c5-tz2q6                  1/1     Running   0          24m
karmada-demo-webhook-84d87598d6-xtlmq                   1/1     Running   0          24m

# grep the resources(The number is consistent with the number of karmada instance components)

➜  karmada git:(support-config-karmada-component-resources) ✗ kubectl get po -n test  -o yaml | grep -A 2 resources
      resources:
        requests:
          cpu: 279m
--
      resources:
        requests:
          cpu: 276m
--
      resources:
        requests:
          cpu: 290m
--
      resources:
        requests:
          cpu: 216m
--
      resources:
        requests:
          cpu: 550m
--
      resources:
        requests:
          cpu: 111m
--
      resources:
        requests:
          cpu: 111m
--
      resources:
        requests:
          cpu: 370m
--
      resources:
        requests:
          cpu: 470m

@karmada-bot karmada-bot added the kind/feature Categorizes issue or PR as related to a new feature. label Sep 13, 2023
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 13, 2023
@wawa0210 wawa0210 changed the title [draft] support config karmada components resources [DRAFT] support config karmada components resources Sep 13, 2023
@wawa0210 wawa0210 force-pushed the support-config-karmada-component-resources branch from 0aec7ee to 68b53da Compare September 13, 2023 10:21
@wawa0210 wawa0210 force-pushed the support-config-karmada-component-resources branch from 68b53da to a20e8de Compare September 13, 2023 10:39
@codecov-commenter
Copy link

codecov-commenter commented Sep 13, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.02% 🎉

Comparison is base (244c73c) 53.82% compared to head (3d7619d) 53.84%.
Report is 4 commits behind head on master.

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

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4059      +/-   ##
==========================================
+ Coverage   53.82%   53.84%   +0.02%     
==========================================
  Files         231      231              
  Lines       23013    23013              
==========================================
+ Hits        12386    12391       +5     
+ Misses       9954     9950       -4     
+ Partials      673      672       -1     
Flag Coverage Δ
unittests 53.84% <ø> (+0.02%) ⬆️

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

see 2 files with indirect coverage changes

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

@wawa0210 wawa0210 changed the title [DRAFT] support config karmada components resources support config karmada components resources Sep 14, 2023
@calvin0327
Copy link

It looks good. @jwcesign @RainbowMango PTAL

/lgtm

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 14, 2023
@RainbowMango
Copy link
Member

Just noticed that you are using your Chinese name in your commit:

Author: 张潇 <[email protected]>
Date:   Wed Sep 13 18:09:23 2023 +0800

    support config karmada components resources

    Signed-off-by: 张潇 <[email protected]>

I'm not sure if GitHub or CNCF tools could count your contribution. This is concerning.

@wawa0210 wawa0210 force-pushed the support-config-karmada-component-resources branch from a20e8de to f916596 Compare September 15, 2023 03:54
@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2023
@wawa0210 wawa0210 force-pushed the support-config-karmada-component-resources branch 2 times, most recently from c7eea2c to 845b31a Compare September 15, 2023 04:01
@wawa0210
Copy link
Member Author

Just noticed that you are using your Chinese name in your commit:

Author: 张潇 <[email protected]>
Date:   Wed Sep 13 18:09:23 2023 +0800

    support config karmada components resources

    Signed-off-by: 张潇 <[email protected]>

I'm not sure if GitHub or CNCF tools could count your contribution. This is concerning.

I recently changed my computer and I checked and it shouldn't be affected. I revised it again, thx

@wawa0210 wawa0210 force-pushed the support-config-karmada-component-resources branch from 845b31a to 3d7619d Compare September 15, 2023 08:24
@wawa0210 wawa0210 force-pushed the support-config-karmada-component-resources branch from 3d7619d to ab1900f Compare September 15, 2023 08:48
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.

/lgtm
/approve

Thanks.

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 15, 2023
@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 Sep 15, 2023
@karmada-bot karmada-bot merged commit be9a371 into karmada-io:master Sep 15, 2023
11 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.

5 participants