Fixes Issue #6580 Install to namespaces other than karmada-system via helm chart.
What type of PR is this? /kind bug
What this PR does / why we need it:
this PR fixes a issue where the karmada helm chart could only be installed in the karmada-system namespace previously, attempting to install karmada in any other namespace would result in controller crashes and certificate verification errors
Which issue(s) this PR fixes:
when users tried to install karmada using helm in a namespace other than karmada-system, they encountered errors
Fixes #6580
the following chnages are tested and verified @zhzhuang-zju please review this PR and request if any further chnages are required !!
Welcome @omsuneri! It looks like this is your first PR to karmada-io/karmada 🎉
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign a7i for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
@zhzhuang-zju if you want me to mention these updates in the docs i can do that for you !!
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 45.35%. Comparing base (140f745) to head (9500359).
:warning: Report is 151 commits behind head on master.
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #6601 +/- ##
=======================================
Coverage 45.34% 45.35%
=======================================
Files 687 687
Lines 56383 56383
=======================================
+ Hits 25568 25570 +2
+ Misses 29220 29218 -2
Partials 1595 1595
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 45.35% <ø> (+<0.01%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
thanks~ @omsuneri
The DCO check failed, please sign off your commit by using the command git commit -s -m.
Besides, it would be better to show your test report
@zhzhuang-zju I did sign off the commits still showing dco check failed Should I share test file with you or just results
Commit sha: 24cadbe, Author: Om Santosh Suneri, Committer: GitHub; Expected "Om Santosh Suneri [email protected]", but got "omsuneri [email protected]".
I guess you have "Keep my email addresses private" enabled
@zhzhuang-zju please review this again now i resolved the DCO check and added test result here
test result :
before
helm template karmada ./charts/karmada --namespace custom-name | grep "namespace:"
returns: APIServices referenced karmada-system while services deployed to custom-ns - service discovery failed
after
helm template karmada ./charts/karmada --namespace custom-name | grep "namespace:"
returns: all namespace references point to custom-ns service discovery works
@zhzhuang-zju currently some of the tests are failing with the chnages i m correcting all the chnages to follow the test !
@zhzhuang-zju I resolved all the previous errors please review this and request if any further changes needed !!
@RainbowMango would please like to review this PR and request if any further changes are required !!
test result : before
helm template karmada ./charts/karmada --namespace custom-name | grep "namespace:"returns: APIServices referenced karmada-system while services deployed to custom-ns - service discovery failed afterhelm template karmada ./charts/karmada --namespace custom-name | grep "namespace:"returns: all namespace references point to custom-ns service discovery works
Great! Are there any tests for helm install?
test result : before
helm template karmada ./charts/karmada --namespace custom-name | grep "namespace:"returns: APIServices referenced karmada-system while services deployed to custom-ns - service discovery failed afterhelm template karmada ./charts/karmada --namespace custom-name | grep "namespace:"returns: all namespace references point to custom-ns service discovery worksGreat! Are there any tests for
helm install?
Yes I've tested the actual helm install functionality and it works fine
@zhzhuang-zju pushed the final changes as suggested by you please review this !!
Ping @zhzhuang-zju
Sorry for the delay /assign
I‘m doing a local verification, and the results will be available soon
test reports:
- deploy karmada in karmada-system namespace
$ helm install karmada -n karmada-system --create-namespace --dependency-update ./charts/karmada --set apiServer.hostNetwork=true,apiServer.serviceType=NodePort
W1205 16:55:58.430445 456923 warnings.go:70] spec.SessionAffinity is ignored for headless services
NAME: karmada
LAST DEPLOYED: Fri Dec 5 16:55:47 2025
NAMESPACE: karmada-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
$ kubectl get pods --namespace karmada-system
NAME READY STATUS RESTARTS AGE
etcd-0 1/1 Running 0 6m1s
karmada-aggregated-apiserver-67d4c46964-hlbqh 1/1 Running 0 6m1s
karmada-apiserver-78c548cb95-knrcd 1/1 Running 0 6m1s
karmada-controller-manager-76c6444c5-l9p5f 1/1 Running 0 6m1s
karmada-kube-controller-manager-74f66dd89f-ssdw7 1/1 Running 0 6m1s
karmada-scheduler-c97c44df7-bbnh6 1/1 Running 0 6m1s
karmada-webhook-87dc4c849-txsjj 1/1 Running 0 6m1s
$ kubectl get --kubeconfig karmada-apiserver.config pp
NAME CONFLICT-RESOLUTION PRIORITY AGE
nginx-propagation Abort 0 2m57s
$ kubectl get --kubeconfig karmada-apiserver.config rb
NAME SCHEDULED FULLYAPPLIED AGE
nginx-deployment False 3m2s
$ kubectl get --kubeconfig karmada-apiserver.config deployments.apps
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 0/2 0 0 3m13s
- deploy karmada in test namespace
$ helm install karmada -n test --create-namespace --dependency-update ./charts/karmada --set apiServer.hostNetwork=true,apiServer.serviceType=NodePort
W1205 17:08:14.183251 464429 warnings.go:70] spec.SessionAffinity is ignored for headless services
NAME: karmada
LAST DEPLOYED: Fri Dec 5 17:08:00 2025
NAMESPACE: test
STATUS: deployed
REVISION: 1
TEST SUITE: None
$ kubectl get pods --namespace test
NAME READY STATUS RESTARTS AGE
etcd-0 1/1 Running 0 5m19s
karmada-aggregated-apiserver-75df65f77-6lfp6 1/1 Running 0 5m19s
karmada-apiserver-84b789d44-bnlb4 1/1 Running 0 5m19s
karmada-controller-manager-76c6444c5-vqfpr 1/1 Running 0 5m19s
karmada-kube-controller-manager-74f66dd89f-pb6jc 1/1 Running 0 5m19s
karmada-scheduler-c97c44df7-j5cxx 1/1 Running 0 5m19s
karmada-webhook-87dc4c849-z6ckb 1/1 Running 0 5m19s
$ $ kubectl get --kubeconfig karmada-apiserver.config pp
NAME CONFLICT-RESOLUTION PRIORITY AGE
nginx-propagation Abort 0 2m40s
$ kubectl get --kubeconfig karmada-apiserver.config rb
NAME SCHEDULED FULLYAPPLIED AGE
nginx-deployment False 2m45s
$ kubectl get --kubeconfig karmada-apiserver.config deployments.apps
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 0/2 0 0 2m12s
- deploy karmada in test namespace and set systemNamespace to test1
$ helm install karmada -n test --create-namespace --dependency-update ./charts/karmada --set apiServer.hostNetwork=true,apiServer.serviceType=NodePort,systemNamespac=test1
W1205 17:19:08.858847 470527 warnings.go:70] spec.SessionAffinity is ignored for headless services
NAME: karmada
LAST DEPLOYED: Fri Dec 5 17:18:57 2025
NAMESPACE: test
STATUS: deployed
REVISION: 1
TEST SUITE: None
$ kubectl get pods --namespace test
NAME READY STATUS RESTARTS AGE
etcd-0 1/1 Running 0 25s
karmada-aggregated-apiserver-75df65f77-p6ssd 1/1 Running 0 25s
karmada-apiserver-84b789d44-42z7j 1/1 Running 0 25s
karmada-controller-manager-76c6444c5-9rdzq 1/1 Running 0 25s
karmada-kube-controller-manager-74f66dd89f-djw8h 1/1 Running 0 25s
karmada-scheduler-c97c44df7-rh5fr 1/1 Running 0 24s
karmada-static-resource-fgt6h 0/1 Completed 0 25s
karmada-webhook-87dc4c849-xvh89 1/1 Running 0 25s
$ kubectl get --kubeconfig karmada-apiserver.config rb
NAME SCHEDULED FULLYAPPLIED AGE
nginx-deployment False 13s
$ kubectl get --kubeconfig karmada-apiserver.config pp
NAME CONFLICT-RESOLUTION PRIORITY AGE
nginx-propagation Abort 0 20s
$ kubectl get --kubeconfig karmada-apiserver.config deployments.apps
NAME READY UP-TO-DATE AVAILABLE AGE
nginx 0/2 0 0 21s