-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Conversation
[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 |
There was a problem hiding this 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 :( |
There was a problem hiding this comment.
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 ?
|
||
// 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 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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) ?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this 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)") |
There was a problem hiding this comment.
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) ") |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
This PR hasn't seen an update in a while. Do you intend on pushing a newer version up soon? |
I will make a newer PR once the command runner PR is merged #5530 |
No description provided.