Skip to content

Node

Prerequisite

To properly configure your Node, you need the followings:

  • Docker 19.03.12
  • A Linux server with a ssh access

    • host for SSH connection
    • username for SSH connection
    • SSH key for SSH connection
    • Optional: passphrase, if the SSH key is passphrase protected.
  • To verify the above information, you can execute the following command and make sure that login is successful without the password.

    1
    $ ssh -i path/to/ssh-key-file username@host
    

Create a Node

Start by creating a new node using the cli.

1
2
3
4
5
$ dhops create node <node-name> # e.g. dhops create node1
Created <workspace>/<node-name>/config.yaml
Created <workspace>/<node-name>/secrets.yaml
Encrypted <workspace>/<node-name>/secrets.yaml
Node <node-name> created

Configure the Node

Configure the node using your default editor with:

1
$ dhops config [relative-path-to-node] # e.g. dhops config node1

Alternatively, you can directly open the config.yaml file inside the node folder.

Note:

  1. Enter the host and the username in the config file.
  2. Put the ssh_key_file inside the keys directory.
  3. Configure path to the ssh_key_file as follows:
    1
    2
    3
    # node1/config.yaml
    ssh:
     key: ../keys/ssh_key_file
    
  4. Enter the docker registry and username provided by Leitwert.

Configure the node secrets

Then, edit the secrets of the node using:

1
$ dhops secrets [relative-path-to-node] # e.g dhops secrets node1

Alternatively, you can directly edit the secrets.yaml file using sops secrets.yaml

The relative path can be omitted if you are in the corresponding folder.

Note:

  1. Enter the docker token provided by Leitwert
  2. Enter the passphrase of the SSH key, if it exists, in the secrets file.

Template a Node

Template the node using its configuration using:

1
$ dhops template [relative-path-to-node] # e.g. dhops template node1

All templated files are stored inside the .output/<node-name> folder from the workspace.

Deploy a Node

Finally, all templated files can be deployed to the node using:

1
$ dhops deploy [relative-path-to-node] # e.g. dhops deploy node1

Note that by default, the deploy command automatically template the files

Workspace

At the end of this tutorial, your workspace should have the following tree structure:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
.
├── keys
│   ├── webteam@leitwert.ch.pgp
│   ├── webteam@leitwert.ch.pgp.pub
│   ├── username@name.node.leitwert.ch.rsa
│   └── username@name.node.leitwert.ch.rsa.pub
├── node1
│   └── config.yaml
│   └── secrets.yaml
└── dhops.yaml

Last update: 2022-03-31