This document provides instructions on how to deploy resources on Volterra network cloud or edge cloud using Volterra vK8s. Volterra provides mechanism to easily deploy applications across Volterra global network and make them available closer to users in major metro markets. To know more about how Volterra distributes application deployment, see Distributed Application Management.
The vK8s resources covered in this guide are:
- Config map
To deploy vK8s resources, first create a vK8s object as per the instructions in the Create Virtual K8s Object document.
Using the instructions provided in this guide, you can deploy resources with the kubeconfig of the vK8s object.
Note: If you do not have an account, see Create a Volterra Account.
- An application and associated Kubernetes deployment file.
- Kubeconfig file of the vK8s object. See the Create Virtual K8s Object document for more details.
You can deploy vK8s resource in one of the following two ways:
- Using the resource manifest directly in the VoltConsole.
- Using the resource manifest and kubeconfig file of vK8s cluster from CLI with Kubectl.
Perform the following steps:
Step 1.1: Navigate to your vK8s object and download its kubeconfig.
- Click on the application namespace option on the namespace selector. Select your application namespace from the namespace dropdown list to change to that namespace.
Applicationsin the configuration menu and
Virtual K8sin the options pane.
Downloadfor the created vK8s object to download its kubeconfig file.
- Set environment variable for the downloaded kubeconfig in your local machine.
Note: In case of deployment using kubectl, setting KUBECONFIG variable deploys the resources to the vK8s.
Step 1.2: Prepare the manifest file for the resource.
Create a file in your local machine and enter the manifest content in JSON or YAML format. The following is the list of sample manifests:
- vK8s service manifest sample:
apiVersion: v1 kind: Service metadata: name: emailservice labels: app: emailservice annotations: ves.io/proxy-type: HTTP_PROXY ves.io/http2-enable: "true" spec: type: ClusterIP selector: app: emailservice ports: - name: grpc port: 5000 targetPort: 8080
- vK8s job manifest sample:
apiVersion: batch/v1 kind: Job metadata: name: pi spec: template: spec: containers: - name: pi image: perl command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] restartPolicy: Never backoffLimit: 4
- vK8s config map manifest sample:
apiVersion: v1 data: mysqld.conf: "[mysqld]\npid-file\t = /var/run/mysqld/mysqld.pid\nsocket\t\t \ = /var/run/mysqld/mysqld.sock\n# Where the database files are stored inside the container\ndatadir\t\t = /var/lib/mysql\n\n# My application special configuration\nmax_allowed_packet = 32M\nsql-mode = 'STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION'\n\n# Accept connections from any IP address\nbind-address\t = 0.0.0.0\n" kind: ConfigMap metadata: creationTimestamp: null name: mysql-conf
- vK8s secret - Generate the secret using the following command:
kubectl create secret docker-registry dock-secret --docker-server=docker.io --docker-username="<registry username>" --docker-password="<registry password>" --docker-email=<registry email>
Note: In case of generating the secret using above command, the secret is directly created on vK8s and there is no need of performing any action on VoltConsole.
Step 1.3: Deploy the resource.
Step 1.3.1: Deploy from VoltConsole.
- Navigate to your namespace and select
- Click on your vK8s object to open its dashboard.
Add Serviceand enter the service manifest prepared in Step 1.2. Click
Add Joband enter the job manifest prepared in Step 1.2. Click
Add ConfigMapand enter the config map manifest prepared in Step 1.2. Click
Add Secretand enter the secret manifest prepared in Step 1.2. Click
Note: You can directly create secret on vK8s using kubectl as shown in Step 1.2.
Step 1.3.2: Deploy using Kubectl.
To deploy the web application in a K8s cluster, the following are required:
- Kubeconfig of the K8s cluster. For this, use the vK8s kubeconfig downloaded in previous step.
- Manifest file of your web application. See Step 1.2 for sample manifests.
Enter the following command to deploy the resource. This sample deploys a vK8s service.
kubectl apply -f k8s-service-manifest.yaml --kubeconfig vk8s-kubecfg.yaml