-
Notifications
You must be signed in to change notification settings - Fork 885
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
External etcd
Support for Karmada Operator
#5536
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hey @RainbowMango . This is still a work in progress, but I'd really appreciate some early feedback from you and the team to ensure we're well aligned on the way forward for the implementation of this feature. |
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5536 +/- ##
==========================================
+ Coverage 34.14% 34.80% +0.66%
==========================================
Files 643 646 +3
Lines 44524 44915 +391
==========================================
+ Hits 15203 15634 +431
+ Misses 28165 28074 -91
- Partials 1156 1207 +51
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
etcd
Support for Karmada Operator
d3ad4fa
to
51b869b
Compare
Signed-off-by: Joe Nathan Abellard <[email protected]> Onwards Signed-off-by: Joe Nathan Abellard <[email protected]> Onwards Signed-off-by: Joe Nathan Abellard <[email protected]> Onwards Signed-off-by: Joe Nathan Abellard <[email protected]> Onwards Signed-off-by: Joe Nathan Abellard <[email protected]> Onwards Signed-off-by: Joe Nathan Abellard <[email protected]> Onwards Signed-off-by: Joe Nathan Abellard <[email protected]> Onwards Signed-off-by: Joe Nathan Abellard <[email protected]> Onwards Signed-off-by: Joe Nathan Abellard <[email protected]>
Signed-off-by: Joe Nathan Abellard <[email protected]>
Signed-off-by: Joe Nathan Abellard <[email protected]>
Signed-off-by: Joe Nathan Abellard <[email protected]>
f36f9a9
to
001b081
Compare
Signed-off-by: Joe Nathan Abellard <[email protected]>
Signed-off-by: Joe Nathan Abellard <[email protected]>
@RainbowMango , any thoughts? |
Signed-off-by: Joe Nathan Abellard <[email protected]>
// validateKarmada ensures the Karmada resource adheres to validation rules | ||
func (ctrl *Controller) validateKarmada(karmada *operatorv1alpha1.Karmada) error { | ||
if karmada.Spec.Components.Etcd != nil && karmada.Spec.Components.Etcd.External != nil { | ||
expectedSecretName := fmt.Sprintf("%s-%s", karmada.Name, constants.KarmadaOperatorEtcdClientCertNameSuffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remind me of the benefit of using the karmada instance name(karma.name) as the prefix?
In my opinion, each karmada instance would run in a separate namespace, so it does not necessarily have the prefix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Explore further.
newCondition := metav1.Condition{ | ||
Type: string(operatorv1alpha1.Ready), | ||
Status: metav1.ConditionFalse, | ||
Reason: InvalidExternalEtcdClientSecretName, | ||
Message: errorMessage, | ||
LastTransitionTime: metav1.Now(), | ||
} | ||
meta.SetStatusCondition(&karmada.Status.Conditions, newCondition) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd hesitate to introduce a condition for each concrete unexpected situation. My concern is we probably will have a lot of validations, we can't introduce a new condition for each validation.
I didn't expect to have condition from this PR, but thanks for me :) Maybe we can have a condition to represent the overall validation result, and we can put the error message to the Message
if validation fails.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will create just one generic validation reason and use the message to describe the error.
// EtcClientCredentialsVolumeName defines the name of the volume for the etcd client credentials | ||
EtcClientCredentialsVolumeName = "etcd-client-credentials" // #nosec G101 | ||
// EtcClientCredentialsMountPath defines the mount path for the etcd client credentials data | ||
EtcClientCredentialsMountPath = "/etc/etcd/pki" // #nosec G101 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// EtcClientCredentialsVolumeName defines the name of the volume for the etcd client credentials | |
EtcClientCredentialsVolumeName = "etcd-client-credentials" // #nosec G101 | |
// EtcClientCredentialsMountPath defines the mount path for the etcd client credentials data | |
EtcClientCredentialsMountPath = "/etc/etcd/pki" // #nosec G101 | |
// EtcClientCredentialsVolumeName defines the name of the volume for the etcd client credentials | |
EtcClientCredentialsVolumeName = "etcd-client-cert" // #nosec G101 | |
// EtcClientCredentialsMountPath defines the mount path for the etcd client credentials data | |
EtcClientCredentialsMountPath = "/etc/karmada/pki/etcd-client" // #nosec G101 |
As discussed with @chaosi-zju, we are going to standardize the volume name and mount path like this:
- Volume:
<server>
-client-cert // e.g. etcd-client-cert - Mount path: /etc/karmada/pki/
<server>
// e.g. /etc/karmada/pki/etcd-client - File in container:
- /etc/karmada/pki/
<server>
-client/ca.crt // e.g./etc/karmada/pki/etcd-client/ca.crt
- /etc/karmada/pki/
<server>
-client/tls.crt // e.g./etc/karmada/pki/etcd-client/tls.crt
- /etc/karmada/pki/
<server>
-client/tls.key // e.g./etc/karmada/pki/etcd-client/tls.key
- /etc/karmada/pki/
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will make the changes.
Hi @jabellard, As discussed at the community meeting, we will have an alpha release for feature #5478. |
Thank you! |
@jabellard, please confirm whether we still need this PR. |
No longer needed. The other PRs covered the work initially introduced here. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This is an implementation of this proposal for adding support to the Karmada operator for external etcd cluster connections.
Which issue(s) this PR fixes:
Fixes #5242
Special notes for your reviewer:
Does this PR introduce a user-facing change?: