Create a Cluster via POC

POC resources are designed to help users experience GreenNode services in the best way possible.

Conditions for using POC resources:

  • Target: Prepaid users who have been granted a POC wallet

  • Funding source: POC Walletarrow-up-right

  • Resources: All resources eligible for POC

  • Usage period: Depends on the duration of the granted POC wallet.


Prerequisites

To initialize a Cluster and Deploy a Workload, you need:

  • At least 1 VPC and 1 Subnet in ACTIVE state. If you do not have a VPC or Subnet yet, please create one following the instructions here.arrow-up-right

  • At least 1 SSH key in ACTIVE state. If you do not have any SSH key, please create one following the instructions here.arrow-up-right

  • Installed and configured kubectl on your device. Please refer herearrow-up-right if you are not sure how to install and use kubectl. Additionally, you should not use a kubectl version that is too old; we recommend using a kubectl version that differs by no more than one version from the cluster version.


Create Cluster

A Cluster in Kubernetes is a collection of one or more virtual machines (VMs) connected together to run containerized applications. A Cluster provides a unified environment for deploying, managing, and operating containers at scale.

To create a Cluster, follow the steps below:

Step 1: Go to https://vks.console.vngcloud.vn/overviewarrow-up-right

Step 2: On the Overview screen, select Activate.

Step 3: Wait until we successfully initialize your VKS account. After successful activation, select Create a Cluster

Step 4: On the Cluster creation screen, we have pre-configured information for the Cluster and a Default Node Group. You can keep these default values or adjust the desired parameters for your Cluster and Node Group at Cluster Configuration, Default Node Group Configuration, Plugin. By default, we will create a Public Cluster with Public Node Group for you.

Step 5: Select POC and then select Create Kubernetes cluster. Please wait a few minutes for us to create your Cluster. The Cluster status at this point will be Creating.

Step 6: When the Cluster status is Active, you can view Cluster information and Node Group information by selecting the Cluster Name in the Name column.

circle-info

Note:

  • When you create a Cluster and choose to use the POC wallet, we automatically create the Control Plane, Node, Volume, and Private Service Endpoint (if you choose to use it) through the POC wallet. For other resources such as:

    • PVC: when creating via yaml, please add the parameter isPOC: "true" to the yaml file. See the example below.

    • LoadBalancer: when creating via yaml, please add the annotation vks.vngcloud.vn/is-poc: "true" to the yaml file. See the example below.

  • Since Load Balancer and PVC resources are managed through YAML, after Stop POC, if your YAML file still has the parameter isPOC : true or is-poc : true, in case you delete the Load Balancer from vLB Portal and remove the load-balancer-id parameter in yaml, the system will automatically recreate these resources through the POC wallet. To create Load Balancer and PVC with real money, please change the isPOC parameter to false. (isPOC : false or is-poc : false). We recommend that you adjust this parameter before performing Stop POC for your Cluster.


Connect and check Cluster information

After the Cluster is successfully created, you can connect and check the Cluster information by following these steps:

Step 1: Go to https://vks.console.vngcloud.vn/k8s-clusterarrow-up-right

Step 2: The Cluster list is displayed, select the Download icon and select Download Config File to download the kubeconfig file. This file will give you full access to your Cluster.

Step 3: Rename this file to config and save it to the ~/.kube/config folder

Step 4: Check the Cluster by running:

  • Run the following command to check node

  • If the result returns as below, your Cluster was successfully created with 3 nodes.


Deploy Workload and expose service through vLB Layer 4 or vLB Layer 7

Below are instructions for deploying 2 workloads and exposing them through Load Balancer Layer 4 and Load Balancer Layer 7 on Kubernetes.

Step 1: Create Deployment, Service for Nginx app.

  • Create file nginx-service.yaml with the following content:

  • Deploy this Service by running:

  • Next, you can check the Deployment by running:


Create Persistent Volume

  • Create file persistent-volume.yaml with the following content:

  • Run the following command to deploy:


Create Snapshot

For Snapshot resources, you cannot specify snapshot to use the POC wallet from VKS. To create a Snapshot via the POC wallet, on vServer Portal, please select Activate Snapshot, then on the Checkout screen, please select the POC wallet. At this point, all your snapshot resources will be created via the POC wallet. Therefore, stopping POC needs to be done through vConsole or vServer Portal. See the image below for reference.

Install GreenNode Snapshot Controller

  • Then run:

  • After the installation is complete, check the status of vngcloud-blockstorage-csi-driver pods:

For example, the output below means you have successfully installed the snapshot-controller:

Create file snapshot.yaml with the following content:

  • Run the following command to deploy:


Check PVC and Snapshot

  • After successfully applying the files, you can check the list of services and PVC via:


Change IOPS of a Persistent Volume

To change the IOPS of a Persistent Volume, follow these steps:

Step 1: Run the command below to list PVCs in your Cluster

Step 2: Edit the PVC YAML file

  • If you have not changed the IOPS of the Persistent Volume before, add the annotation bs.csi.vngcloud.vn/volume-type: "volume-type-id". For example: below I am changing the IOPS from 200 (Volume type id = vtype-61c3fc5b-f4e9-45b4-8957-8aa7b6029018) to 1000 (Volume type id = vtype-85b39362-a360-4bbb-9afa-a36a40cea748)

  • If you have previously changed the IOPS, the yaml file will already have the annotation bs.csi.vngcloud.vn/volume-type: "volume-type-id". In this case, edit the annotation to the Volume type ID with the desired IOPS.

Change Disk Volume of a Persistent Volume

To change the Disk Volume size, run the following command:

For example: initially the PVC was created with 20 Gi, now I will increase it to 30Gi

circle-info

Note:

  • You can only increase the Disk Volume size. You cannot decrease it.

Restore Persistent Volume from Snapshot

To restore a Persistent Volume from a Snapshot, follow these steps:

  • Create file restore-volume.yaml with the following content:

After experiencing VKS, if you want to convert these POC resources to real resources, please follow the instructions herearrow-up-right.

Last updated