-
Notifications
You must be signed in to change notification settings - Fork 50
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
[feature][disaggregated] Support configuration of username and password and multi secrets #312
[feature][disaggregated] Support configuration of username and password and multi secrets #312
Conversation
…rd and multi secret
…rd and multi secret
…ig_username_and_password # Conflicts: # pkg/controller/sub_controller/disaggregated_subcontroller.go
…rd and multi secret
pkg/common/utils/resource/pod.go
Outdated
}) | ||
} | ||
} else { | ||
defaultEnvs = append(defaultEnvs, []corev1.EnvVar{{ |
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.
This behavior will trigger the restart of the DORIS cluster after upgrading the operator. It is dangerous for the online environment.
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.
Done. Currently, the doris cluster will only be restarted when ddc.Spec.AdminUser
is configured.
pkg/common/utils/resource/pod.go
Outdated
@@ -729,6 +752,46 @@ func getMultiSecretVolumeAndVolumeMount(bSpec *v1.BaseSpec, componentType v1.Com | |||
return volumes, volumeMounts | |||
} | |||
|
|||
func GetMultiSecretVolumeAndVolumeMountWithCommonSpec(cSpec *dv1.CommonSpec, componentType dv1.DisaggregatedComponentType) ([]corev1.Volume, []corev1.VolumeMount) { |
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.
componentType is not a must parameter
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.
if only log, the componentType can omit int parameters. log in message on the call function.
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.
It's better to make judgment and print log in the GetMultiSecretVolumeAndVolumeMountWithCommonSpec
here. Because there are three statefulsets in the disaggregated cluster, and each statefulset has two methods that call the GetMultiSecretVolumeAndVolumeMountWithCommonSpec
, which results in numerous places that need to be modified.
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.
It does not need to output a log. common spec only in fe, be, cn, broker spec, so, if the common spec is not empty, the component type exists.
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.
Done, componentType
has been removed.
for _, secret := range secrets { | ||
var s corev1.Secret | ||
if getErr := d.K8sclient.Get(ctx, types.NamespacedName{Namespace: ddc.Namespace, Name: secret.SecretName}, &s); getErr != nil { | ||
errMessage = errMessage + fmt.Sprintf("(name: %s, namespace: %s, err: %s), ", secret.SecretName, ddc.Namespace, getErr.Error()) |
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.
No Import fmt package, code compilation error
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.
Done
for _, secret := range cSpec.Secrets { | ||
path := secret.MountPath | ||
if secret.MountPath == "" { | ||
path = defaultMountPath |
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.
path must be unique, You need to add the unique verification of the mounting path. If you do not pass, print it in an wrong log. like this config:
feSpec:
secrets:
- secretName: secret1
- secretName: secret2
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.
In the Docker
|
…rd and multi secret
…rd and multi secret
…d password and multi secret" This reverts commit 1b0d139.
…rd and multi secret
…rd and multi secret
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)