Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Before running the setup_deploy.yml playbook, modify the hosts file in the deploy/playbook directory with the host names and IP addresses of the edge nodes in your cluster. Also update the entry for the master node's host if it is not the same as the deploy node.

all:

...

  hosts:

...

  children:

...

    deploy:

...

      hosts:

...

        localhost:

...

    master:

...

      hosts:

...

        localhost:

...

#

...

IP

...

address

...

or

...

hostname

...

of

...

master

...

node

...

    edge_nodes:

...

      hosts:

...

        jet01:

...

#

...

Name

...

of

...

first

...

edge

...

node

...

          ip:

...

192.168.2.27

...

#

...

IP

...

address

...

of

...

first

...

edge

...

node

...

          lora_id:

...

1

...

        jet02:

...

#

...

Name

...

of

...

second

...

edge

...

node

...

          ip:

...

192.168.2.29

...

#

...

IP

...

address

...

of

...

second

...

edge

...

node

...

          lora_id:

...

4

...

      vars:

...

        ansible_user:

...

edge

...

        ansible_ssh_private_key_file:

...

~/.ssh/edge

In addition, if the master node is not the same as the deploy node, remove the line connection: local wherever it follows hosts: master in the playbooks in deploy/playbook.

In the file master.yml in the deploy/playbook/group_vars/all directory, set the master_ip value to the IP address of the master node. Note that this is required even if the master node is the same as the deploy node.

master_ip:

...

192.168.2.16

Set Up the Deploy Node

The account which runs the deploy playbooks will need to be able to use sudo to execute some commands with super-user permissions. The following command can be used (by root or another user which already has super-user permissions) to enable the use of sudo for a user:

...

Kubernetes' initialization tool kubeadm requires that swap be disabled on nodes in the cluster. Turn off swap on the master mode by editing the /etc/fstab file (using sudo) and commenting out the line with "swap" as the third parameter:

#

...

/swap.img

...

none

...

swap

...

sw

...

0

...

0

In addition, if you have proxy settings kubeadm will warn that you should disable the proxy for cluster IP addresses. The default cluster IP ranges 10.96.0.0/12 and 10.244.0.0/16 should be added to the no_proxy and NO_PROXY variables in /etc/environment if necessary.

no_proxy=localhost,127.0.0.0/8,192.168.2.0/24,10.96.0.0/12,10.244.0.0/16,*.local,*.fujitsu.com
NO_PROXY=localhost,127.0.0.0/8,192.168.2.0/24,10.96.0.0/12,10.244.0.0/16,*.local,*.fujitsu.com

Creating the Docker Registry

...

sudo systemctl disable nvzramconfig.service

Preparing the Build Node

In the test installation, the build node is a VM running on a x86 PC, with Ubuntu Linux 20.04 installed. In addition, the Ansible tool must be installed. The Ansible tool provided in the Ubuntu software repository is a slightly older version which needs to be upgraded, refer to Ansible Installation Guide to install the latest version. But before running that playbook you need to configure a few things described in the section below.

The playbooks for use on the build node are stored in the cicd/playbook directory of the source repository. These playbooks refer to other files in the source code, so the entire directory tree should be copied onto the deploy node. The easiest way to do this is by cloning the git repository directly as shown below:

git clone repository-url

Note, using the --depth=1 option can save some disk space if you don't need to modify the source code.

The git command will create a directory in the directory where it is run named after the repository. Inside the new directory will be the cicd/playbook directory. Unless noted otherwise, the commands below should be run in that directory.

Node Configuration

Before running the setup_build.yml playbook, if you use a different hostname of the master node, update the entry for the master node's host.

all:
 

...

hosts:
 

...

 

...

localhost:
 

...

 

...

arm-build:
 

...

 

...

 

...

ansible_host:

...

erc01
 

...

 

...

 

...

ansible_user:

...

edge
 

...

 

...

 

...

ansible_ssh_private_key_file:

...

~/.ssh/edge
 

...

 

...

 

...

ansible_become_password:

...

password
 

...

children:
 

...

 

...

master:
 

...

 

...

 

...

hosts:
 

...

 

...

 

...

 

...

sdt-master:

...

# hostname of master node

Set Up the Build Node

If the build

...

node is not on the same host as the deploy node,

...

the user that runs the deploy playbooks must have an account on the build host under the same name, and that account must have sudo privileges like the account on the deploy node (see above). 

The following command will prepare the master node for use:

ansible-playbook -i ./hosts setup_build.yml --ask-become-pass

The playbook will perform the following initialization tasks:

  • Make sure there is an entry for the master node in /etc/hosts
  • Install required software packages including Docker and Go
  • Make sure the user can run Docker commands
  • Configure Docker, including adding the certificates to secure access to the private registry

In the file master.yml in the deploy/playbook/group_vars/all directory, set the master_ip value to the IP address of the master node. Note that this is required even if the master node is the same as the deploy node.

...


Building the Custom Services

...