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

subctl diagnose failing when hostname does not match with nodename #1471

Closed
sridhargaddam opened this issue Jul 7, 2021 · 0 comments · Fixed by #1486
Closed

subctl diagnose failing when hostname does not match with nodename #1471

sridhargaddam opened this issue Jul 7, 2021 · 0 comments · Fixed by #1486
Assignees
Labels
bug Something isn't working

Comments

@sridhargaddam
Copy link
Member

What happened:
As part of subctl diagnose firewall tunnel, we try to find the active gateway node in the cluster so that we can schedule the testPod on that node. In an IBMCluster it was seen that hostname (as stored in the endpoint info) does not match with the nodeName, because of this, the diagnose command is failing.

subctl diagnose firewall tunnel /home/ubuntu/submariner/cluster-c.config /home/ubuntu/submariner/cluster-d.config
⚠ Checking if tunnels can be setup on Gateway node of cluster "c3fvuprd0vobcoseot80".
⚠ Could not find the active Gateway nodeName in local cluster

k describe gateways.submariner.io -n submariner-operator kube-c3fvuprd0vobcoseot80-submarinerc-submari-00000146
Name: kube-c3fvuprd0vobcoseot80-submarinerc-submari-00000146
Namespace: submariner-operator
Labels:
Annotations: update-timestamp: 1625435263
API Version: submariner.io/v1
Kind: Gateway
Metadata:
Creation Timestamp: 2021-07-04T21:47:33Z
Generation: 3
Managed Fields:
API Version: submariner.io/v1
Fields Type: FieldsV1
fieldsV1:
f:metadata:
f:annotations:
.:
f:update-timestamp:
f:status:
.:
f:connections:
f:haStatus:
f:localEndpoint:
.:
f:backend:
f:backend_config:
.:
f:preferred-server:
f:cable_name:
f:cluster_id:
f:healthCheckIP:
f:hostname:
f:nat_enabled:
f:private_ip:
f:public_ip:
f:subnets:
f:statusFailure:
f:version:
Manager: submariner-gateway
Operation: Update
Time: 2021-07-04T21:47:33Z
Resource Version: 302733
UID: eef3a1b7-29d7-4628-abde-72520696fec0
Status:
Connections:
Endpoint:
Backend: libreswan
backend_config:
Preferred - Server: false
cable_name: submariner-cable-c3g1045d0j7fl990v4q0-10-240-64-12
cluster_id: c3g1045d0j7fl990v4q0
Health Check IP: 172.17.35.0
Hostname: kube-c3g1045d0j7fl990v4q0-submarinerd-default-000001fb
nat_enabled: true
private_ip: 10.240.64.12
public_ip: 150.239.164.46
Subnets:
172.22.0.0/16
172.17.0.0/18
Latency RTT:
Average: 0s
Last: 0s
Max: 0s
Min: 0s
Std Dev: 0s
Status: connecting
Status Message:
Using IP: 150.239.164.46
Using NAT: true
Ha Status: active
Local Endpoint:
Backend: libreswan
backend_config:
Preferred - Server: false
cable_name: submariner-cable-c3fvuprd0vobcoseot80-10-240-128-4
cluster_id: c3fvuprd0vobcoseot80
Health Check IP: 172.17.111.0
Hostname: kube-c3fvuprd0vobcoseot80-submarinerc-submari-00000146
nat_enabled: true
private_ip: 10.240.128.4
public_ip: 52.118.79.113
Subnets:
172.21.0.0/16
172.17.64.0/18
Status Failure:
Version: release-0.9-c0e2e61
Events:

In GKE cluster the hostname was coming as the actual nodename. IN IBM cluster it is not name but ibm-cloud.kubernetes.io/worker-id

k get nodes --show-labels --selector=submariner.io/gateway=true
NAME STATUS ROLES AGE VERSION LABELS
10.240.128.4 Ready 47h v1.20.7+IKS arch=amd64,beta.kubernetes.io/arch=amd64,beta.kubernetes.io/instance-type=bx2.4x16,beta.kubernetes.io/os=linux,failure-domain.beta.kubernetes.io/region=us-south,failure-domain.beta.kubernetes.io/zone=us-south-3,ibm-cloud.kubernetes.io/ha-worker=true,ibm-cloud.kubernetes.io/iaas-provider=g2,ibm-cloud.kubernetes.io/instance-id=0737_c65a86db-e7a9-4d83-84d1-d2108ba062f3,ibm-cloud.kubernetes.io/internal-ip=10.240.128.4,ibm-cloud.kubernetes.io/machine-type=bx2.4x16,ibm-cloud.kubernetes.io/os=UBUNTU_18_64,ibm-cloud.kubernetes.io/region=us-south,ibm-cloud.kubernetes.io/sgx-enabled=false,ibm-cloud.kubernetes.io/subnet-id=0737-f612d62f-e946-4d24-8e12-2dc25b171efa,ibm-cloud.kubernetes.io/worker-id=kube-c3fvuprd0vobcoseot80-submarinerc-submari-00000146,ibm-cloud.kubernetes.io/worker-pool-id=c3fvuprd0vobcoseot80-3e04804,ibm-cloud.kubernetes.io/worker-pool-name=submariner-c-test,ibm-cloud.kubernetes.io/worker-version=1.20.7_1543,ibm-cloud.kubernetes.io/zone=us-south-3,kubernetes.io/arch=amd64,kubernetes.io/hostname=10.240.128.4,kubernetes.io/os=linux,node.kubernetes.io/instance-type=bx2.4x16,submariner.io/gateway=true,topology.kubernetes.io/region=us-south,topology.kubernetes.io/zone=us-south-3

@sridhargaddam sridhargaddam added the bug Something isn't working label Jul 7, 2021
sridhargaddam added a commit to sridhargaddam/submariner-operator that referenced this issue Jul 14, 2021
Submariner Endpoint stores the hostname info as part of the endpoint object.
In most of the K8s clusters, the hostname matches with the nodeName, but on
some clusters, it was seen that nodeName does not match. This PR fixes this
issue.

Also, when more than a single node is labelled as Gateway node, the current
code was not handling it properly, this PR fixes it.

Fixes issue: submariner-io#1471
Signed-Off-by: Sridhar Gaddam <sgaddam@redhat.com>
sridhargaddam added a commit to sridhargaddam/submariner-operator that referenced this issue Jul 14, 2021
Submariner Endpoint stores the hostname info as part of the endpoint object.
In most of the K8s clusters, the hostname matches with the nodeName, but on
some clusters, it was seen that nodeName does not match. This PR fixes this
issue.

Also, when more than a single node is labelled as Gateway node, the current
code was not handling it properly, this PR fixes it.

Fixes issue: submariner-io#1471
Signed-Off-by: Sridhar Gaddam <sgaddam@redhat.com>
@sridhargaddam sridhargaddam self-assigned this Jul 14, 2021
@maayanf24 maayanf24 added this to In review in Submariner Project 0.10 Jul 14, 2021
@maayanf24 maayanf24 linked a pull request Jul 14, 2021 that will close this issue
sridhargaddam added a commit to sridhargaddam/submariner-operator that referenced this issue Jul 15, 2021
Submariner Endpoint stores the hostname info as part of the endpoint object.
In most of the K8s clusters, the hostname matches with the nodeName, but on
some clusters, it was seen that nodeName does not match. This PR fixes this
issue.

Also, when more than a single node is labelled as Gateway node, the current
code was not handling it properly, this PR fixes it.

Fixes issue: submariner-io#1471
Signed-Off-by: Sridhar Gaddam <sgaddam@redhat.com>
sridhargaddam added a commit that referenced this issue Jul 15, 2021
Submariner Endpoint stores the hostname info as part of the endpoint object.
In most of the K8s clusters, the hostname matches with the nodeName, but on
some clusters, it was seen that nodeName does not match. This PR fixes this
issue.

Also, when more than a single node is labelled as Gateway node, the current
code was not handling it properly, this PR fixes it.

Fixes issue: #1471
Signed-Off-by: Sridhar Gaddam <sgaddam@redhat.com>
@nyechiel nyechiel moved this from In review to Done in Submariner Project 0.10 Jul 20, 2021
sridhargaddam added a commit to sridhargaddam/submariner-operator that referenced this issue Jul 21, 2021
Submariner Endpoint stores the hostname info as part of the endpoint object.
In most of the K8s clusters, the hostname matches with the nodeName, but on
some clusters, it was seen that nodeName does not match. This PR fixes this
issue.

Also, when more than a single node is labelled as Gateway node, the current
code was not handling it properly, this PR fixes it.

Fixes issue: submariner-io#1471
Signed-Off-by: Sridhar Gaddam <sgaddam@redhat.com>
(cherry picked from commit 9d125f0)
sridhargaddam added a commit to sridhargaddam/submariner-operator that referenced this issue Jul 21, 2021
Submariner Endpoint stores the hostname info as part of the endpoint object.
In most of the K8s clusters, the hostname matches with the nodeName, but on
some clusters, it was seen that nodeName does not match. This PR fixes this
issue.

Also, when more than a single node is labelled as Gateway node, the current
code was not handling it properly, this PR fixes it.

Fixes issue: submariner-io#1471
Signed-Off-by: Sridhar Gaddam <sgaddam@redhat.com>
(cherry picked from commit 9d125f0)
dfarrell07 pushed a commit that referenced this issue Jul 27, 2021
Submariner Endpoint stores the hostname info as part of the endpoint object.
In most of the K8s clusters, the hostname matches with the nodeName, but on
some clusters, it was seen that nodeName does not match. This PR fixes this
issue.

Also, when more than a single node is labelled as Gateway node, the current
code was not handling it properly, this PR fixes it.

Fixes issue: #1471
Signed-Off-by: Sridhar Gaddam <sgaddam@redhat.com>
(cherry picked from commit 9d125f0)
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
No open projects
Development

Successfully merging a pull request may close this issue.

1 participant