Member-only story
Adding Nodes to a Kubespray-Deployed Kubernetes Cluster
This guide describes the process of adding master and worker nodes to an existing Kubernetes cluster deployed with Kubespray.
We assume that a Kubernetes cluster is deployed with kubespray. There are two articles for initial Kubernetes deployment using kubespray.
We also assume that the files for the initial deployment are available. The basic user-provided files are inventory.yaml and ssh config file.
We start with updating inventory.yaml and ssh_config by adding new nodes. The structure of inventory file is shown below. We need to add new nodes in the existing inventory.yaml.
---
all:
vars:
ansible_ssh_common_args: '-o User=<username> -o StrictHostKeyChecking=no'
ansible_ssh_pass: <user password>
ansible_become_pass: <user password>
hosts:
# list of all nodes
# in a form of
# <node-name>:
# ip: <ip address>
# node_labels: # for worker node only
# node-role.kubernetes.io/worker: "" # for worker node only
children:
kube_control_plane:
hosts:
# list of master nodes
# in a form of <node-name>:
kube_node:
hosts:
# list of worker nodes
# in a form of <node-name>:
etcd:
hosts:
# list of etcd nodes
# in a form of <node-name>:
k8s_cluster:
children…