Skip to content

Commit

Permalink
ha: ssh timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
marthanda93 committed May 2, 2021
1 parent 87bd2b5 commit 0b797cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions kubernetes/ha/lib/trigger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,8 @@
system("vagrant ssh --no-tty -c 'cat /opt/certificates/admin.pem' " + k8s['cluster']['ha'] + " > ${HOME}/.kube/admin.pem")
system("vagrant ssh --no-tty -c 'cat /opt/certificates/admin-key.pem' " + k8s['cluster']['ha'] + " > ${HOME}/.kube/admin-key.pem")
system("kubectl config set-cluster kubernetes-the-hard-way --certificate-authority=${HOME}/.kube/ca.pem --embed-certs=true --server=https://#{k8s['ip_part']}.#{k8s['resources']['ha']['ip_prefix']}:6443 && kubectl config set-credentials admin --client-certificate=${HOME}/.kube/admin.pem --client-key=${HOME}/.kube/admin-key.pem && kubectl config set-context kubernetes-the-hard-way --cluster=kubernetes-the-hard-way --user=admin && kubectl config use-context kubernetes-the-hard-way")

# Deploying the DNS Cluster Add-on
system("kubectl apply -f https://storage.googleapis.com/kubernetes-the-hard-way/coredns-1.8.yaml")
end
end
4 changes: 4 additions & 0 deletions kubernetes/ha/script/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ mkdir -p /home/vagrant/certificates && chown vagrant:vagrant -R $_

ufw enable <<<y
ufw allow 22

# The SSH connection was unexpectedly closed by the remote end
echo "ClientAliveInterval 30" >> /etc/ssh/ssh_config
echo "ClientAliveCountMax 5" >> /etc/ssh/ssh_config
6 changes: 5 additions & 1 deletion kubernetes/ha/script/bootstrap_ha.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@ ufw enable <<<y
sudo ufw allow 2380/tcp
ufw allow 443/tcp
ufw allow 6443/tcp
ufw allow 22
ufw allow 22

# The SSH connection was unexpectedly closed by the remote end
echo "ClientAliveInterval 30" >> /etc/ssh/ssh_config
echo "ClientAliveCountMax 5" >> /etc/ssh/ssh_config

0 comments on commit 0b797cc

Please sign in to comment.