-
Notifications
You must be signed in to change notification settings - Fork 924
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
[helm] add the ability to specify hostIP of karmada apiserver #6097
base: master
Are you sure you want to change the base?
[helm] add the ability to specify hostIP of karmada apiserver #6097
Conversation
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
[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 |
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 #6097 +/- ##
==========================================
- Coverage 48.11% 48.09% -0.03%
==========================================
Files 668 668
Lines 55163 55211 +48
==========================================
+ Hits 26544 26551 +7
- Misses 26893 26933 +40
- Partials 1726 1727 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
what about directly set
|
When
Good idea. What I'm concerned about is whether the host IPs of the |
Make sense, as for multi-node k8s, it cann't be limited to considering the current BTW, based on your considerations, let's deduce the user's behavior, if I want to specify the also, once the |
simlar issue proposed two years ago: #4013 |
This is a good question. In this case, if you want to migrate the helm install karmada -n karmada-system --create-namespace --dependency-update ./charts/karmada --set apiServer.hostNetwork=false,apiServer.hostIP=${HOST_IP},apiServer.serviceType=NodePort,apiServer.nodePort=31333 |
so, then how can I access apiserver? by node ip? |
By any node ip |
$ kubectl get nodes -owide
member4-control-plane Ready control-plane 69s v1.31.2 172.18.0.8 <none> Debian GNU/Linux 12 (bookworm) 4.15.0-213-generic containerd://1.7.18
member4-control-plane2 Ready control-plane 58s v1.31.2 172.18.0.9 <none> Debian GNU/Linux 12 (bookworm) 4.15.0-213-generic containerd://1.7.18
member4-control-plane3 Ready control-plane 49s v1.31.2 172.18.0.7 <none> Debian GNU/Linux 12 (bookworm) 4.15.0-213-generic containerd://1.7.18
member4-worker Ready <none> 38s v1.31.2 172.18.0.10 <none> Debian GNU/Linux 12 (bookworm) 4.15.0-213-generic containerd://1.7.18
member4-worker2 Ready <none> 38s v1.31.2 172.18.0.6 <none> Debian GNU/Linux 12 (bookworm) 4.15.0-213-generic containerd://1.7.18
$ helm install karmada -n karmada-system --create-namespace --dependency-update ./charts/karmada --set apiServer.hostNetwork=false,apiServer.hostIP=172.18.0.7,apiServer.serviceType=NodePort,apiServer.nodePort=31333
$ kubectl get pods --namespace karmada-system -owide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
etcd-0 0/1 ContainerCreating 0 30s <none> member4-worker <none> <none>
karmada-aggregated-apiserver-6d7fd4cbf7-9knhh 0/1 Init:0/1 0 30s <none> member4-worker2 <none> <none>
karmada-apiserver-64d6ccf69b-lnzhg 0/1 Init:0/1 0 30s 10.12.6.4 member4-worker <none> <none>
karmada-controller-manager-5f8c78b849-k55sq 0/1 Init:0/1 0 30s 10.12.6.5 member4-worker <none> <none>
karmada-kube-controller-manager-7b866cc57c-hcq6c 0/1 Init:0/1 0 30s <none> member4-worker2 <none> <none>
karmada-scheduler-748fbbdb59-w4k4d 0/1 Init:0/1 0 30s <none> member4-worker2 <none> <none>
karmada-static-resource-djnkn 0/1 ContainerCreating 0 30s <none> member4-worker2 <none> <none>
karmada-webhook-58d9dfdd95-qndkp 0/1 Init:0/1 0 30s 10.12.6.6 member4-worker <none> <none>
$ kubectl get secret -n karmada-system karmada-kubeconfig -o jsonpath={.data.kubeconfig} | base64 -d > ~/.kube/karmada-apiserver-temp.config
$ kubectl --kubeconfig ~/.kube/karmada-apiserver-temp.config get pp
No resources found in default namespace.
$ eval $(karmadactl token create --print-register-command --kubeconfig ~/.kube/karmada-apiserver-temp.config --karmada-context karmada-apiserver) --kubeconfig ~/.kube/member5.config --context member5 --karmada-agent-image docker.io/karmada/karmada-agent:latest --cluster-name member5
[preflight] Running pre-flight checks
[preflight] All pre-flight checks were passed
[karmada-agent-start] Waiting to perform the TLS Bootstrap
[karmada-agent-start] Waiting to check cluster exists
[karmada-agent-start] Assign the necessary RBAC permissions to the agent
[karmada-agent-start] Waiting to construct karmada-agent kubeconfig
[karmada-agent-start] Waiting the necessary secret and RBAC
[karmada-agent-start] Waiting karmada-agent Deployment
cluster(member5) is joined successfully
$ kubectl --kubeconfig ~/.kube/karmada-apiserver-temp.config get cluster
NAME VERSION MODE READY AGE
member5 v1.31.2 Pull True 26s |
|
What type of PR is this?
/kind feature
What this PR does / why we need it:
When installing Karmada using Helm, if we want to access the karmada-apiserver externally, the following issues will arise:
clusters server
in the generatedkubeconfig
is:https://{{ $name }}-apiserver.{{ $namespace }}.svc.{{.Values.clusterDomain }}:5443
, which cannot be directly accessed externally.server
provided by the generatedcluster-info
ConfigMap ishttps://{{ $name }}-apiserver.{{ $namespace }}.svc.{{.Values.clusterDomain }}:5443
, which cannot be directly accessed externally.server IP
with the host IP of the karmada-apiserver, when accessing the karmada-apiserver, the certificate verification will fail because the host IP is not in the Subject Alternative Name list of the certificate.In summary, these issues will be addressed by adding the ability to specify the host IP of the karmada-apiserver.
Which issue(s) this PR fixes:
Fixes #3594
Special notes for your reviewer:
Does this PR introduce a user-facing change?: