如何完全清除minikube配置或将IP重新设置为192.168.99.100 [英] How to completely purge minikube config or reset IP back to 192.168.99.100

查看:526
本文介绍了如何完全清除minikube配置或将IP重新设置为192.168.99.100的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想彻底清除Minikube,以便可以像重新安装第一次一样重新开始,以避免某些配置冲突. Mailnly拥有初始IP 192.168.99.100,不幸的是它在下一个minikube start上增加到192.168.99.101,依此类推.我已经运行了删除Minikube的操作:

I want to completely purge Minikube so that I could start over as if I installed it for the first time to avoid some configuration clashes. Mailnly to have initial IP 192.168.99.100, unfortunatelly it increases on next minikube start to 192.168.99.101, etc. I've run to delete Minikube:

minikube delete rm -rf ~/.minikube rm -rf ~/.kube

minikube delete rm -rf ~/.minikube rm -rf ~/.kube

我正在使用驱动程序VirtualBox 5.2.18在Ubuntu 18.04上运行minikube版本:v0.31.0

I'm running minikube version: v0.31.0 on Ubuntu 18.04 with driver VirtualBox 5.2.18

推荐答案

Minikube在不同的平台上使用,因此添加与最受欢迎的平台有关的信息可能会有所帮助.

Minikube is used on different platforms, so it might be helpful to add information related to most popular of them.

Minikube不负责为其虚拟机分配IP地址.

Minikube is not responsible for assigning IP address to its VM.

如果要在Windows或MacOS上启动minikube,则会创建新的VM.该VM从系统管理程序DHCP服务池中获取第一个可用的IP地址.简而言之,DHCP服务会为虚拟机保留此IP一段时间,通常为24小时到7天.如果在此期间客户端不刷新DHCP租约并且该IP在网络上不可用,则该IP被认为是免费的,可以提供给另一个客户端.

If you are starting minikube on Windows or MacOS new VM is created. That VM gets the first available IP address from the pool of hypervisor DHCP service. In brief, DHCP service reserves this IP for the VM for some period of time, usually from 24 hours to 7 days. If in this period the client doesn't refresh DHCP lease and this IP is not available on the network, the IP is considered free and can be offered to another client.

VirtualBox的DHCP服务只有基本设置,不允许您配置租约时间或静态IP绑定.因此,在使用minikube ssh创建VM之后,您可以尝试更改minikube VM网络接口的IP配置.或者您可以在创建后立即使用VM MAC地址,因为DHCP提供基于主机MAC地址的IP地址.

VirtualBox has only basic settings for its DHCP service, you are not allowed to configure lease time or static ip binding. So, you may try to change ip configuration of minikube VM network interface, after VM is created using minikube ssh. Or you can play with VM MAC address right after creation because DHCP offers IP address based on host MAC address.

HyperV将本地网络上现有的DHCP用于共享网络,或将手动配置的DHCP服务器用于内部网络.如果可以访问DHCP管理控制台,则可以在使用minikube start启动新VM之前删除旧的minikube VM IP绑定.

HyperV uses existed DHCP on local network for shared networks or manually configured DHCP server for internal networks. If you have access to DHCP administration console you can delete the old minikube VM IP binding before starting a new VM using minikube start.

对于Linux,您可以选择两个选项,可以使用virtualbox虚拟机管理程序并像在Windows或MAC上运行一样创建VM,因此DHCP可以像我之前提到的那样工作,或者可以使用-vm-driver=none参数并设置Kubernetes集群内部主机环境而无需VM.在这种情况下,您的主机将成为具有相同IP配置的Kubernetes主节点.

For Linux you can choose two options, you can use virtualbox hypervisor and create VM like it works on Windows or MAC, so DHCP will work like I've mentioned previously, or you can use -vm-driver=none argument and setup Kubernetes cluster inside host environment without VM. In this case your host machine becomes a Kubernetes master node with the same IP configuration.

这篇关于如何完全清除minikube配置或将IP重新设置为192.168.99.100的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆