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

remove insecureSkipTLSVerify in local-up-karmada script #4026

Merged
merged 1 commit into from
Sep 7, 2023

Conversation

chaosi-zju
Copy link
Member

@chaosi-zju chaosi-zju commented Sep 4, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Backupground: insecureSkipTLSVerify=true means prohibit clientside from verifing the cert of serverside, this is an unsafe configuration, we can avoid unnecessary unsafe configurations.

This PR mainly aims to remove insecureSkipTLSVerify in YAML artifacts used by deploy-karmada.sh.

Which issue(s) this PR fixes:

part of #4024

Special notes for your reviewer:

I have finished following verification test:

  • 1. install by hack/local-up-karmada.sh success.
    image

  • 2. each APIService's AVAILABLE filed equals to True.

    kubectl --context karmada-apiserver get apiservice | grep -E 'NAME | karmada-system'
    image

  • 3. after I specified the caBunde to apiservice, it occurred new problem as below:

    E0904 21:14:51.103247 3048272 memcache.go:287] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
    E0904 21:14:51.103864 3048272 memcache.go:287] couldn't get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
    E0904 21:14:51.104357 3048272 memcache.go:287] couldn't get resource list for custom.metrics.k8s.io/v1beta2: the server is currently unable to handle the request
    ...
    GET https://172.18.0.4:5443/apis/custom.metrics.k8s.io/v1beta2?timeout=32s 503 Service Unavailable in 4 milliseconds
    Response Body: error trying to reach service: x509: certificate is valid for localhost, localhost, not karmada-metrics-adapter.karmada-system.svc

    reason: we didn't provide our custom aggregate-apiserver with certificate, we should sign certificate for them.
    resolution: add following launch parameters to karmada-metrics-adapter

    - --tls-cert-file=/etc/karmada/pki/karmada.crt
    - --tls-private-key-file=/etc/karmada/pki/karmada.key

    before add parameters (in picture, ka means kubectl --context karmada-apiserver):
    image
    after add parameters:
    image

  • 4. check if helm installation also used those YAML artifacts, if so, synchronize modifications.
    the karmada-aggregated-apiserver-apiservice.yaml in below picture is just printing a string type key, not quoting the same name file which I modified.
    image
    done, no influence to other place.
    updated: hack/deploy-metrics-adapter used karmada-metrics-adapter-apiservice.yaml which I modified.
    verification:
    image
    image

Does this PR introduce a user-facing change?:

none

@karmada-bot karmada-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. labels Sep 4, 2023
@karmada-bot karmada-bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Sep 4, 2023
Copy link
Member

@whitewindmills whitewindmills left a comment

Choose a reason for hiding this comment

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

an enhancement is right label.
/remove-kind bug
/kind feature

@karmada-bot karmada-bot added kind/feature Categorizes issue or PR as related to a new feature. and removed kind/bug Categorizes issue or PR as related to a bug. labels Sep 5, 2023
@codecov-commenter
Copy link

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (7c96e0d) 53.83% compared to head (33b9269) 53.82%.

❗ 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.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4026      +/-   ##
==========================================
- Coverage   53.83%   53.82%   -0.01%     
==========================================
  Files         231      231              
  Lines       23013    23013              
==========================================
- Hits        12388    12386       -2     
- Misses       9953     9954       +1     
- Partials      672      673       +1     
Flag Coverage Δ
unittests 53.82% <ø> (-0.01%) ⬇️

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.

@chaosi-zju chaosi-zju changed the title [WIP] remove insecureSkipTLSVerify in local-up-karmada script remove insecureSkipTLSVerify in local-up-karmada script Sep 5, 2023
@karmada-bot karmada-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 5, 2023
@chaosi-zju
Copy link
Member Author

Thanks for start reviewing~ @RainbowMango @XiShanYongYe-Chang

besides, I modified the launch params of metrics-adapter, have a look @jwcesign

@karmada-bot karmada-bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 5, 2023
@XiShanYongYe-Chang
Copy link
Member

/assign

Copy link
Member

@XiShanYongYe-Chang XiShanYongYe-Chang left a comment

Choose a reason for hiding this comment

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

Good job and nice explanation step.

hack/deploy-karmada.sh Show resolved Hide resolved
@XiShanYongYe-Chang
Copy link
Member

/lgtm

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

@jwcesign jwcesign left a comment

Choose a reason for hiding this comment

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

Other lgtm

hack/deploy-karmada.sh Show resolved Hide resolved
@RainbowMango
Copy link
Member

PR is on going, after motification we should ensure:

PR is still ongoing? Please update the PR descriptions once it ready for review or moving forward.

@RainbowMango
Copy link
Member

reason: we didn't provide our custom aggregate-apiserver with certificate, we should sign certificate for them.

What's the ka thing?
I tried following command against karmada-apiserver, didn't find these errors:

-bash-5.0# karmadactl get po
No resources found in  namespace.
-bash-5.0# kubectl get pod
No resources found in default namespace.

@chaosi-zju
Copy link
Member Author

What's the ka thing?

sorry, ka is a alias to kubectl --context karmada-apiserver, I'll add description to above.

I tried following command against karmada-apiserver, didn't find these errors:

the error is introduced after I add caBundle to apiservice, then I add - --tls-cert-file=/etc/karmada/pki/karmada.crt parameter to karmada-metrics-adapter, the error fixed. (I have corrected the description above too.)

@chaosi-zju
Copy link
Member Author

PR is still ongoing? Please update the PR descriptions once it ready for review or moving forward.

ok, and PR is ready to merge

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

@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 7, 2023
@karmada-bot karmada-bot merged commit b498f0f into karmada-io:master Sep 7, 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.

7 participants