Skip to content
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

K8s Service cluster-ip is none when map host cluster service to vCluster service #1926

Open
mayooot opened this issue Jul 12, 2024 · 0 comments · May be fixed by #2331
Open

K8s Service cluster-ip is none when map host cluster service to vCluster service #1926

mayooot opened this issue Jul 12, 2024 · 0 comments · May be fixed by #2331
Labels

Comments

@mayooot
Copy link
Contributor

mayooot commented Jul 12, 2024

What happened?

When I create a vcluster and map the host cluster's service to vcluster, use the flowing file:

$ cat values.yaml
mapServices:
  fromHost:
  - from: web-namespace/nginx-service
    to: aps/nginx-service

Everything was working fine, but I find the vcluster service cluster-ip is none, so I tried to exec a pod and use nslookup to get the actual service ip.

$ vcluster connect my-vcluster-k8s -n team-x  -- kubectl get svc -A
NAMESPACE     NAME            TYPE        CLUSTER-IP        EXTERNAL-IP   PORT(S)                  AGE
default       kubernetes      ClusterIP   192.168.194.152   <none>        443/TCP                  28h
kube-system   kube-dns        ClusterIP   192.168.194.236   <none>        53/UDP,53/TCP,9153/TCP   28h
aps           nginx-service   ClusterIP   None              <none>        80/TCP                   28h

$ vcluster connect my-vcluster-k8s -n team-x  -- kubectl exec -it curl-pod -n aps -- bash

nslookup nginx-service.aps.svc.cluster.local
Server:   192.168.194.236
Address:  192.168.194.236#53

Name: nginx-service.aps.svc.cluster.local
Address: 192.168.194.242

Obviously, 192.168.194.242 is the real k8s service cluster ip.

k get svc -A | grep nginx-service
default                    nginx-service                              ClusterIP   192.168.194.186   <none>        80/TCP                          2d5h
web-namespace              nginx-service                              ClusterIP   192.168.194.242   <none>        80/TCP                          34h

So my question is, why not show the cluster-ip in the service of vcluster? Is a bug or is it something else?

What did you expect to happen?

vcluster can show real service cluster-ip when mapping the service

How can we reproduce it (as minimally and precisely as possible)?

be like: https://www.vcluster.com/docs/v0.19/networking/internal_traffic/host_to_vcluster

Anything else we need to know?

No response

Host cluster Kubernetes version

$ vcluster connect my-vcluster-k8s -n team-x  -- kubectl version
Client Version: v1.30.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.29.0

vcluster version

$ vcluster version
vcluster version 0.20.0-beta.1

VCluster Config

use default config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants