Skip to main content

Naver Cloud Platform

Set up Kupboard clusters#

Introduction#

This section describes how to create and configure g2 instances to build a kupboard cluster on Naver Cloud Platform.

g2 Instance#

Kupboard clusters can be configured in a variety of ways depending on the service and application. In this example, we will create 1 server for the admin cluster, 1 server for the gateway cluster, and 4 servers for the service cluster.

You need to create six g2 instances as the table below. OS for all instances must be Ubuntu18.04 or 20.04. The size of additional disks should change depending on services or packages installed on the service cluster.

ClusterInstance TypeQuantityBoot DiskAdditional Disk
Adming2-standard <150GBN/A
Gatewayg2-standard <150GBN/A
Serviceg2-standard <450GB50GB <

g2-standard vCPU 2, memory 8G

VPC Network#

We need to create a VPC with a subnet 172.16.0.0/24.

caution

The subnet range must be 172.16.0.0/24. Otherwise kupboard will not work properly.

Firewall#

Create a firewall for the subnet created above.

ClusterInboundSource
All220.0.0.0/0
1 - 65535172.16.0.0/24
Admin80,4430.0.0.0/0
Gateway80,4430.0.0.0/0
ClusterOutboundDestination
All1 - 655350.0.0.0/0

SSH Key#

In order to initialize the servers, you register a SSH Key. A new key-pair is generated with the kupboard key generator(*Other key generators such as openssl or Putty Key Generator can be used).

$ kupboard setup --keygen

The generated key-pair is located in data/certs.

$ ls ./data/certs
ssh-kupboard.pem ssh-kupboard.pub

They should be renamed to ssh.*.

$ ls ./data/certs
ssh.pem ssh.pub

The Naver Cloud provides the Init Script service so that an initial script can be executed as a server completes its first booting. Below script is for the automatic ssh login. The content of SSH Public Key is from the ssh.pub.

#!/bin/bash
# SSH Public Key
SSH_PUB="ssh-rsa AAAAB3Nzac2EAAAADAQ...........JnKBNbezaxlaPQ== kupboard"
# init ssh keys for root
mkdir ~/.ssh
echo $SSH_PUB > ~/.ssh/authorized_keys

Now, the server can be logged in with the root account at data/certs.

$ ssh -i ssh.pem root@<server-ip>

At the user initialization stage of kupboard setup, the root account login is automatically done.

$ kupboard setup --init-user --root-username root

Server Configuration Result#

VPC platform#

ncloud-vpc-platform

Init Script#

ncloud-init-script

VPC#

ncloud-vpc

Subnet#

ncloud-subnet

Server#

ncloud-server

Data#

Move to Data