kubernetes: `make test-e2e-node REMOTE=true` fails with error `ssh: Could not resolve hostname`
What happened?
Execution of node e2e tests fails to ssh to the existing google cloud instance. here is a console output:
$ make test-e2e-node REMOTE=true
+++ [0114 23:09:26] Building go targets for linux/amd64
github.com/onsi/ginkgo/v2/ginkgo (non-static)
Creating artifacts directory at /tmp/_artifacts/230114T230935
Test artifacts will be written to /tmp/_artifacts/230114T230935
test-cos-beta-101-17162-40-52 us-west1-a n1-standard-1 XX.XX.XX.XXX XX.XX.XXX.XX RUNNING
Reusing host test-cos-beta-101-17162-40-52
Running tests remotely using
Project: service-mesh-296815
Image Project: cos-cloud
Compute/Zone: us-west1-a
Images:
Hosts: test-cos-beta-101-17162-40-52
Ginkgo Flags: -timeout=24h -nodes=8 -skip="\[Flaky\]|\[Slow\]|\[Serial\]" -untilItFails=false
Instance Metadata: user-data</home/ed/go/src/k8s.io/kubernetes/test/e2e_node/jenkins/gci-init.yaml,gci-update-strategy=update_disabled
Image Config File:
Kubelet Config File: test/e2e_node/jenkins/default-kubelet-config.yaml
Initializing e2e tests using host test-cos-beta-101-17162-40-52.
I0114 23:09:42.847154 9476 remote.go:72] Building archive...
I0114 23:09:42.847387 9476 build.go:43] Building k8s binaries...
+++ [0114 23:09:43] Building go targets for linux/amd64
k8s.io/kubernetes/cmd/kubelet (non-static)
k8s.io/kubernetes/test/e2e_node/e2e_node.test (test)
github.com/onsi/ginkgo/v2/ginkgo (non-static)
k8s.io/kubernetes/cluster/gce/gci/mounter (non-static)
k8s.io/kubernetes/test/e2e_node/plugins/gcp-credential-provider (non-static)
I0114 23:10:10.431747 9476 remote.go:106] Staging test binaries on "test-cos-beta-101-17162-40-52"
I0114 23:10:10.431788 9476 ssh.go:120] Running the command ssh, with args: [-o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o CheckHostIP=no -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o LogLevel=ERROR -i /home/ed/.ssh/google_compute_engine ed@test-cos-beta-101-17162-40-52 -- mkdir /tmp/node-e2e-20230114T231010]
E0114 23:10:28.631996 9476 ssh.go:123] failed to run SSH command: out: ssh: Could not resolve hostname test-cos-beta-101-17162-40-52: Name or service not known
, err: exit status 255
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> START TEST >
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Start Test Suite on Host test-cos-beta-101-17162-40-52
Failure Finished Test Suite on Host test-cos-beta-101-17162-40-52
failed to create workspace directory "/tmp/node-e2e-20230114T231010" on host "test-cos-beta-101-17162-40-52": command [ssh -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o CheckHostIP=no -o StrictHostKeyChecking=no -o ServerAliveInterval=30 -o LogLevel=ERROR -i /home/ed/.ssh/google_compute_engine ed@test-cos-beta-101-17162-40-52 -- mkdir /tmp/node-e2e-20230114T231010] failed with error: exit status 255 output: "ssh: Could not resolve hostname test-cos-beta-101-17162-40-52: Name or service not known\r\n"
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
< FINISH TEST <
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Failure: 1 errors encountered.
exit status 1
Makefile:273: recipe for target 'test-e2e-node' failed
make: *** [test-e2e-node] Error 1
What did you expect to happen?
e2e-node tests should be run on the instance
How can we reproduce it (as minimally and precisely as possible)?
- Run
make test-e2e-node REMOTE=trueon the latest k8s. - Ensure that it created the instance
- Run it again to make it to use existing instance
Anything else we need to know?
It looks like hack/make-rules/test-e2e-node.sh assumes that instance name is a resolvable host name, which is not the case, at least in my environment:
$ gcloud compute instances list |grep test-
test-cos-beta-101-17162-40-52 us-west1-a n1-standard-1 XX.XX.XX.XXX XX.XX.XXX.XX RUNNING
$ host test-cos-beta-101-17162-40-52
Host test-cos-beta-101-17162-40-52 not found: 2(SERVFAIL)
Kubernetes version
$ ./_output/bin/kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short. Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"27+", GitVersion:"v1.27.0-alpha.0.989+eabb70833a5649-dirty", GitCommit:"eabb70833a5649e10ab81f04423ce5cb16aba1b7", GitTreeState:"dirty", BuildDate:"2023-01-14T20:05:44Z", GoVersion:"go1.19.5", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.7
Cloud provider
Google
OS version
# On Linux:
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="18.04.6 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.6 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
$ uname -a
Linux devel 5.4.0-96-generic #109~18.04.1-Ubuntu SMP Thu Jan 13 15:06:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
</details>
### Install tools
<details>
</details>
### Container runtime (CRI) and version (if applicable)
<details>
</details>
### Related plugins (CNI, CSI, ...) and versions (if applicable)
<details>
</details>
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (18 by maintainers)
@bouaouda-achraf it’s not reproducible anymore. All test cases are failing, but that’s another story.