What would you like to be added:
When deploying Karmada instance via karmada.operator.karmada.io/v1alpha1 CR with host cluster kubeconfig that contains proxy-url, make karmada-operator automatically parse and inject the proxy-url field into control plane config when building host cluster connection in SetControlplaneConfig logic, so that operator can properly connect target Karmada control plane and complete the installation of karmada-apiserver and other control plane components successfully.
Locations:
|
// store rest config to RunData. |
|
config, err := clientcmd.RESTConfigFromKubeConfig(configBytes) |
|
if err != nil { |
|
return err |
|
} |
|
data.SetControlplaneConfig(config) |
|
|
|
klog.V(2).InfoS("[UploadAdminKubeconfig] Successfully created secret of karmada apiserver kubeconfig", "karmada", klog.KObj(data)) |
|
return nil |
|
} |
Why is this needed:
Currently, if the kubeconfig of host cluster configured in Karmada CR uses proxy-url to access cluster apiserver, karmada-operator will ignore the proxy-url field during constructing host cluster connection in SetControlplaneConfig phase. Without supplementing proxy-url into client config, operator cannot establish normal connection to target Karmada control plane, resulting in failure to install karmada-apiserver and other core control plane components, which blocks the whole Karmada instance deployment flow for environments that rely on proxy to access Kubernetes clusters.
Locations:
|
func runSystemNamespace(r workflow.RunData) error { |
|
data, ok := r.(InitData) |
|
if !ok { |
|
return errors.New("systemName task invoked with an invalid data struct") |
|
} |
|
|
|
err := apiclient.CreateNamespace(data.KarmadaClient(), &corev1.Namespace{ |
|
ObjectMeta: metav1.ObjectMeta{ |
|
Name: constants.KarmadaSystemNamespace, |
|
}, |
|
}) |
|
if err != nil { |
|
return fmt.Errorf("failed to create namespace %s, err: %w", constants.KarmadaSystemNamespace, err) |
|
} |
|
|
|
klog.V(2).InfoS("[systemName] Successfully created karmada system namespace", "namespace", constants.KarmadaSystemNamespace, "karmada", klog.KObj(data)) |
|
return nil |
|
} |
What would you like to be added:
When deploying Karmada instance via
karmada.operator.karmada.io/v1alpha1CR with host cluster kubeconfig that containsproxy-url, make karmada-operator automatically parse and inject theproxy-urlfield into control plane config when building host cluster connection inSetControlplaneConfiglogic, so that operator can properly connect target Karmada control plane and complete the installation of karmada-apiserver and other control plane components successfully.Locations:
karmada/operator/pkg/tasks/init/upload.go
Lines 117 to 126 in 2f47894
Why is this needed:
Currently, if the kubeconfig of host cluster configured in Karmada CR uses proxy-url to access cluster apiserver, karmada-operator will ignore the proxy-url field during constructing host cluster connection in SetControlplaneConfig phase. Without supplementing proxy-url into client config, operator cannot establish normal connection to target Karmada control plane, resulting in failure to install karmada-apiserver and other core control plane components, which blocks the whole Karmada instance deployment flow for environments that rely on proxy to access Kubernetes clusters.
Locations:
karmada/operator/pkg/tasks/init/karmadaresource.go
Lines 79 to 96 in 2f47894