Skip to content

Commit

Permalink
ha: haproxy fix for start
Browse files Browse the repository at this point in the history
  • Loading branch information
marthanda93 committed May 2, 2021
1 parent b833223 commit 4a98f8b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 3 deletions.
50 changes: 50 additions & 0 deletions kubernetes/Bug_Control.md
Original file line number Diff line number Diff line change
@@ -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
```
1 change: 1 addition & 0 deletions kubernetes/ha/Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
4 changes: 2 additions & 2 deletions kubernetes/ha/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ cluster:

resources:
master:
cpus: 2
memory: 2048
cpus: 1
memory: 1024
count: 3
ip_prefix: 10
node:
Expand Down
1 change: 0 additions & 1 deletion kubernetes/ha/script/bootstrap_ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a98f8b

Please sign in to comment.