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

feat: Add script to deploy k8s metrics-server in member cluster #3650

Merged
merged 1 commit into from
Jun 20, 2023

Conversation

jwcesign
Copy link
Member

@jwcesign jwcesign commented Jun 8, 2023

What type of PR is this?
/kind feature

What this PR does / why we need it:
When using FederatedHPA, metrics-server needs to be installed in member clusters.
So we provider a script to install metrics-server in member cluster conveniently.

Which issue(s) this PR fixes:
Fixes #none

Special notes for your reviewer:
Testing report:

root@karmada [02:38:05 PM] [~/workspace/git/karmada] [install-script *]
-> # k get pods -A
NAMESPACE            NAME                                            READY   STATUS    RESTARTS   AGE
karmada-system       karmada-agent-648c99647-qvkf5                   1/1     Running   0          3d23h
karmada-system       karmada-agent-648c99647-tfw2m                   1/1     Running   0          3d23h
kube-system          coredns-787d4945fb-9pfm2                        1/1     Running   0          3d23h
kube-system          coredns-787d4945fb-mx9w5                        1/1     Running   0          3d23h
kube-system          etcd-member3-control-plane                      1/1     Running   0          3d23h
kube-system          kindnet-8r4qt                                   1/1     Running   0          3d23h
kube-system          kube-apiserver-member3-control-plane            1/1     Running   0          3d23h
kube-system          kube-controller-manager-member3-control-plane   1/1     Running   0          3d23h
kube-system          kube-proxy-z8xsc                                1/1     Running   0          3d23h
kube-system          kube-scheduler-member3-control-plane            1/1     Running   0          3d23h
local-path-storage   local-path-provisioner-c8855d4bb-mzmth          1/1     Running   0          3d23h
root@karmada [02:38:07 PM] [~/workspace/git/karmada] [install-script *]
-> # hack/deploy-k8s-metrics-server.sh $HOME/.kube/members.config member3
--2023-06-13 14:38:12--  https://github.com/kubernetes-sigs/metrics-server/releases/download/v0.6.3/components.yaml
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/92132038/22f5d9ae-42db-4bae-86a2-771cc0477b2e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYA                           X4CSVEH53A%2F20230613%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230613T063733Z&X-Amz-Expires=300&X-Amz-Signature=1aa531ae8177e671bf001d8025628a05a24a3e5da6af41ce2baae51eac19592e&X-Amz-Signed                           Headers=host&actor_id=0&key_id=0&repo_id=92132038&response-content-disposition=attachment%3B%20filename%3Dcomponents.yaml&response-content-type=application%2Foctet-stream [following]
--2023-06-13 14:38:12--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/92132038/22f5d9ae-42db-4bae-86a2-771cc0477b2e?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Creden                           tial=AKIAIWNJYAX4CSVEH53A%2F20230613%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230613T063733Z&X-Amz-Expires=300&X-Amz-Signature=1aa531ae8177e671bf001d8025628a05a24a3e5da6af41ce2baae51eac1959                           2e&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=92132038&response-content-disposition=attachment%3B%20filename%3Dcomponents.yaml&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.111.133, 185.199.108.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4186 (4.1K) [application/octet-stream]
Saving to: ‘/tmp/tmp.TfHvwzb8c8/components.yaml’

/tmp/tmp.TfHvwzb8c8/components.yaml              100%[=======================================================================================================>]   4.09K  --.-KB/s    in 0s

2023-06-13 14:38:12 (58.9 MB/s) - ‘/tmp/tmp.TfHvwzb8c8/components.yaml’ saved [4186/4186]

serviceaccount/metrics-server created
clusterrole.rbac.authorization.k8s.io/system:aggregated-metrics-reader created
clusterrole.rbac.authorization.k8s.io/system:metrics-server created
rolebinding.rbac.authorization.k8s.io/metrics-server-auth-reader created
clusterrolebinding.rbac.authorization.k8s.io/metrics-server:system:auth-delegator created
clusterrolebinding.rbac.authorization.k8s.io/system:metrics-server created
service/metrics-server created
deployment.apps/metrics-server created
apiservice.apiregistration.k8s.io/v1beta1.metrics.k8s.io created
root@karmada [02:38:13 PM] [~/workspace/git/karmada] [install-script *]
-> # k get pods -A
NAMESPACE            NAME                                            READY   STATUS    RESTARTS   AGE
karmada-system       karmada-agent-648c99647-qvkf5                   1/1     Running   0          3d23h
karmada-system       karmada-agent-648c99647-tfw2m                   1/1     Running   0          3d23h
kube-system          coredns-787d4945fb-9pfm2                        1/1     Running   0          3d23h
kube-system          coredns-787d4945fb-mx9w5                        1/1     Running   0          3d23h
kube-system          etcd-member3-control-plane                      1/1     Running   0          3d23h
kube-system          kindnet-8r4qt                                   1/1     Running   0          3d23h
kube-system          kube-apiserver-member3-control-plane            1/1     Running   0          3d23h
kube-system          kube-controller-manager-member3-control-plane   1/1     Running   0          3d23h
kube-system          kube-proxy-z8xsc                                1/1     Running   0          3d23h
kube-system          kube-scheduler-member3-control-plane            1/1     Running   0          3d23h
kube-system          metrics-server-5c84698c5d-jhkcz                 0/1     Running   0          7s
local-path-storage   local-path-provisioner-c8855d4bb-mzmth          1/1     Running   0          3d23h

Does this PR introduce a user-facing change?:


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

Codecov Report

Merging #3650 (9d766ae) into master (b8abb44) will decrease coverage by 0.01%.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #3650      +/-   ##
==========================================
- Coverage   56.62%   56.62%   -0.01%     
==========================================
  Files         221      221              
  Lines       20838    20838              
==========================================
- Hits        11800    11799       -1     
- Misses       8416     8417       +1     
  Partials      622      622              
Flag Coverage Δ
unittests 56.62% <ø> (-0.01%) ⬇️

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

see 1 file with indirect coverage changes

@jwcesign
Copy link
Member Author

jwcesign commented Jun 9, 2023

cc @Poor12

@jwcesign
Copy link
Member Author

jwcesign commented Jun 9, 2023

cc @chaunceyjiang

@Poor12
Copy link
Member

Poor12 commented Jun 9, 2023

/lgtm

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

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

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

image

sed: 1: "/var/folders/70/wgp_hmk ...": invalid command code f

@chaunceyjiang
Copy link
Member

I'm using a MAC M1 PC, and it's possible that the version of sed I'm using is different from yours. Maybe you using GUN-sed version.

Let me investigate this issue first.

@RainbowMango
Copy link
Member

I'm using a MAC M1 PC, and it's possible that the version of sed I'm using is different from yours. Maybe you using GUN-sed version.

Nice finding! I don't have a Mac on my hand, please help test it.

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.

@jwcesign
In order to make it easier for contributors to try it on their local machine, I think we should add some examples or test reports to this PR description.

@karmada-bot karmada-bot removed the lgtm Indicates that a PR is ready to be merged. label Jun 13, 2023
@jwcesign
Copy link
Member Author

In order to make it easier for contributors to try it on their local machine, I think we should add some examples or test reports to this PR description.

Added

Signed-off-by: jwcesign <jiangwei115@huawei.com>
@jwcesign
Copy link
Member Author

cc @chaunceyjiang, hello, please check again, it works fine on my Mac.

@chaunceyjiang
Copy link
Member

image

/lgtm

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