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

Proposal: Enhance EcternalEtcd Configuration to Support Retrieving etcd Client Credentials from a Kubernetes Secret #5260

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

jabellard
Copy link
Contributor

What type of PR is this?

/kind design

What this PR does / why we need it:

Details are provided in the proposal.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

@karmada-bot karmada-bot added the kind/design Categorizes issue or PR as related to design. label Jul 26, 2024
@karmada-bot karmada-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jul 26, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 32.33%. Comparing base (721495d) to head (750e076).
Report is 288 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    #5260      +/-   ##
==========================================
+ Coverage   28.26%   32.33%   +4.07%     
==========================================
  Files         632      643      +11     
  Lines       43732    44445     +713     
==========================================
+ Hits        12359    14373    +2014     
+ Misses      30472    28981    -1491     
- Partials      901     1091     +190     
Flag Coverage Δ
unittests 32.33% <ø> (+4.07%) ⬆️

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.


- Enable the use of Kubernetes secrets for storing and retrieving external etcd connection credentials.
- Improve the security of sensitive data by leveraging Kubernetes' native secret management capabilities.
- Simplify the management of external etcd configurations.
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the current Karmada operator does not actually provide the ability to connect to an external etcd cluster, we can add a goal, such as completing the Karmada operator's capability to connect to an external etcd cluster through the ExternalEtcd configuration.

Copy link
Member

Choose a reason for hiding this comment

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

+1

## Proposal

Introduce a new field, `SecretRef`, within the `ExternalEtcd` configuration to reference a Kubernetes secret that contains the necessary etcd connection credentials.
The existing inline configuration fields will be preserved to maintain backward compatibility. However, given that they are currently unused, it would make sense to mark them as deprecated.
Copy link
Contributor

Choose a reason for hiding this comment

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

given that they are currently unused, it would make sense to mark them as deprecated.

This is a good concern. cc @RainbowMango @calvin0327

Copy link
Member

Choose a reason for hiding this comment

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

Given those fields are unused and might bring security concerns, I think we should mark them deprecated.

Copy link
Contributor

Choose a reason for hiding this comment

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

Given those fields are unused and might bring security concerns, I think we should mark them deprecated

agree, also reduces maintenance costs

// ca.crt: The Certificate Authority (CA) certificate data.
// tls.crt: The TLS certificate data.
// tls.key: The TLS private key data.
// +optional
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// +optional
// Required if using a TLS connection.
// +optional

ca.crt: <base64-encoded-data>
tls.crt: <base64-encoded-data>
tls.key: <base64-encoded-data>
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we can add a bit of description about how the Karmada operator will use these credentials, such as incorporating them into the startup flags to configure some Karmada components.

Copy link
Member

Choose a reason for hiding this comment

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

The data of the secret will be shared with karmada-apiserver, karmada-aggregate-apiserver, and karmada-search, which requires access to ETCD.

@jabellard
Copy link
Contributor Author

@zhzhuang-zju , thanks for the constructive feedback. I pushed a change to address comments.

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.

Generally looks good to me.
Thanks @jabellard
This feature is more like supporting external ETCD in a security gesture!

## Proposal

Introduce a new field, `SecretRef`, within the `ExternalEtcd` configuration to reference a Kubernetes secret that contains the necessary etcd connection credentials.
The existing inline configuration fields will be preserved to maintain backward compatibility. However, given that they are currently unused, it would make sense to mark them as deprecated.
Copy link
Member

Choose a reason for hiding this comment

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

Given those fields are unused and might bring security concerns, I think we should mark them deprecated.

Copy link
Member

Choose a reason for hiding this comment

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

@jabellard Do you think we should group operator-related proposals into a separated directory? Like docs/proposals/operator?

Signed-off-by: Joe Nathan Abellard <[email protected]>

Initial structure

Signed-off-by: Joe Nathan Abellard <[email protected]>

Fix typos

Signed-off-by: Joe Nathan Abellard <[email protected]>

Fix typos

Signed-off-by: Joe Nathan Abellard <[email protected]>

Address comments

Signed-off-by: Joe Nathan Abellard <[email protected]>

Address comments

Signed-off-by: Joe Nathan Abellard <[email protected]>
@jabellard jabellard force-pushed the extern_etcd_secret_ref branch from f3137c4 to 750e076 Compare September 9, 2024 16:45
@jabellard
Copy link
Contributor Author

@RainbowMango , thanks for your constructive feedback. I just pushed some changes to address your comments so I think this should be ready to go.

@zhzhuang-zju
Copy link
Contributor

The hosted runner: GitHub Actions 607 lost communication with the server. Anything in your workflow that terminates the runner process, starves it for CPU/Memory, or blocks its network access can cause this error.

the lint failed for some unknown reason
/retest

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 karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Sep 12, 2024
@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 12, 2024
@karmada-bot karmada-bot merged commit 2ce29ea into karmada-io:master Sep 12, 2024
12 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/design Categorizes issue or PR as related to design. 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