diff --git a/kubernetes/Bug_Control.md b/kubernetes/Bug_Control.md new file mode 100644 index 0000000..5a1cb75 --- /dev/null +++ b/kubernetes/Bug_Control.md @@ -0,0 +1,50 @@ +# Error Control Vagrant Kubernetes +While using `vagrant / vagrantfile` you can encounter of some errors, try to add few errors which faced during development of `kubernetes vagrant` file with solutions which worked whenever faced issues. + +### SSH connection get timeout or say ssh connection got reset, something like below error + +```bash +SSH connection was reset! This usually happens when the machine is +taking too long to reboot. First, try reloading your machine with +`vagrant reload`, since a simple restart sometimes fixes things. +If that doesn't work, destroy your machine and recreate it with +a `vagrant destroy` followed by a `vagrant up`. If that doesn't work, +contact support. +``` + +> Then can try to add below config to your vagrantfile +```bash + config.vm.boot_timeout = 600 +``` + +> if still not solved then best can try +```bash +$ rm -rf .vagrant +``` + +### While creating VM, vagrant failed to rename vm because of unclear vms +```bash +The name of your virtual machine couldn't be set because VirtualBox +is reporting another VM with that name already exists. Most of the +time, this is because of an error with VirtualBox not cleaning up +properly. To fix this, verify that no VMs with that name do exist +(by opening the VirtualBox GUI). If they don't, then look at the +folder in the error message from VirtualBox below and remove it +if there isn't any information you need in there. + +VirtualBox error: + +VBoxManage: error: Could not rename the directory '/Users/XXXXXXX/VirtualBox VMs/ubuntu-18.04-amd64_1619926105557_22107' to '/Users/XXXXXXX/VirtualBox VMs/load-balancer' to save the settings file (VERR_ALREADY_EXISTS) +VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component SessionMachine, interface IMachine, callee nsISupports +VBoxManage: error: Context: "SaveSettings()" at line 3249 of file VBoxManageModifyVM.cpp +``` + +> Simple can run command with path from error +```bash +$ rm -rf /Users/XXXXXXX/VirtualBox VMs/load-balancer +``` + +> Better to comment below line from your vagrantfile +```bash + config.ssh.keep_alive = true +``` \ No newline at end of file diff --git a/kubernetes/ha/Vagrantfile b/kubernetes/ha/Vagrantfile index 932141d..053a640 100644 --- a/kubernetes/ha/Vagrantfile +++ b/kubernetes/ha/Vagrantfile @@ -20,6 +20,7 @@ MSG Vagrant.configure(k8s['api_version']) do |config| config.vm.boot_timeout = 600 + # config.ssh.keep_alive = true # Load Balancer vm if File.exist?('lib/ha.rb') diff --git a/kubernetes/ha/config.yaml b/kubernetes/ha/config.yaml index 3347800..d6ab347 100644 --- a/kubernetes/ha/config.yaml +++ b/kubernetes/ha/config.yaml @@ -11,8 +11,8 @@ cluster: resources: master: - cpus: 2 - memory: 2048 + cpus: 1 + memory: 1024 count: 3 ip_prefix: 10 node: diff --git a/kubernetes/ha/script/bootstrap_ha.sh b/kubernetes/ha/script/bootstrap_ha.sh index ddf6f34..e861358 100644 --- a/kubernetes/ha/script/bootstrap_ha.sh +++ b/kubernetes/ha/script/bootstrap_ha.sh @@ -22,7 +22,6 @@ $(for i in $(eval echo {1..$4}); do echo " server $3-$i $2.$((10 + $i)):6443 check fall 3 rise 2" done) END -systemctl enable --now haproxy modprobe overlay modprobe br_netfilter