Review this topic for requirements for host names, NTP, user privileges, DNS configuration, passwordless SSH, and IP addresses.
etc/systemd/timesyncd.conf
to select NTP servers in the
[Time]
section of the configuration file. The NTP=
option
takes a space-separated list of host names or IP addresses. NTP suggests
selecting as many servers as is feasible, but at least 3. Select from the
pool of publicly available servers or your company's internal NTP servers.
For
example:[Time] NTP=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
timesyncd.conf
and to synchronize your
changes.# sudo vim /etc/systemd/timesyncd.conf # sudo service systemd-timesyncd restart # systemctl status systemd-timesyncd # sudo timedatectl set-timezone <your_time_zone>
sudoers
privileges
to ensure components are installed correctly. Installation fails if this
requirement is not met. /etc/resolv.conf
file must be
empty to ensure that the DNS resolution of Kubernetes functions correctly. nslookup
returns the correct host name based on the IP address. For example,
nslookup
node1
./etc/resolv.conf
file can resolve
to the addresses of all the nodes. For example, dig
<node_hostname> +short
should return the correct IP
addresses assigned to the hosts.In the example, the script takes in two parameters, which are the IP addresses of the TPVMs. The example assumes the availability of the public key from the remote host and the RSA keypair.
Note
Modify this script to suit your requirements.#!/bin/bash TPVM1_IP="$1" TPVM2_IP="$2" TPVM_USER="extreme" SSH_OPTION="-o StrictHostKeyChecking=no" echo "Setting up passwordless ssh login from this host to TPVMs..." MY_PUB_KEY=`cat ~/.ssh/id_rsa.pub` ssh $SSH_OPTION $TPVM_USER@$TPVM1_IP "bash -c \"echo $MY_PUB_KEY >> /home/$TPVM_USER/.ssh/authorized_keys\"" ssh $SSH_OPTION $TPVM_USER@$TPVM2_IP "bash -c \"echo $MY_PUB_KEY >> /home/$TPVM_USER/.ssh/authorized_keys\"" echo "Generating ssh keypairs for root on TPVMs..." ssh $SSH_OPTION $TPVM_USER@$TPVM1_IP "bash -c \"sudo ssh-keygen -b 4096 -t rsa -q -N '' -f /root/.ssh/id_rsa <<< y >/dev/null\"" # This could have been a mkdir -p /root/.ssh so that root's .ssh dir is present. ssh $SSH_OPTION $TPVM_USER@$TPVM2_IP "bash -c \"sudo ssh-keygen -b 4096 -t rsa -q -N '' -f /root/.ssh/id_rsa <<< y >/dev/null\"" echo "Setting up passwordless ssh login between TPVMs..." TPVM1_ROOT_PUB_KEY=`ssh $SSH_OPTION $TPVM_USER@$TPVM1_IP "bash -c \"sudo cat /root/.ssh/id_rsa.pub\""` #TPVM2_ROOT_PUB_KEY=`ssh $SSH_OPTION $TPVM_USER@$TPVM2_IP "bash -c \"sudo cat /root/.ssh/id_rsa.pub\""` echo "Exchanging ssh public keys for root between TPVMs..." #ssh $SSH_OPTION $TPVM_USER@$TPVM1_IP "bash -c \"sudo sh -c 'echo $TPVM2_ROOT_PUB_KEY >> /root/.ssh/authorized_keys'\"" ssh $SSH_OPTION $TPVM_USER@$TPVM2_IP "bash -c \"sudo sh -c 'echo $TPVM1_ROOT_PUB_KEY >> /root/.ssh/authorized_keys'\"" echo "Adding TPVM IPs for root between TPVMs as known hosts to skip first time login prompts..." #ssh $SSH_OPTION $TPVM_USER@$TPVM1_IP "bash -c \"sudo sh -c 'ssh-keyscan -H $TPVM2_IP >> /root/.ssh/known_hosts' 2>/dev/null\"" ssh $SSH_OPTION $TPVM_USER@$TPVM2_IP "bash -c \"sudo sh -c 'ssh-keyscan -H $TPVM1_IP >> /root/.ssh/known_hosts' 2>/dev/null\"" echo "Completed passwordless ssh login between TPVMs."