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

WIP (Early): kic (improved VM-free: deploy Kubernetes to containers) #5188

Closed
wants to merge 20 commits into from

Conversation

medyagh
Copy link
Member

@medyagh medyagh commented Aug 23, 2019

No description provided.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 23, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh

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 Aug 23, 2019
Copy link
Collaborator

@afbjorklund afbjorklund left a comment

Choose a reason for hiding this comment

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

Need to take a more detailed look, both at the difference between bootstrappers (kubeadm and kic) and of course on the github.com/medyagh/kic code itself. Some kind of design document would be great as well.

Keep up the good work!

func NewDriver(c Config) *Driver {
runner := &command.OciRunner{} // MEDYA:TODO pass the node selector
// runtime, err := cruntime.New(cruntime.Config{Type: c.ContainerRuntime, Runner: runner})
// Libraries shouldn't panic, but there is no way for drivers to return error :(
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you are doing too much work in the factory, it is only supposed to return the object.

The actual creation of runtime and what not, should not happen until it is actually used ?

cmd/minikube/cmd/start.go Show resolved Hide resolved

// Remove a host, including any data which may have been written by it.
func (d *Driver) Remove() error {
// TODO: remove the image from cache maybe ?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Probably not

Copy link
Collaborator

Choose a reason for hiding this comment

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

The cache belongs to the runtime that started the node, you could clean up the images in your containerd - but I suppose that will happen anyway

@@ -29,8 +29,17 @@ import (
"github.com/docker/machine/libmachine/ssh"
"github.com/golang/glog"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/minikube/constants"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, this makes the docker-machine drivers depend on minikube again ?

Copy link
Member Author

Choose a reason for hiding this comment

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

good catch ! will remove that


const driverName = constants.DriverKic

// Driver is a driver designed to run kubeadm inside a container
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it really hard-coded to kubeadm ? Seems most of that happens in the bootstrapper ?

if err != nil {
return "", err
}
return fmt.Sprintf("tcp://%s:2376", ip), nil
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are you really running your own nested Docker daemon (port 2376) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

if I am not mistaken that is the port that bing the container to the kube-api server to be sued in kubeconfig.
the docker one is 2375. i do not use my own docker-daemon, kick uses containerd

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, containerd runs on a Unix socket as far as I know. So basically you don’t offer a (Docker) URL anyway...


// MEDYA:TODO
// if alread exists use docker inspect --format '{{ .NetworkSettings.IPAddress }}' d.MachineName
ip, err := net.ChooseBindAddress(nil)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Hmm, so this is returning the docker host address. I would have expected a docker address like 172.17.0.2

Or at least localhost, rather than the default bind address. This is similar to the current issues with none

Copy link
Member Author

Choose a reason for hiding this comment

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

I actually dont know what would be best here. what are the current issues with none binding address ?

do you think it is better to bind on localhost ? or on the private ip that machine has ?

I was thinking we let the user pass the ip if they want to. so it doesnt have to be localhost. for mroe advanced options !

I am all ears for any recommednaiton on the bind address

Copy link
Collaborator

Choose a reason for hiding this comment

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

@afbjorklund afbjorklund added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2019
@tstromberg tstromberg changed the title Early WIP: kic Early WIP: kic (improved VM-free: deploy Kubernetes to containers) Aug 27, 2019
@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 Aug 27, 2019
Copy link
Contributor

@tstromberg tstromberg left a comment

Choose a reason for hiding this comment

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

Adding some kind of design doc that can be added to our documentation site would be super great to fully understand what we're reviewing.


// kic
startCmd.Flags().String(kicImg, "", "override the kic image. (Only to be used with on with kic driver) ")
startCmd.Flags().String(ociClient, "docker", "the oci client to be used. (Only to be used with on with kic driver)")
Copy link
Contributor

Choose a reason for hiding this comment

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

To avoid introducing an additional level of confusing concepts, I think this should use --driver=docker (and rename --vm-driver to --driver)

@@ -197,6 +201,11 @@ func initDriverFlags() {

// hyperv
startCmd.Flags().String(hypervVirtualSwitch, "", "The hyperv virtual switch name. Defaults to first found. (only supported with HyperV driver)")

// kic
startCmd.Flags().String(kicImg, "", "override the kic image. (Only to be used with on with kic driver) ")
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we use --image? I would prefer not to have kic as a second brandname that users need to learn about.

limitations under the License.
*/

package kic
Copy link
Contributor

Choose a reason for hiding this comment

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

How can we improve the bootstrapper interface and/or kubeadm enough to prevent the abstraction leakage that makes it necessary for kic to have it's own kubeadm driver?

I'm sure it's the easiest for the initial implementation, but for production, I would rather see about improving our existing code than introducing a second subtly different kubeadm bootstrapper.

@afbjorklund afbjorklund changed the title Early WIP: kic (improved VM-free: deploy Kubernetes to containers) WIP (Early): kic (improved VM-free: deploy Kubernetes to containers) Aug 31, 2019
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 31, 2019
@tstromberg
Copy link
Contributor

This PR hasn't seen an update in a while. Do you intend on pushing a newer version up soon?

@medyagh medyagh closed this Oct 14, 2019
@medyagh
Copy link
Member Author

medyagh commented Oct 14, 2019

I will make a newer PR once the command runner PR is merged #5530

@medyagh medyagh deleted the kic branch October 14, 2019 23:04
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. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants