Kubernetes

This is a guide on how to get a Kubernetes Form.io deployment up and running in your environment. While not applicable in all respects, here are general docker deployment docs that contain helpful information regarding the API and PDF servers. Also, here are recommended deployment configurations for both servers.

To get started, you will need a couple of libraries installed in your terminal.

  • kubectl, so you can authenticate and interact with your cluster.

  • Optionally, you can use Helm to deploy and manage your Form.io Kubernetes application.

Create a Cluster

Create a Kubernetes cluster in your environment of choice, for instance:

(Optional) – Create a Helm Chart

If using Helm, create a chart for your deployment with helm create. The Helm templates generated here will be filled out later in order to create the necessary Kubernetes resources.

Create Cluster Ingress Controller

In order to route external traffic to our Form.io API and PDF servers, we will want to configure an Ingress Controller for the cluster. There are many options for ingress configuration and implementation varies between cloud providers.

The following links provide documentation on ingress controllers for various cloud providers.

Create a Form.io Deployment (API Server) or (API Server + PDF Server)

The instructions for a multi-container deployment assume you have at least 1 API server and 1 PDF server associated with your license key and have set up a Mongo database instance and a file storage provider. You can also follow this guide if you're just deploying the API server, simply omitting any directions pertaining only to the PDF server.

Create Cluster Namespace

Next we will want to create a namespace for our Form.io deployment using the kubectl CLI.

Write the Necessary Kubernetes Resource Files

For a multi-container Form.io deployment, you will likely want to write a manifest file defining two separate Kubernetes deployments for the API and PDF servers to manage pods grouped into two separate Kubernetes services that you will also write a manifest for. You will most likely also want to define at least one Kubernetes ingress resource for the API server, if not two for both the API and PDF servers (if you want to use the PDF server direct API) see also this link for more information on the PDF server direct API.

If using Helm, you'll define these resources in the relevant template files generated earlier by helm create.

Docker Images

You will want to pin a specific version for both the API and PDF server images referenced in your Kubernetes deployment, as shown here.

Environment Variables

You will need to specify environment variables for your Form.io deployment. You will define environment variables in the container configuration for each Kubernetes resource.

API Server:

Here is a link to the environment variables for the API server.

  • Note that regardless of which mongo-compatible database you use, the connection string provided as the value for the MONGO variable should include your Form.io database name, as stated here under the "Database Connection String" section. Here are links for setting up the database in various environments:

  • PDF_SERVER: If you do have a PDF server, you can configure this variable to point to the Kubernetes service DNS name for the PDF server Kubernetes service. This DNS name needs to be prefixed with http:// (assuming default cluster networking configuration) and include the port that the PDF Kubernetes service is running on if not using the default http port of 80.

All container environment variables need to be defined in the deployment manifest as strings.

PDF Server:

Here is a link to the environment variables for the PDF server. The cloud provider you are using will determine which env vars need to be defined for file storage. Documentation on file storage configuration for AWS, Azure and Minio can be found here, and GCP here (you may need to scroll to find the environment variable section for GCP []). Here are links for setting up file storage infrastructure in various cloud environments:

It's vital to ensure that sensitive variables are correctly set and securely stored since they provide direct access to your cloud storage resources. Misconfiguration or exposure of these keys can lead to unauthorized access and potential data breaches. Always follow best practices for security, such as using a Kubernetes secret and regularly rotating keys.

Deploy Kubernetes Resources

Now that you've written files defining the necessary Kubernetes resources, we are ready to deploy our application.

Check Status of Deployment

To check if your Form.io application was successfully deployed to your cluster, you can run kubectl get pods:

kubectl get pods -n {your-formio-deployment-namespace}

Last updated

Was this helpful?