-
Notifications
You must be signed in to change notification settings - Fork 871
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
hack/deploy-scheduler-estimator.sh support deploy estimator in the specified namespace #5511
base: master
Are you sure you want to change the base?
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 |
cc @jabellard |
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5511 +/- ##
==========================================
+ Coverage 31.70% 33.85% +2.15%
==========================================
Files 643 643
Lines 44445 44509 +64
==========================================
+ Hits 14090 15070 +980
+ Misses 29325 28289 -1036
- Partials 1030 1150 +120
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
cc @chaosi-zju |
hack/deploy-scheduler-estimator.sh
Outdated
@@ -20,11 +20,11 @@ set -o nounset | |||
REPO_ROOT=$(dirname "${BASH_SOURCE[0]}")/.. | |||
function usage() { | |||
echo "This script will deploy karmada-scheduler-estimator of a cluster." | |||
echo "Usage: hack/deploy-scheduler-estimator.sh <HOST_CLUSTER_KUBECONFIG> <HOST_CLUSTER_NAME> <MEMBER_CLUSTER_KUBECONFIG> <MEMBER_CLUSTER_NAME>" | |||
echo "Usage: hack/deploy-scheduler-estimator.sh <HOST_CLUSTER_KUBECONFIG> <HOST_CLUSTER_NAME> <MEMBER_CLUSTER_KUBECONFIG> <MEMBER_CLUSTER_CONTEXT> [<MEMBER_CLUSTER_NAME> <SCHEDULER-ESTIMATOR-NAMESPACE> <GRPC_AUTH_SECRET_NAME>]" |
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 is not requred, right? so how about pinrt two usage:
echo "Usage: hack/deploy-scheduler-estimator.sh <HOST_CLUSTER_KUBECONFIG> <HOST_CLUSTER_NAME> <MEMBER_CLUSTER_KUBECONFIG> <MEMBER_CLUSTER_NAME>"
echo "Usage: hack/deploy-scheduler-estimator.sh <HOST_CLUSTER_KUBECONFIG> <HOST_CLUSTER_NAME> <MEMBER_CLUSTER_KUBECONFIG> <MEMBER_CLUSTER_CONTEXT> [<MEMBER_CLUSTER_NAME> <SCHEDULER-ESTIMATOR-NAMESPACE> <GRPC_AUTH_SECRET_NAME>]"
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.
nice suggestion
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.
echo "Usage: hack/deploy-scheduler-estimator.sh <HOST_CLUSTER_KUBECONFIG> <HOST_CLUSTER_NAME> <MEMBER_CLUSTER_KUBECONFIG> <MEMBER_CLUSTER_CONTEXT> [<MEMBER_CLUSTER_NAME> <GRPC_AUTH_SECRET_NAME>]"
but after this modified, MEMBER_CLUSTER_NAME
is actually the required parameter, since it will be applied to karmada-scheduler-estimator.yaml
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.
MEMBER_CLUSTER_CONTEXT=$4
MEMBER_CLUSTER_NAME=${5:-$4}
By default, MEMBER_CLUSTER_CONTEXT
and MEMBER_CLUSTER_NAME
are the same value.
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 still think the parameters of the later one is so long and confusing.
one moment HOST_CLUSTER_NAME
, while one moment MEMBER_CLUSTER_CONTEXT
, mixed use of nouns.
--
I think the parameters of karmadactl join
is very clear, just like:
karmadactl join CLUSTER_NAME --kubeconfig KARMADA_KUBECONFIG --karmada-context KARMADA_CONTEXT --cluster-kubeconfig CLUSTER_KUBECONFIG --cluster-context CLUSTER_CONTEXT
the CLUSTER_NAME is the target object to deploy, while the following four args is the common and well understood k8s nouns.
So, I suggest the command to be:
hack/deploy-scheduler-estimator.sh <MEMBER_CLUSTER_NAME> <HOST_CLUSTER_KUBECONFIG> <HOST_CLUSTER_CONTEXT> <MEMBER_CLUSTER_KUBECONFIG> <MEMBER_CLUSTER_CONTEXT>
These parameters are required by the user according to the actual environment.
--
As for other parameters, they are optional and only necessary to a part of people. These can be passed by environment variables with our preset default value, just like
SCHEDULER_ESTIMATOR_NAMESPACE=${SCHEDULER_ESTIMATOR_NAMESPACE:-"karmada-system"}
GRPC_AUTH_SECRET_NAME=${GRPC_AUTH_SECRET_NAME:-"karmada-cert-secret"}
Otherwise, if I were a new user, a new proprietary name GRPC_AUTH_SECRET_NAME would dissuade me.
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'm fine with it. Previously, it was to maintain consistent behavior in the script. If there's no requirement for this, I'd be happy to modify it according to your suggestion.
@@ -55,7 +55,7 @@ spec: | |||
volumes: | |||
- name: karmada-certs | |||
secret: | |||
secretName: karmada-cert-secret | |||
secretName: {{grpc_auth_secret_name}} |
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.
why we need define this?
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.
To meet users' needs for customizing gRPC certificate, this also avoids the differences in secret names caused by different installation methods.
…ecified namespace Signed-off-by: zhzhuang-zju <m17799853869@163.com>
f343d76
to
ccd6d6f
Compare
What type of PR is this?
/kind feature
What this PR does / why we need it:
Currently, the karmada-operator does not provide the capability to install the estimator, so it is often combined with
hack/deploy-scheduler-estimator.sh
to deploy karmada-scheduler-estimator. However, to better align hack/deploy-scheduler-estimator.sh with the installation method of the karmada-operator, we need to:Additionally, split the parameter
MEMBER_CLUSTER_NAME
intoMEMBER_CLUSTER_CONTEXT
andMEMBER_CLUSTER_NAME
. Sometimes these two values are different and need to be distinguished.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
test
namespacemember1
with cluster contextmember1-host
Does this PR introduce a user-facing change?: