Deploy Site as Kubernetes

Objective

This guide provides instructions on how to deploy a Volterra site as a pod on a kubernetes cluster. For more information on Volterra sites, see Volterra Site. Volterra site deployed as a pod on a K8s cluster enables the VoltMesh features such as discovery of services of the K8s cluster, publish of other site's services on this site, publish of this site's discovered services on other sites, etc.

Deploying a site as K8s is supported for the following:

  • Azure Kubernetes Service (AKS)
  • Amazon Elastic Kubernetes Service (Amazon EKS)
  • Google Kubernetes Engine (GKE)
  • Minikube

Using the instructions provided in this guide, you can perform the following:

  • Deploy a site of the nodes
  • Decommission the site from the K8s cluster

Prerequisites

The following prerequisites apply:

  • VES account

  • A deployed K8s cluster

    • Note: For instructions on AKS, EKS, and Minikube cluster creation, refer to the AKS, EKS, and Minikube documentation respectively.
  • The following are the requirements for the manged K8s environment:

    • Managed K8s (EKS/AKS/GKE) - at least 4 vCPUs and 8GB memory per node
    • Minikube - at least 4GB memory

Configuration

The following image shows the workflow of deploying a Volterra site as a pod on an existing K8s cluster:

CnfSeqCE
Figure: Configuration Sequence For Site as K8s Pod

Configuration Sequence

Deploying Site as a pod on an existing K8s cluster requires you to perform the following sequence of actions.

Steps Description
Create Site Token. Log into the Volterra console and generate a site token.
Prepare Manifest Prepare a manifest file with the parameters required for site provisioning.
Deploy Volterra Site Deploy the Volterra site using the Kubeconfig of K8s cluster and the manifest.

Create Site Token

Installing a Volterra site requires you to obtain a site token. In case you do not have a site token, you can generate one. For instructions on how to generate a site token, see the Create Site Token chapter in the Create a Site guide. This example shows how to obtain a site token that is already created.

Step 1: Log into the Volterra console and from the system namespace, select Manage in the configuration menu. Select Site Management -> Site Token from the options pane. Select the token as per your choice from the displayed list of tokens.

Token
Figure: Obtain Site Token

Note: You can also download the site token file in the JSON format using the ...->Download option. The value of the uid field is the site token.


Prepare Manifest

Step 1: Create a manifest file. Download the sample Manifest Template.

Step 2: Edit the configuration in the Vpm area of the manifest file as per the following guidelines.

  • Enter your cluster name in the ClusterName field.
  • Enter latitude and longitude values in the Latitude and Longitude fields respectively.
  • Enter the site token in the Token field.

The following image shows sample configuration for the Vpm area of manifest file:

Manifest
Figure: Manifest Configuration

Note: You can also set the cluster name, latitude, and longitude at the time of site registration.


Deploy Volterra Site

Step 1: Deploy the site using the Kubeconfig file of your K8s cluster and the created manifest file.

kubectl --kubeconfig=<kubeconfig-of-existing-k8s-cluster> apply -f <manifest>.yml

The following sample shows the output of the kubectl command:

namespace/ves-system created
daemonset.apps/volterra-ce-init created
serviceaccount/vpm-sa created
role.rbac.authorization.k8s.io/vpm-role created
rolebinding.rbac.authorization.k8s.io/vpm-role-binding created
clusterrolebinding.rbac.authorization.k8s.io/ver created
configmap/vpm-cfg created
statefulset.apps/vp-manager created

Step 2: Verify that K8s pod for site is created. The pod with the vp-manager-0 name indicates that the site pod is created..

kubectl get pods -n ves-system -o=wide
NAME                     READY   STATUS    RESTARTS   AGE     IP            NODE                                NOMINATED NODE   READINESS GATES
ves-system    volterra-ce-init-5wsmb                 1/1     Running   0          32m   10.240.0.5   aks-nodepool1-29573508-vmss000001   <none>           <none>
ves-system    volterra-ce-init-sbjqp                 1/1     Running   0          32m   10.240.0.4   aks-nodepool1-29573508-vmss000000   <none>           <none>
ves-system    vp-manager-0                           1/1     Running   0          29m   10.244.1.3   aks-nodepool1-29573508-vmss000001   <none>           <none>

Step 3: Check if the registration request is created. You can check it from the Volterra console or using the kubectl CLI. This example shows sample output of the kubectl logs command.

kubectl logs vp-manager-0 -n ves-system

...

  "message": "Config isn't available. Current state: NEW, registration 3c507977-a1d6-44da-b470-5e06eb055d06 must be manually APPROVED and then automatically ADMITTED. Object status: \u0026StatusType{ObjectStatus:\u0026ves_io_schema4.StatusType{Status:,Reason:Registration created, waiting for approval,Code:0,},CurrentState:NEW,}"

Step 6: Log into the Volterra console and approve the site registration as per the instructions in the Accept Site Registration chapter in the Create a Site guide. This example shows the sample image for the site registration.

Register
Figure: Site Registration

Step 7: Verify that the rest of Volterra services are started after the site registration.

kubectl get pods -n ves-system -o=wide

NAME                           READY   STATUS      RESTARTS   AGE   IP           NODE                                NOMINATED NODE   READINESS GATES
etcd-5779568655-td4wq          2/2     Running     0          41m   10.244.1.4   aks-nodepool1-29573508-vmss000001   <none>           <none>
etcd-defrag-1587094200-58jjb   0/1     Completed   0          33m   10.244.1.5   aks-nodepool1-29573508-vmss000001   <none>           <none>
ver-0                          13/13   Running     3          41m   10.244.0.8   aks-nodepool1-29573508-vmss000000   <none>           <none>
volterra-ce-init-5wsmb         1/1     Running     0          75m   10.240.0.5   aks-nodepool1-29573508-vmss000001   <none>           <none>
volterra-ce-init-sbjqp         1/1     Running     0          75m   10.240.0.4   aks-nodepool1-29573508-vmss000000   <none>           <none>
vp-manager-0                   1/1     Running     2          72m   10.244.1.3   aks-nodepool1-29573508-vmss000001   <none>           <none>

The site deployed as a K8s pod shows up in the Volterra console and you can deploy the VoltMesh services similar to the other sites.

Note: After you accept the registration, it takes few minutes for the health and connectivity status to get updated in the portal.


Perform Scaling for Site

You can perform scale-up or scale-down of the nodes by changing the replicas of the vp-manager pods.

Step 1: Update the replicas using the Kubeconfig file of your K8s cluster.

kubectl --kubeconfig=<kubeconfig-of-existing-k8s-cluster> edit statefulset/vp-manager -n ves-system

Step 2: Verify that the new pods have started. This example assumes that the replicas are set to 2.

kubectl get pods -o=wide -n ves-system

NAME                           READY   STATUS      RESTARTS   AGE   IP            NODE                                NOMINATED NODE   READINESS GATES
etcd-5bcbfc8689-8fx4g          2/2     Running     0          19h   10.244.1.23   aks-nodepool1-29573508-vmss000001   <none>           <none>
etcd-defrag-1587184200-dg765   0/1     Completed   0          42m   10.244.1.52   aks-nodepool1-29573508-vmss000001   <none>           <none>
ver-0                          13/13   Running     2          16h   10.244.0.12   aks-nodepool1-29573508-vmss000000   <none>           <none>
ver-1                          13/13   Running     0          17m   10.244.1.53   aks-nodepool1-29573508-vmss000001   <none>           <none>
volterra-ce-init-5wsmb         1/1     Running     0          26h   10.240.0.5    aks-nodepool1-29573508-vmss000001   <none>           <none>
volterra-ce-init-sbjqp         1/1     Running     0          26h   10.240.0.4    aks-nodepool1-29573508-vmss000000   <none>           <none>
vp-manager-0                   1/1     Running     0          12m   10.244.1.54   aks-nodepool1-29573508-vmss000001   <none>           <none>
vp-manager-1                   1/1     Running     2          15m   10.244.0.14   aks-nodepool1-29573508-vmss000000   <none>           <none>

Note: Scale-up for the sites also creates the VER pods as there can be only one VER pod per node.


Decomission the Site

Decommission of the site requires you to de-register the site from the Volterra console and then delete the site. Perform the following actions to decommission the site.

Step 1: Log into the Volterra console and select Manage from the configuration menu and Registration from the options. Click the Other Registrations tab.

Step 2: Click ...->Decommission for your site. Click Decommission in the confirmation window to confirm the de-registration of the site.

Step 3: Delete the resources of the site from the K8s cluster using the kubectl CLI.

kubectl --kubeconfig=<kubeconfig-of-existing-k8s-cluster> delete -f <vpm-manifest>.yml

Step 4: Open Volterra console and select Sites from the configuration pane and Site List from the options. Select your site from the list of displayed sites and click ...->Edit to open the site edit form.

Step 5: Click the Delete Site button. Click Delete in the confirmation window to complete site deletion.

SiteDel
Figure: Site Deletion


Concepts


API References