[HN Gopher] Minikube quickly sets up a local Kubernetes cluster ... ___________________________________________________________________ Minikube quickly sets up a local Kubernetes cluster on macOS, Linux, and Windows Author : gjvc Score : 87 points Date : 2022-05-25 19:00 UTC (3 hours ago) (HTM) web link (minikube.sigs.k8s.io) (TXT) w3m dump (minikube.sigs.k8s.io) | _verandaguy wrote: | I'm not particularly involved with Kubernetes, but last I heard | (about 2 years ago), Minikube was on the way out (because it was | going into maintenance mode or something like that), and | Rancher's k3s was taking the mantle of "tiny local Kubernetes | server." | | What happened? Was active maintenance on Minikube resumed? | encryptluks2 wrote: | Where did you hear that? Minikube never ceases development. | pojzon wrote: | K3s started being super inefficient. Using up to 20% of cpu for | idle cluster. | | A lot of ppl decided to ditch it due to that. | skrtskrt wrote: | It's peaking at 8% CPU time on my 1-shared-vCPU digital ocean | droplet, spending most of its time below about 3% - I can't | imagine any modern laptop would blink at that usage. | pojzon wrote: | Search for Rasbian github issues. Raspberry community was | and is a big share in kubernetes lightwaight installations. | ClumsyPilot wrote: | Keep in mind that Pi is like an intel atom in | performance,and an old one to boot. | | If you have anything with a 'real' cpu from the last 5 | years, this problem is not going to exist for you | de6u99er wrote: | My preferred installation method on Linux is via brew [1] opposed | to the official installation instructions [2]. Additionally brew | contains formulaes for kubectl, k9s, helm, and many other | kubernetes related tools. It's the easiest way of keeping | everything up2date on a developer machine. | | [1] https://formulae.brew.sh/formula/minikube [2] | https://minikube.sigs.k8s.io/docs/start/ | nicce wrote: | Wow, I did not realise that you can use brew outside of Mac. | Thanks. | solarkraft wrote: | I knew, but am surprised anyone actually uses it. Are there | more of you? | jimmcslim wrote: | I have been using it on an WSL/Ubuntu instance just over | the last few days... for some things its pretty handy (e.g. | in the context of k8s I get a more up to date version of | the excellent kubectx utility via brew than apt). But for | others its bit of a pain, e.g. building Python through | pyenv and using OpenSSL in brew, etc. | qbasic_forever wrote: | Absolutely use and love homebrew on linux. All of the fun | rust-based tools that get posted here on hackernews (exa, | fd, ripgrep, fzf, etc.) are all there and much more up to | date than apt. Heck, I find brew is more up to date than | nix in some cases. | purerandomness wrote: | Why not use your distribution's native package installer? | qbasic_forever wrote: | k8s ecosystem tools are fast changing and native package | repos are woefully out of date. Minikube in particular has a | habit of just straight up breaking and requires a lot of | reading long github issues only to realize there's a fix in a | version just pushed 24 hours ago. | abdusco wrote: | I usually opt for k3d, because it gives you a cluster (or | multiple) that runs inside a docker container. If you already | have docker running, it's a quick and easy solution for setting | up and destroying local clusters. | | https://k3d.io/ | xenophonf wrote: | Anyone else experiencing DNS lookup failures on Minikube-managed | clusters running under VirtualBox? The host O/S or host DNS | server doesn't seem to matter. I've noticed this when trying to | build Alpine Linux-based images, an issue I reported here: | | https://github.com/kubernetes/minikube/issues/13968 | | I'm really at a loss as to how to troubleshoot this as I'm still | learning how to use Kubernetes. | chrisweekly wrote: | There was a "use minikube as a drop-in replacement for Socker | Desktop" post not too long ago... which is a pretty nice look if | it works OOB. | rckrd wrote: | That was my post. I'm one of the ex-maintainers of minikube and | skaffold as well. | | [0] https://matt-rickard.com/docker-desktop-alternatives/ | erulabs wrote: | I run a startup that lets folks attach clusters and I'll just | say, for development or on windows/OSX, I highly recommend k3s | and Rancher Desktop (which wraps k3s). Dramatically fewer issues | and cpu usage compared to minikube. | | Minikube does try to be more "correct", so it's possibly better | strictly for learning kubernetes or hacking on k8s itself. | LoveGracePeace wrote: | I've tried several of the kubes and k3s for my personal | projects works well. I'd use it for work too if I had different | options. I think Rancher Desktop might cost though so I use | kubectl to do everything. | claudiulodro wrote: | I'm late to the distributed system game, and I have a handful of | old PCs which I've been wanting to connect into some sort of | "supercomputer" or cluster as a learning exercise. Looking at the | docs, it seems to me like I could accomplish that in theory using | minikube, by treating the PCs as a local environment and managing | them all with k8s. Does that sound reasonable, am I way off base, | or is there a simpler method? | CraigJPerry wrote: | >> is there a simpler method? | | I think kind wins the simplest but microk8s might be a close | second | | https://ubuntu.com/tutorials/install-a-local-kubernetes-with... | thinkmassive wrote: | Avoid minikube for anything long-lived. | | If part of your objective is to learn how to build a k8s | cluster then I'd recommend building it with kubeadm. If you | just want to get something working, k3s or microk8s could | fulfill your needs. | nojito wrote: | I do the exact same thing with some mini pcs as a hobby. | killingtime74 wrote: | I would use K3s to set it up | ClumsyPilot wrote: | K3s and microK8S are both decent choices, K3S appear more | well-adopted and 'production grade' | mc4ndr3 wrote: | minikube is the best kept secret in the container industry. Use | minikube to match closer to prod on your local development | machine. | gofreddygo wrote: | Yes and being decoupled from Docker Machine is super | underestimated in the community IMHO. I switched seamlessly | between VirtualBox based and Docker Machine based clusters in | no time when Docker went rogue with their licensing. | | EDIT: we're talking dev environments only. Not prod. DO NOT put | minikube in prod. | dvtrn wrote: | _DO NOT put minikube in prod._ | | I'm watching this happen in real time at the current gig. I | brought up my concerns to the senior in charge of this. He's | doing it anyway. | | Let you know how that goes. | solarkraft wrote: | What are the concerns? I keep hearing the same "don't use | it in prod" about docker, yet I know quite a few (small- | ish) operations successfully running on it. | deepsun wrote: | Hm, never heard against Docker in cloud (since early | times of Docker). Only about keeping your database in | Docker -- yes, that was arecommentadion some 5+ years ago | and maybe now as well. | thinkmassive wrote: | Minikube isn't intended to run production services. | You'll encounter a lot of constraints that don't exist on | a real cluster, and you'll likely lose important data if | you use it very long. | | Docker made sense to use in production because people | wanted to run containers. | | What could possibly be the justification for running | production workloads on minikube? | mt42or wrote: | Totally agree. | de6u99er wrote: | What do you mean by "best kept secret"? | skrtskrt wrote: | It's secretly used in almost every kubernetes tutorial on the | internet | mongol wrote: | What I have not understood with running K8S locally. Do I need to | run a separate container registry? Or can it read my containers | from disk? | swozey wrote: | You can run minikube image load image:tag to pull images from | your container runtime: | https://minikube.sigs.k8s.io/docs/handbook/pushing/#7-loadin... | ozarker wrote: | Not sure here but the local k8s setup included with docker | desktop uses your local registry. The downside is you have to | use docker desktop...... | EdwardDiego wrote: | You can push images into it, or use it as your docker/podman | daemon, so the images are built directly in there, at least | with minikube. This command does the trick for the current | shell session: eval $(minikube docker-env) | ewuhic wrote: | How does one automate the minikube (or any other flavor) | provisioning and setting up the dev environment matched to prod | so there would be as little friction as possible? | | Talking of something, which idempotently installs minikube if | necessary, pulls images from the remote registry, sets up the | network with DNS... Is there such a tool? | hhh wrote: | Rancher Desktop, wonderful tool on OS X and Windows when i've | used it. | baq wrote: | as someone late to the party, what's the local development auto- | reload, auto-deployment, etc. story in k8s? i can set up a k8s | instance with that or k3s or microk8s or whatever relatively | easily, but how do i get my code into there without having to | build and push images after the smallest change? short googling | points to skaffold[0], but is that state of the art? | | [0] https://skaffold.dev/ | rdli wrote: | (Note: I work on Telepresence) | | There's a bunch of semi-opinionated tools like Skaffold: | Garden, Tilt (just bought by Docker), Docker Compose, and of | course, the trusty ol' shell script powered by kustomize. | | We wrote Telepresence because we found that everyone has their | own snowflake-ish workflow once you get beyond the base case of | "build container, kubectl apply", so we decided to focus just | on the inner dev loop, and then integrate with your preferred | workflow. YMMV. | mrj wrote: | I'm currently working on creating a local dev with | https://tilt.dev/ and having a good time | godtoldmetodoit wrote: | +1 on Tilt. It just works. | ClumsyPilot wrote: | Tilt is excellent, and unlike other fools it does not ise | YAML, it uses python - real programming language- so you can | deal with any strange scoping, pathing,or arbitrary logic | like 'look for this file in this folder, but only on second | tuesday after full moon' | | And it is declarative. Try it, and you will never look back | sound1 wrote: | enjoyed your comment! | stusmall wrote: | I appreciate the comments on this because its confirming my own | experience with k8s local dev best practices. As I write this | there are 5 comments with 4 different technologies. | | For a less cheeky answer, I'm currently using skaffold but I'm | not in love with it. It does the job but has some rough edges | qbasic_forever wrote: | Skaffold is in my experience the best tool in this space, but | there are ton of promising options. There's a really nice VS | Code plugin from google that basically adds a whole workflow | based on skaffold to the IDE: | https://cloud.google.com/code/docs/vscode or | https://marketplace.visualstudio.com/items?itemName=GoogleCl... | Despite a lot of focus on Google's hosted k8s offersings, the | cloud code extension happily works with minikube and other | local clusters. | skinnyarms wrote: | Skaffold is great, I'm hearing good things about Tilt though so | I was planning on giving it a whirl soon. | scottm01 wrote: | Check out Devspace: https://devspace.sh/ | | Gives you a fairly slick "hot reload" experience in k8s | (minikube-created or not). | ranger207 wrote: | For webdev, my team has the build output directory mounted as | hostPath volumes, so you change the files on your disk and the | changes are reflected in the pod | yrro wrote: | odo, perhaps? | | https://developers.redhat.com/products/odo/overview | jdoliner wrote: | I used minikube for a long time, it's pretty good but I found | kind to be a lot nicer of an experience and eventually switched. | | https://kind.sigs.k8s.io/ | nimbius wrote: | not a bad tool but you get ~90% of the same functionality with | podman, it doesnt need to run as root, and it supports user | scoped service definitions and control in systemd. | pitacracker wrote: | You're comparing apples and oranges. | thinkmassive wrote: | You can use kind with podman, and also rootless | | https://kind.sigs.k8s.io/docs/user/rootless/ | spockz wrote: | I can second this. Kind seems so much nicer. With minikube I | was somehow constantly messing with virtualisation frameworks. | Kind just works. | thinkmassive wrote: | Agree, Minikibe occupies a strange middle ground of being | ephemeral but heavyweight. It's slow enough to make it seem | worth maintaining the same cluster over time, but that was a | bad approach when I tried it. | | Kind is very clearly ephemeral, and it starts up quickly | enough that it's not annoying to deal with frequent restarts | while developing setup scripts. | outime wrote: | Yep, _kind_ is IMHO the way to go for most of the use cases. | Really fast to set up new clusters and low resource consumption | due to its nature. | semitones wrote: | We use minikube for local development, very useful. | TruthWillHurt wrote: | What's the point of this post other than to rake points? | glitchcrab wrote: | Yeah, I really don't see why this belongs here - anyone who is | remotely involved with kubernetes knows about minikube, kind | etc. This isn't news. | CSDude wrote: | I've noticed that minikube can also setup multi node cluster | which can be nice to simulate some things. | | https://minikube.sigs.k8s.io/docs/tutorials/multi_node/ | deepsun wrote: | Long time ago I remember Minikube destroyed your hard drive (too | many small writes bad for SSDs). Is it fixed now? | executive wrote: | For Win10 Pro users, Minikube can run directly on Hyper-V. ___________________________________________________________________ (page generated 2022-05-25 23:00 UTC)