Adding a Node to the Cluster

This section explains the steps to be followed to add a new node to an existing cluster.

  1. Login to the node from where the AppViewX deployment was triggered (installer node).
  2. (Optional) Execute this step ONLY when the new node is cloned from an existing node. In this case, you will have to remove the existing Kubernetes configuration files. To delete the existing kubelet config files:
    1. Log in as a root user.
    2. Execute the following command:
      kubeadm reset -f
    3. To navigate to the /var/lib/kubelet directory, execute the following command:
      cd /var/lib/kubelet/
    4. To delete all the files inside the kubelet directory, execute the following command:
      rm -r *
    5. To navigate to the /etc/kubernetes directory, execute the following command:
      cd /etc/kubernetes/
    6. To delete all the files inside the Kubernetes directory, execute the following command:
      rm -r *
  3. Before adding nodes using the node addition script, ensure that the following prerequisites are met:
    1. Execute/run the prerequisite tool and ensure it meets the tool execution criteria.
    2. Check if the IP forwarding is enabled and firewalld is disabled. If they are not then execute steps c and d.
    3. Enable ip_forward, using the steps below:
      1. Execute the command.
        sudo vi  /etc/sysctl.conf
      2. In the conf file, add the value net.ipv4.ip_forward=1.
      3. Execute the command.
        sudo sysctl -p
    4. To disable the firewalld, use the command below.
      sudo systemctl stop firewalld

Adding a Master Node

  1. To add the master node, execute the following command:
    • Run the command:
      cd <Installer_Location/appviewx_kubernetes/scripts>
  2. Ensure that the current Kubernetes context is set to the admin user. If it is not, switch to the admin configuration instead of the read-only user configuration.
  3. Execute the node addition script using the sudo command.
    sudo ./appviewx_add_node.sh
    Note: The total of master nodes must be an odd number (for example, 3, 5, and so on.). Add the master nodes accordingly. To enter multiple IP addresses, separate them with commas (for example, IP1, IP2).
  4. The command will be prompted to enter the following details:
    1. Confirmation of the current Installer directory.
    2. IP addresses of new master nodes.
    3. datacentername:hostname of the new master nodes.
    Note: If you are prompted to enter the worker node details, hit the enter key and proceed.
  5. After execution, the new master nodes join the cluster, and all pods and daemonsets deploy on them.
  6. To verify whether the pods are up and running in the new node, execute the following command:
    kubectl get pods -n <dcname> -o wide

Adding a Worker Node

  1. To add the worker node, execute the following command:
    • Run the command:
      cd <Installer_Location/appviewx_kubernetes/scripts>
  2. Ensure that the current Kubernetes context is set to the admin user. If it is not, switch to the admin configuration instead of the read-only user configuration.
  3. Execute the node addition script using the sudo command.
    sudo ./appviewx_add_node.sh
  4. The command will be prompted to enter the following details:
    1. Confirmation of the current Installer directory.
    2. IP addresses of new master nodes.
    3. datacentername:hostname of the new master nodes.
    4. (optional - leave blank) datacenter names for strict host routing if required.
    Note: If you are prompted to enter the worker node details, hit the enter key and proceed.
  5. After execution, the new master nodes join the cluster, and all pods and daemonsets deploy on them.
  6. To verify whether the pods are up and running in the new node, execute the following command:
    kubectl get pods -n <dcname> -o wide
    Note: The script adds both master and worker nodes together. Provide the Node IP and hostname clearly when prompted. It performs all necessary validations, including checking that the IP and hostname resolve correctly, verifying that new nodes have the same OS version as existing nodes, and ensuring worker node IPs do not conflict with master node IPs.