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

Add new driver "SSH" to bootstrap generic minkube clusters over ssh #10099

Merged
merged 32 commits into from
Jan 19, 2021

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Jan 6, 2021

New year, new attempt of the generic driver...

This driver connects to an already existing virtual machine,
using the provided IP address and SSH user/key/port parameters.

On this machine, libmachine will provision the docker daemon
and minikube will bootstrap the kubernetes cluster (as usual).

Rebased version of #9545 #6873 #4734

Closes #4733 #9583

This driver connects to an already existing virtual machine,
using the provided IP address and SSH user/key/port parameters.

On this machine, libmachine will provision the docker daemon
and minikube will bootstrap the kubernetes cluster (as usual).
It is not supported anyway, and just throws errors.
There is no use to restart or to retry, just give up.

This should never be a problem with "none", though.
That always return running, while generic tests ssh.
All drivers *must* be in "supportedDrivers"

Delete Podman on Darwin (Mac), not available
It was failing to install the "docker" package

Since the provisioning was defaulting to ISO
Since we don't know the remote machine type anyway,
it could be a virtual machine or a physical server.

But we don't add any _extra_ isolation for minikube,
so go with "bare metal machine" machine type for now.
It was only called for existing machines, not for new.

But other commands expect to be able to run "docker".
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 6, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 6, 2021
@afbjorklund afbjorklund removed the request for review from blueelvis January 6, 2021 17:44
The "none" driver has redefined stop and start to mean the
kubelet rather than the host itself. Use the same API here.

Killing actual containers remotely remains to be implemented.
Only stop the kubelet service for now, and assuming systemd.
@afbjorklund
Copy link
Collaborator Author

@medyagh : I forked the "generic" driver and changed the start/stop implementation, so now it looks more like the "none" driver.

This also means that both drivers are now free to be renamed or aliased or whatever, since they are no longer using libmachine.

@afbjorklund afbjorklund changed the title WIP: Add minikube support for the "generic" VM driver Add minikube support for the "generic" VM driver Jan 6, 2021
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 6, 2021
Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mostly looks good just a couple knits.
btw do u mind pasting an example in the output I am curious how it looks for minikube start

pkg/drivers/generic/generic.go Outdated Show resolved Hide resolved
pkg/drivers/generic/generic.go Outdated Show resolved Hide resolved
cmd/minikube/cmd/start_flags.go Outdated Show resolved Hide resolved
cmd/minikube/cmd/start_flags.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jan 8, 2021
But most of it is identical to the "none" driver
@tstromberg
Copy link
Contributor

What would you think about an alternate name for this, such as "ssh" or "remote"?

generic feels difficult to reason about.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jan 8, 2021

What would you think about an alternate name for this, such as "ssh" or "remote"?

generic feels difficult to reason about.

The fork (from libmachine) is now completed, so the drivers can be renamed.

We had originally planned to do it as a separate feature, though: #7772

The boring names were local and remote, but there were also some more creative suggestions

Like "bare metal" or "cloud" and also "native". But not stuck with none and generic anymore...

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jan 8, 2021

Think we will leave the provisioner as-is, and leave that to the other feature: #9989

But right now it works differently for ubuntu and for any other distributions.

So we might want to add some specific KIC-check, to the "ubuntu" provisioner ?

func (p *UbuntuProvisioner) String() string {
        return "ubuntu"
}

// CompatibleWithHost checks if provisioner is compatible with host
func (p *UbuntuProvisioner) CompatibleWithHost() bool {
        return p.OsReleaseInfo.ID == "ubuntu"
}

Because it is hard-coded for KIC, so we don't really "detect" it anyway.

@medyagh
Copy link
Member

medyagh commented Jan 8, 2021

What would you think about an alternate name for this, such as "ssh" or "remote"?

generic feels difficult to reason about.

I would vote for SSH name since everything in the flags points to SSH.
wdyt @afbjorklund to change the name to SSH driver?

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jan 9, 2021

What would you think about an alternate name for this, such as "ssh" or "remote"?
generic feels difficult to reason about.

I would vote for SSH name since everything in the flags points to SSH.
wdyt @afbjorklund to change the name to SSH driver?

I thought all drivers were using ssh to talk to the machine, even docker ?
Well, maybe with the exception of the none driver that uses regular exec.

But we can go with ssh...

Will change the code, to see what we end up with. Like: IsBareMetal or IsSSH

@afbjorklund afbjorklund changed the title Add minikube support for the "generic" VM driver Add minikube support for the "ssh" driver Jan 9, 2021
@medyagh
Copy link
Member

medyagh commented Jan 13, 2021

@afbjorklund there seem to be a build error need to be fixed

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Jan 13, 2021

@medyagh : yeah, happened in 36d94a2

Basic integration error, from not doing CI

@medyagh
Copy link
Member

medyagh commented Jan 13, 2021

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jan 13, 2021
@medyagh medyagh changed the title Add minikube support for the "ssh" driver Add new driver support for the "ssh" driver Jan 13, 2021
@medyagh medyagh changed the title Add new driver support for the "ssh" driver Add new driver "SSH" to bootstrap generic minkube clusters over ssh Jan 13, 2021
cmd/minikube/cmd/start.go Show resolved Hide resolved
@medyagh medyagh self-requested a review January 15, 2021 22:29
cmd/minikube/cmd/start_flags.go Outdated Show resolved Hide resolved
pkg/drivers/ssh/ssh.go Outdated Show resolved Hide resolved
pkg/minikube/config/types.go Outdated Show resolved Hide resolved
@afbjorklund
Copy link
Collaborator Author

Things got a bit hard to read, when the machine driver was renamed.

i.e sshIPAddress, sshSSHUser, sshSSHKey, sshSSHPort

Easy to confuse the name of the driver (ssh) with the protocol (ssh)

Normally the IP of the VM is the same for all uses, though

@medyagh
Copy link
Member

medyagh commented Jan 16, 2021

/retest-this-please

@medyagh medyagh merged commit ce655bc into kubernetes:master Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support the "generic" driver, for user provided VMs
4 participants