

Minikube - Developing and Testing locally with K8s
source link: https://devops.datenkollektiv.de/minikube-developing-and-testing-locally-with-k8s.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

This post walks you through the first fundamental steps to get minikube up and running with homebrew.
Minikube - minikube is local Kubernetes, focusing on making it easy to learn and develop for Kubernetes.
TL;DR
start
minikube
$ brew install hyperkit $ brew install minikube $ minikube start --driver=hyperkit --memory 12000 --cpus 6 😄 minikube v1.24.0 on Darwin 12.0.1 ✨ Using the hyperkit driver based on user configuration … 🌟 Enabled addons: storage-provisioner, default-storageclass 🏄 Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
hyperkit - HyperKit is a toolkit for embedding hypervisor capabilities in your application.
Private Registries
You can find all you need in the official documentation: Using a Private Registry
It’s a fancy mix of the minikube add-on registry and the Linux command socat
- Multipurpose relay (SOcket CAT):
Note: Enabling and configuring the add-on is only required once.
$ minikube addons enable registry ▪ Using image registry:2.7.1 ▪ Using image gcr.io/google_containers/kube-registry-proxy:0.4 🔎 Verifying registry addon... 🌟 The 'registry' addon is enabled
minikube addons configure registry-creds
Reconfigure the specs
Found this helpful hint about how to re-config
a cluster here: Kubernetes Minikube Tutorial for Beginners
minikube stop minikube config set memory 2500 minikube config set cpus 2 minikube start
😏 No need to tear down the cluster if the initial sizing was wrong.
The End
Finally delete
the cluster with:
$ minikube delete --all --purge 🔥 Deleting "minikube" in hyperkit ... 💀 Removed all traces of the "minikube" cluster. 🔥 Successfully deleted all profiles 💀 Successfully purged minikube directory located at - [/Users/devop/.minikube]
Bonus - The Docker Environment
Giving this combo a try was inspired by Replacing Docker Desktop with hyperkit + minikube.
If you are a regular docker
user you can continue using it piggybacked with your minikube installation.
Switch on docker-env
to "Configure environment to use minikube’s Docker daemon"
docker-env
eval $(minikube docker-env)
eval $(minikube docker-env) docker run --rm -it --network=host alpine ash -c "apk add socat && socat TCP-LISTEN:5000,reuseaddr,fork TCP:$(minikube ip):5000"
Docker commands using volume mounts like -v "$PWD":/workdir
will not work out of the box due to minikube running in it's own environment.
Tip: Mount local working directory via
minikube mount $(pwd)/workdir:/workdir
🙌 Photo by Crissy Jarvis on Unsplash
Recommend
-
164
minikube minikube implements a local Kubernetes cluster on macOS, Linux, and Windows. minikube's primary goals are to be the best tool for local Kubernet...
-
54
This post is contributed by Wesley Pettit , Software Engineer at AWS. As more companies adopt containers, developers need easy, powerful ways to test their...
-
14
Testing Application Monitoring Locally with a Docker Composition Prometheus Operator For Developers (3 Part Series) In the
-
8
Building a Serverless RPC API on AWS: Emulating & Testing Locally Sep 23, 2021 • Matt TylerTags: rpc
-
6
Testing Locally is Slowing You Down If you're not using a live test environment, you're making your life harder than it needs to be. Tell me if this sounds familiar? You're building a backend applicat...
-
6
How To Install Kubernetes On Ubuntu 20.04 – Kubeadm And Minikube Reading Time: 2 minutes In this article, we will see how...
-
6
Developing Quarkus and Web Applications locally Developing backend or frontend applications locally often involves access to other remote services, for example databases. This article describes how de...
-
6
// Tutorial //How To Use minikube for Local Kubernetes Development and TestingPublished on February 28, 2022Deployment
-
7
在mac上利用minikube 搭建k8s环境或多或少会因为pull镜像失败而搭建不成功, 本文介绍两种在mac上利用minikube 搭建k8s环境的方法; 一种是通过VPN翻墙利用官方minikube 搭建k8s 环境, 另外一种是借助阿里云的minikube版本来搭建k8s环境; 利用官方miniku...
-
4
Running and testing AWS Lambda container images locally If you are packaging a Lambda as a Docker container image, to run locally start with: ...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK