Jelastic PaaS is a truly multilingual cloud platform, which currently provides Java, PHP, Python, Ruby, Node.js, .NET, and, from now on, Go environments for running projects of all sizes and various natures. In this article, you'll get acquainted with the distinctive features of the Go hosting platform and will be introduced to the Go-related possibilities within Jelastic PaaS.
In order to host your Go application, you need to create the appropriate environment using the Jelastic Topology Wizard.
Switch to the Go engine tab, add Golang as your application server and any other software stack required for your project (e.g. load balancers, databases, or shared storage). If needed, adjust your environment nodes count, cloudlet limits for RAM and CPU, attach Public IPs, etc.
Note: All instances at Jelastic are completely isolated containers, which are evenly distributed across the available hardware nodes (physical servers or VMs) using automatic anti-affinity rules. This eliminates the risk of application downtime, i.e. it ensures high availability.
For more information about setting up the environment, see the Create Environment documentation.
Currently, the following versions of the Golang stack template are supported by Jelastic:
You can choose the preferred version during environment creation and change it later through container redeploy. Herewith, all the custom data inside the node(s) will be saved, which, for example, allows you to easily upgrade your software version upon the new stack's template release.
After environment creation, you can deploy your Go project from the Git repository (the deployment from application archive will be implemented in the upcoming platform release).
It is possible to customize the deployment process by providing or adjusting the following container variables:
During deployment, Jelastic PaaS automatically performs the following steps:
go buildcommand (using the additional options specified in the
GO_RUNvariable with the
go runcommand (using the additional options specified in
After successful deployment, the Go project is located in the directory set with the
GOPATH variable. Herewith, the workspace hierarchy inside is based on the requirements in the official documentation.
You can learn more about Go applications deployment via the appropriate documents:
With Jelastic PaaS, you can easily bind an external (custom) domain name to your Go application to be used instead of the default environment domain. Depending on the entry point used, there are two options:
Additionally, you can easily swap domains to redirect traffic from one environment to another (e.g. to switch to the newer application version without downtime).
Automatic vertical scaling is ensured by Jelastic ability to dynamically provide the resources (RAM and CPU) for a server within predefined limits according to its current demands, with no manual intervention required. This feature guarantees you never overpay for unused resources and saves your time due to eliminating the necessity of handling the load-related adjustments or architectural changes.
The scaling process is handled by the platform automatically, you just need to specify the lower and upper of cloudlets limit (each one equals to 128 MiB of RAM and 400 MHz of CPU) for your Go server through the topology Wizard:
Your application will work within these limits, reducing resource consumption when the load is down or increasing them when the load is up. Thus, you only pay for the resources that are actually consumed. For more information, please refer to the automatic vertical scaling documentation.
Extra Golang servers can be easily added via the topology wizard during environment creation or adjustment. Just click the "+" button within the Horizontal Scaling section and add the required number of instances.
The maximum number of the same-type servers within a single environment layer depends on a particular hosting provider's settings (usually this limit stands for 16 nodes and can be enlarged by sending the appropriate request to support).
Also, you'll notice that upon the Golang server scaling, the load balancing node is automatically added to the environment topology (required for the proper requests distribution). Find more details about manual horizontal scaling in the documentation.
Automatic horizontal scaling is implemented through tunable triggers, which allow you to increase or decrease the number of nodes due to the application load. To configure automatic scaling, open the environment Settings > Monitoring > Auto Horizontal Scaling section and click the Add button.
Here, you can configure the triggers for specific stacks and resources (CPU, RAM, Network, Disk) by adjusting the conditions of scaling.
Learn more about automatic horizontal scaling in the corresponding document.
In addition, there is a set of other features and functionality provided by Jelastic Go hosting, among them:
The released Go cloud hosting is ready for running dev, test and production environments. The registration is available at Jelastic PaaS.