Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upSupport e2e testing via a bastion host for SSH commands #72286
Conversation
k8s-ci-robot
added
release-note-none
kind/bug
size/L
cncf-cla: yes
needs-sig
needs-priority
labels
Dec 21, 2018
smarterclayton
force-pushed the
smarterclayton:ssh
branch
from
b615bf4
to
190ec3b
Dec 21, 2018
This comment has been minimized.
This comment has been minimized.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: smarterclayton The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
k8s-ci-robot
added
the
approved
label
Dec 21, 2018
k8s-ci-robot
requested review from
kow3ns
and
soltysh
Dec 21, 2018
k8s-ci-robot
added
sig/testing
and removed
needs-sig
labels
Dec 21, 2018
smarterclayton
referenced this pull request
Dec 21, 2018
Merged
Support tunneling to masters over SSH for e2e tests #21700
k8s-ci-robot
added
release-note
and removed
release-note-none
labels
Dec 21, 2018
This comment has been minimized.
This comment has been minimized.
@kubernetes/sig-testing-pr-reviews we have configurations that have private nodes and I would like to ensure that e2e tests running as prow jobs on a k8s cluster can reach into those other clusters to do the full e2e suite |
This comment has been minimized.
This comment has been minimized.
/retest |
1 similar comment
This comment has been minimized.
This comment has been minimized.
/retest |
smarterclayton
referenced this pull request
Dec 24, 2018
Merged
Set KUBE_SSH_BASTION and KUBE_SSH_KEY_PATH in installer tests #2469
smarterclayton
force-pushed the
smarterclayton:ssh
branch
from
190ec3b
to
8472568
Dec 27, 2018
k8s-ci-robot
added
the
needs-rebase
label
Jan 10, 2019
smarterclayton
added some commits
Dec 21, 2018
smarterclayton
force-pushed the
smarterclayton:ssh
branch
from
8472568
to
88cac12
Jan 10, 2019
k8s-ci-robot
removed
the
needs-rebase
label
Jan 10, 2019
This comment has been minimized.
This comment has been minimized.
This is a more complete solution for #68792 |
smarterclayton
referenced this pull request
Jan 10, 2019
Merged
e2e: Fallback to internal IPs when using SSH in tests #68792
This comment has been minimized.
This comment has been minimized.
/retest
…On Thu, Jan 10, 2019 at 6:10 PM Kubernetes Prow Robot < ***@***.***> wrote:
@smarterclayton <https://github.com/smarterclayton>: The following tests
*failed*, say /retest to rerun them all:
Test name Commit Details Rerun command
pull-kubernetes-integration 88cac12
<88cac12>
link
<https://gubernator.k8s.io/build/kubernetes-jenkins/pr-logs/pull/72286/pull-kubernetes-integration/40880/> /test
pull-kubernetes-integration
pull-kubernetes-e2e-kops-aws 88cac12
<88cac12>
link
<https://gubernator.k8s.io/build/kubernetes-jenkins/pr-logs/pull/72286/pull-kubernetes-e2e-kops-aws/118909/> /test
pull-kubernetes-e2e-kops-aws
Full PR test history <https://gubernator.k8s.io/pr/72286>. Your PR
dashboard <https://gubernator.k8s.io/pr/smarterclayton>. Please help us
cut down on flakes by linking to
<https://git.k8s.io/community/contributors/devel/flaky-tests.md#filing-issues-for-flaky-tests>
an open issue
<https://github.com/kubernetes/kubernetes/issues?q=is:issue+is:open> when
you hit one in your PR.
Instructions for interacting with me using PR comments are available here
<https://git.k8s.io/community/contributors/guide/pull-requests.md>. If
you have questions or suggestions related to my behavior, please file an
issue against the kubernetes/test-infra
<https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:>
repository. I understand the commands that are listed here
<https://go.k8s.io/bot-commands>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#72286 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABG_p-eq2s_hsDkz7yzPovpGu_ezIX8uks5vB8h8gaJpZM4ZfGrH>
.
|
This comment has been minimized.
This comment has been minimized.
/retest |
This comment has been minimized.
This comment has been minimized.
@kubernetes/sig-node-pr-reviews need some eyes on this - nodes shouldn't be required to have external SSH access, and I think we're starting to get to the point where we shouldn't assume the e2e tests run from inside the security zone of a cluster. A bastion is reasonably simple with go-ssh (have been running this code in openshift for a while) and the code path is isolated so that if someone does hit bugs in this new path it doesn't impact others. |
k8s-ci-robot
added
the
sig/node
label
Jan 16, 2019
rphillips
reviewed
Jan 18, 2019
} | ||
bastionClient, err := ssh.Dial("tcp", bastion, config) | ||
if err != nil { | ||
err = wait.Poll(5*time.Second, 20*time.Second, func() (bool, error) { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
smarterclayton
Jan 21, 2019
Author
Contributor
the code in this case is a copy of sshutil.RunSSHCommand and I'm trying to keep the structure of the method consistent (can't reuse the constant across two packages since we don't want to expose it)
rphillips
reviewed
Jan 18, 2019
err = fmt.Errorf("failed running `%s` on %s@%s: '%v'", cmd, user, host, err) | ||
} | ||
} | ||
return bout.String(), berr.String(), code, err |
This comment has been minimized.
This comment has been minimized.
rphillips
Jan 18, 2019
Member
is it ok to buffer the entire stdout/stderr into memory? We may want to put the data into a limited buffer.
This comment has been minimized.
This comment has been minimized.
smarterclayton
Jan 19, 2019
Author
Contributor
This is no different than the other SSH stub, but generally yes, this is for test code only and the usage is constraint. We also dump the full output to the build logs, which is a disincentive to use this for a chatty channel.
So it's not great, but it's consistent with our existing flow, but in the future we should improve this structure (these are convenience commands that aren't really designed for anything other than quick and dirty testing).
rphillips
reviewed
Jan 18, 2019
|
||
func IssueSSHCommand(cmd, provider string, node *v1.Node) error { | ||
_, err := IssueSSHCommandWithResult(cmd, provider, node) | ||
if err != nil { |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
smarterclayton
Jan 19, 2019
Author
Contributor
this was a straight move, would prefer not to change the code.
This comment has been minimized.
This comment has been minimized.
/lgtm |
k8s-ci-robot
assigned
rphillips
Jan 21, 2019
k8s-ci-robot
added
the
lgtm
label
Jan 21, 2019
This comment has been minimized.
This comment has been minimized.
/retest |
smarterclayton commentedDec 21, 2018
•
edited
Issue: e2e tests should succeed even if nodes are not publicly available from where the tests are run
Until we port the remaining e2e tests to use exec host pods instead of SSH, it should be possible to use bastion host when clusters don't expose public IPs for nodes. Testers can use the KUBE_SSH_BASTION environment variable set to a
host:port
to specify the host that the tests will use as a jump host.If KUBE_SSH_BASTION is specified, the test will first connect to the bastion using SSH and the provider private key, then establish a tunnel from the bastion to the target node by its IP. If the node has an external IP, the external IP must be routable from the bastion.
Also support KUBE_SSH_KEY_PATH so there is a single cross-provider env var for setting the full path to the private key, which simplifies testing multiple clouds from the same infra.
/kind bug