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

Cannot access without adding clusterid #3167

Closed
trumpzhang opened this issue Sep 24, 2024 · 5 comments
Closed

Cannot access without adding clusterid #3167

trumpzhang opened this issue Sep 24, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@trumpzhang
Copy link

trumpzhang commented Sep 24, 2024

What happened:
I set up three clusters: broker, c1, and c2, all of them has only master node. After that, i use subctl join --kubeconfig ./config/c2.yaml broker-info.subm --clusterid c2 --natt=false make c2 a member .
image

In c1, I use subctl export service --namespace sample whereami-cs exported the service whereami-cs which in the namespace sample. In c2, I couldn't access it use curl whereami-cs.sample.svc.clusterset.local, but when i use curl c1.whereami-cs.sample.svc.clusterset.local, it worked.

Client pod info:
kubectl run client --image=cr7258/nettool:v1
all test curl command exec in pod client.

info:
use c1.whereami-cs.sample.svc.clusterset.local
image

use whereami-cs.sample.svc.clusterset.local
image

test-submariner.yaml
`
apiVersion: apps/v1
kind: Deployment
metadata:
name: whereami
namespace: sample
spec:
replicas: 1
selector:
matchLabels:
app: whereami
template:
metadata:
labels:
app: whereami
spec:
containers:
- name: whereami
image: cr7258/whereami:v1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
env:
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP

apiVersion: v1
kind: Service
metadata:
name: whereami-cs
namespace: sample
spec:
selector:
app: whereami
ports:

`

What you expected to happen:
use curl whereami-cs.sample.svc.clusterset.local successful.

How to reproduce it (as minimally and precisely as possible):
Install broker first(will as broker role)
subctl join --kubeconfig ./config/c1.yaml broker-info.subm --clusterid c1 --natt=false
subctl join --kubeconfig ./config/c2.yaml broker-info.subm --clusterid c2 --natt=false

Anything else we need to know?:
what should i do to access "whereami-cs.sample.svc.clusterset.local" successfully in cluster c2.
when use nslookup:
image

complement:
i change test client from cr7258/nettool:v1 to alpine3.19 , use nslookup successful, but curl failed.
like follow:
image

I'm new to k8s and submariner, need some help.

Environment:

  • k3s: v1.27.2+k3s1
  • subctl: v0.13.0
  • docker: 20.10.9
@trumpzhang trumpzhang added the bug Something isn't working label Sep 24, 2024
@yboaron
Copy link
Contributor

yboaron commented Sep 24, 2024

Thanks for trying Submariner @trumpzhang ,

Please share the output of [1] from both clusters

[1]
`subctl show all

subctl diagnose all
`

@trumpzhang
Copy link
Author

trumpzhang commented Sep 24, 2024

Thanks for trying Submariner @trumpzhang ,

Please share the output of [1] from both clusters

[1] `subctl show all

subctl diagnose all `

thanks your reply. Query result like below:

  • broker

subctl show all
image

subctl diagnose all
image

  • c1

subctl --kubeconfig ./config/c1.yaml show all
image

subctl --kubeconfig ./config/c1.yaml diagnose all
image

  • c2

subctl --kubeconfig ./config/c2.yaml show all
image

subctl --kubeconfig ./config/c2.yaml diagnose all
image

@yboaron
Copy link
Contributor

yboaron commented Sep 24, 2024

First of all, seems that you are using an older version (0.13) of Submariner, please reinstall Submariner using latest subctl (0.18), check [1] for more details.

Post deployment, you can use subctl automatic verification for testing inter-cluster service discovery functionality.

[1]
https://submariner.io/operations/deployment/subctl/#installation

@trumpzhang
Copy link
Author

@yboaron
Thanks for your reply. I find the problem and fix it up.
A few days ago, I installed app named "Clash Verge" which is a proxy software. For convenience, I turned on its Tun mode, which caused requests from pods in my virtual machine to not be resolved correctly. Because I found that the curl public domain name in the pod was unresponsive, but the curl public domain name on the host was good. When I turned off Tun mode, everything worked normally.

@dfarrell07
Copy link
Member

@trumpzhang Glad things are working. Closing this for now, feel free to open something else if you have more questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants