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 kubepod driver #22

Closed
tonistiigi opened this issue Apr 16, 2019 · 5 comments · Fixed by #167
Closed

add kubepod driver #22

tonistiigi opened this issue Apr 16, 2019 · 5 comments · Fixed by #167
Labels
kind/enhancement New feature or request

Comments

@tonistiigi
Copy link
Member

Similarly to docker-container driver there could be a support to kubepod driver that bootstraps itself inside a k8s cluster. Kube endpoints in docker context can be used for providing initial configuration. Switching between drivers implemented in #20 . Would be nice if all supported platforms of k8s workers could be also detected automatically.

@AkihiroSuda

@tonistiigi tonistiigi added the kind/enhancement New feature or request label Apr 16, 2019
@AkihiroSuda
Copy link
Collaborator

Bikeshedding: kubepod? kube-pod? k8s-pod? (I prefer kube-pod)

@tonistiigi
Copy link
Member Author

kube-pod seems consistent with docker-container

AkihiroSuda referenced this issue in AkihiroSuda/buildkit_poc Apr 19, 2019
Fix moby#769
Relates to tonistiigi/buildx#22

Usage:

  $ kubectl run --generator=run-pod/v1 --image moby/buildkit:master-rootless bk -- --oci-worker-no-process-sandbox
  $ export BUILDKIT_HOST=kube-pod://bk

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
AkihiroSuda referenced this issue in AkihiroSuda/buildkit_poc Apr 19, 2019
Fix moby#769
Relates to tonistiigi/buildx#22

Usage:

  $ kubectl run --generator=run-pod/v1 --image moby/buildkit:master-rootless bk -- --oci-worker-no-process-sandbox
  $ export BUILDKIT_HOST=kube-pod://bk

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@AkihiroSuda
Copy link
Collaborator

Maybe we should prioritize adding Deployment driver.

  • docker buildx create --driver kube --driver-opt replicas=N will createDeployment with N replicas.
    We should not use StatefulSet because creating StatefulSet pod replicas is slow due to the pod creation order constraint.
  • docker buildx rm will remove the Deployment
  • docker buildx stop should be NOP? Or resize the Deployment to 0 replica?
  • docker buildx build will connect to a Pod in Deployment using kubectl exec -it POD buildctl dial-stdio. An alternative way is to set up mTLS (which is mandatory to protect the daemon from the executor containers) and Service, but it is not straightforward to manage the lifecycle of the certificates.
  • To choose a Pod in Deployment, we can implement both random and consistenthash. As we are not going to use StatefulSet, consistenthash will break on recreation of ReplicaSet (on rolling update of Deployment). Probably this is not a huge deal.
  • docker buildx inspect will show the name of the Deployment.
  • The user will be able to do rolling update of the buildkitd image using kubectl set image,
  • The user will be able to change the number of the replicas using kubectl scale.

@tonistiigi
Copy link
Member Author

@AkihiroSuda SGTM, except the k8s objects should probably be created on build/bootstrap, not on create.

@AkihiroSuda
Copy link
Collaborator

PR #167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants