karmada-io / karmada

Open, Multi-Cloud, Multi-Cluster Kubernetes Orchestration
https://karmada.io
Apache License 2.0
4.41k stars 871 forks source link

Helm chart for `schedulerEstimator` missing default value for `clusterName` #3686

Open tillig opened 1 year ago

tillig commented 1 year ago

What happened:

I enabled the schedulerEstimator component in my Helm values.yaml file and the chart for deploying in host mode failed to deploy.

components:
  - schedulerEstimator
schedulerEstimator:
  replicaCount: 2

What you expected to happen:

It should deploy once enabled, or there should be documentation explaining what else I need to set to be successful.

Anything else we need to know?:

The reason it fails is because the karmada-scheduler-estimator.yaml template assumes that, when enabled, the .Values.schedulerEstimator.clusterName is there so that, later, it can use that name in a Secret like {{ $clusterName }}-kubeconfig. If the value is not populated, the Secret name will be -kubeconfig which is invalid.

The default in the chart values.yaml is "". Likely the default should be filled in with a suitable non-empty value like host or management or something.

Environment:

tillig commented 1 year ago

Related: It seems deploying schedulerEstimator with a clusterName will allow the Helm deployment to succeed but the pods won't start up. Setting the clusterName to management to get past the Secret deployment yields:

E0620 23:02:26.218755 1 run.go:74] "command failed" err="error building kubeconfig: invalid configuration: no server found for cluster \"management-apiserver\""

I can't really do anything with that, so I guess I'll just not install the schedulerEstimator component. I'm not sure if that's a bad thing; I can't find any documentation explaining what it does.

Poor12 commented 1 year ago

It's hard to set a default value for it because we cannot know the names of user's clusters ahead of time. If you want to install scheduler-estimator, you could install it separately. https://github.com/karmada-io/karmada/tree/master/charts/karmada#2-install-component

tillig commented 1 year ago

The alternative solution would be to document in the Helm chart:

Poor12 commented 1 year ago

Sorry for late response because of Dragon Boat Festival. I'd like to give you a brief answer about scheduler-estimator.

  1. "cluster name" is "the name of the member cluster". Users need to specify the name of the cluster registered in Karmada when adding the cluster to Karmada. See more details about karmadactl join.
  2. Yes. We cannot install scheduler-estimator in host mode. We can include this hint in the documentation.
  3. Scheduler-estimator is mainly to calculate the resource usage of member clusters and help scheduler decide which cluster to schedule. See more details here.