Minikube & Hyper-V: Fix Start Host Error

Recently, I’ve been struggling with a Minikube issue on Windows 11 with Hyper-V enabled and decided to share a quick note about it. Many people opt for VirtualBox, but I believe Hyper-V is a superior option because it’s a higher-level hypervisor that offers better performance. It’s also readily available on Windows without the need to install additional tools.

However, it’s not without its flaws, and this issue serves as a prime example. I had installed Minikube and kubectl, then started the cluster. After conducting tests and stopping it, I was unable to restart it the following day. Minikube only reported:

Exiting due to GUEST_PROVISION: error provisioning guest: Failed to start host: recreate: creating host: create: creating: exit status 1

There was also recommendation to use minikube delete to fix issue, but it did not work. The problem was in Hyper-V, not in Minikube: cluster was not enable to start because of broken cache. Fortunately solution is very simple:

  1. Use minikube delete to remove leftovers
  2. Use services.msc to disable all Hyper-V services
  3. Navigate to C:\ProgramData\Microsoft\Windows\Hyper-V\Virtual Machines Cache and remove all cache
  4. Restart computer or just re-enable Hyper-V services

After these steps, minikube start will work again and will create cluster for you without issues.

Kubernetes: liveness & readiness probes with Nginx and PHP-FPM

Last time I wrote about linking PHP-FPM and Nginx on Kubernetes (but also Docker). It is very common configuration because PHP is so popular as backend and Nginx offers great performance with low resources usage. If we use such mix, we should also think more about proper health check in our cluster. Without that, it is possible clients will “hit the wall” if some of services will stop work or when we will add some important hotfix during normal work. Fortunately, Kubernetes offers us build-in solution to quickly determine state of our pods and containers inside them. Thanks to this, we can periodically check state and decide if something requires attention or automatic actions from infrastructure level. Let’s check them in term of mentioned PHP and Nginx configuration.

Continue reading “Kubernetes: liveness & readiness probes with Nginx and PHP-FPM”

Kubernetes: Nginx and PHP-FPM

When we want to use PHP-FPM, in most cases, we also need to use some of the web servers. Typical choice is Nginx because it is a very light, reliable, and configurable solution which can handle even very big traffic without any issues. There are two methods of linking Nginx and PHP-FPM on the backend: TCP connections and UNIX sockets. In this post, I would like to share them in term of Kubernetes configuration. It can be applied also on standard Docker solutions without issues.

Continue reading “Kubernetes: Nginx and PHP-FPM”

Kuberenetes: Exposing

Kubernetes are amazing, very powerful tool and even small details are important. Of course, in complex solutions we always use YAML files to control our cluster, but for small tests, projects and changes we can also use just some commands. In this short post I would like to describe how to expose our app using services. Thanks to this solution pods inside cluster will be able to communicate it other, also we will be able to reach them.

Continue reading “Kuberenetes: Exposing”

Recovering files on Google Cloud Storage

Google Cloud is a complex and very powerful platform. One of its components is Cloud Storage – based on buckets, a place where we can store files. It supports a lot of options like files versioning, saving metadata, generating signed URLs for downloading/pushing files etc. One of the most problematic options is data recovery: if you check Google Console, you will not see any option to do that. Does it mean we cannot recover deleted files? Fortunately, it is possible, but a bit tricky. Trick post is to explain how to do that.

Continue reading “Recovering files on Google Cloud Storage”