Golang Hosting

Togglebox is partnering with Jelastic to become a truly multilingual cloud platform. We will be providing Java, PHP, Python, Ruby, Node.js, .NET, and Golang.

The distinctive features of the Go hosting and will be introduced in this article.

Go Environment Hosting

1. Create the appropriate environment using Togglebox UI’s Topology Wizard

2. Switch to the Go engine tab

3. Add Golang as your application server and any other software stack required

4. Adjust your environment nodes count, cloudlet limits for RAM and CPU, attach Public IPs.
cloud for golang environment

Note: All instances are isolated containers, evenly distributed across the available hardware nodes. This ensures high availability.

Read the Create Environment document for information.

Golang Versions

Weekly updates are available on the Software Stack Versions document.

Choose the preferred version then change later with the container redeploy.

All the custom data inside the node(s) will be saved.

redeploy golang container

Go Application Deployment

Deploy your Go project from the Git repository.

Adjust the the following container variables to customize the deployment process:

  • GO_RUN – sets a name of the executable binary file (if not specified, the deployment script will try to locate one based on the Git project name)
  • GOPATH – defines the deployment folder (/home/jelastic/webapp, by default)
  • GO_BUILD_OPTIONS – provides additional options for the build operation (-a, by default, to force rebuilding of packages that are already up-to-date)
  • GO_RUN_OPTIONS – provides additional options for the run operationgolang application deployment

The following steps are automatically performed:

  • parses the provided Git URL to get a link to the Go project
  • downloads the package with all the dependencies using the go get command
    • in case of error, performs download as for the common Git project and retries getting the Go dependencies
  • builds the project with the go build command (using the additional options specified in the GO_BUILD_OPTIONS variable)
  • runs the binary defined by the GO_RUN variable with the go run command (using the additional options specified in GO_RUN_OPTIONS)

The Go project is located in the directory set with the GOPATH variable.

The workspace hierarchy is based on the requirements in the official documentation.

Learn more via the appropriate documents:

Domains Management

Easily bind an external (custom) domain name to your Go application.

There are two options:

  • CNAME redirect if using Shared Load Balancer; is recommended for dev and test environments
  • DNS A Record if using Public IP; can handle high traffic load and is suitable for production environments

Swap domains to redirect traffic from one environment to another.golang app server in cloud

Tip: Traffic can be redirected to another environment with the help of the SwapExtIps API method (also, available via CLI).

Automatic Vertical Scaling

Provide the resources (RAM and CPU) for a server within predefined limits according to its current demands, with no manual intervention.

Never overpay for unused resources and save time.

The scaling process is automatic once adjusted to your specifications: cloudlets limit (each one equals to 128 MiB of RAM and 400 MHz of CPU) for your Go server through the topology wizard:support golang in cloudReduce resource consumption when the load is down or increase.

Only pay for the resources that are consumed.

Refer to the automatic vertical scaling documentation.

Manual Horizontal Scaling

Add extra Golang servers via the topology wizard during environment creation or adjustment.

Click the “+” button within the Horizontal Scaling section and add the required number of instances.using golang environment in cloudThe maximum number depends on a particular hosting provider settings.

The load balancing node is automatically added to environment topology.

Read more about manual horizontal scaling in the documentation.

Automatic Horizontal Scaling

Go to: Settings > Monitoring > Auto Horizontal Scaling section and click the Add button.

Configure the triggers for specific stacks and resources (CPURAMNetworkDisk) by adjusting the conditions of scaling.app server golang environment

Learn more about automatic horizontal scaling.

 

Here is a set of other features and functionality:

  • Custom or Let’s Encrypt SSL
  • Public IPv4 and IPv6
  • Wide choice of managed databases
  • Container firewalls, endpoints and environment isolation
  • User-friendly UI and direct SSH access for management
  • Open API and Cloud Scripting for automation
  • Pay-as-you-use pricing model
  • Collaboration functionality for teamwork
  • Multi-cloud distribution