Introduction to Environments
Environments are how containers are networked together on Cycle. Containers are deployed into an environment, and all of the instances, regardless of what server, datacenter, or provider they are running on, will have a private, encrypted layer 2 network built between them automatically.
In other words, an environment can be thought of as a global VPC that spans all the nodes in the same cluster. Using this abstraction, networks between containers are built implicitly, simply by being part of the same environment.
Utilizing multiple environments within a cluster gives better resource density across existing infrastructure. Clusters provide physical isolation, while environments provide network isolation.
IPv6 Native Networks
Environments on Cycle are IPv6 native . The structure for a private IP within an environment is:
fd00::[environment]:[container]:[instance]:[unallocated].
The decision to default to IPv6 was made future-proof Cycle and support large-scale deployments.
Legacy Mode
If the container binds to an IPv4 network and cannot be updated to bind to an IPv6 network, it will need an environment configured for legacy mode.
Legacy mode adds an additional IPv4 subnet to the environment, at the cost of restricting the number of containers that can be deployed into the environme to 250.
The structure for a private IPv4 address in a legacy mode environment is:
10.[environment].[container].[instance].
Accessing Over IPv4
Containers will still be able to be accessed from the internet over IPv4 via the load balancer, even without legacy mode enabled. It is only the private network behind the load balancer that is IPv6 native by default.
Environment Services
Environments each have their own set of services - containers deployed as part of the environment - that facilitate critical functionality within the environment. These services are created and managed by the platform, but are deployed onto infrastructure within the hub.
Auto Update
All services on Cycle can be set to auto-update, so that when new versions are released, the containers will download the latest version behind the scenes and restart themselves, keeping the environment up to date with the latest security and bug fixes without user interaction.
Load Balancer Service
The load balancer facilitates ingress connections into the environment. It also acts as a powerful web application firewall (WAF), and is highly configurable.
Learn more about the load balancer service.
Discovery Service
The discovery service is a DNS resolver that facilitates container-to-container communication over the private network within an environment.
Learn more about the discovery service.
VPN Service
The VPN service is an optional service for connecting computers outside of Cycle to the environment's private network. For example, the VPN service can be used to debug a database over the private network with zero internet connectivity.
Learn more about the VPN service.
Scheduler Service
The scheduler service handles batching requests to function containers. It will automatically handle requests over the load balancer to spin up a function, and has a built in API for doing more manual batch jobs.
Learn more about the scheduler service
High Availability Services
High availability can be an important milestone in creating a resilient production environment for your applications. Most services, such as discovery and load balancer, can be set to high availabilty to have multiple copies running at all times.
Required Resources
In order to use HA mode for services, there must be at least 2 servers deployed and those servers must be in different data centers.
Swapping out of HA mode will scale your instances back down to a single instance. Cycle follows First-In-Last-Out (FILO) and will eliminate the instances, starting with the last instance created and moving toward the original instance.
Deployments
Within an environment, multiple copies of the same containers or groups of containers can be deployed simultaneously to support zero-downtime releases and rollbacks. These groups are called deployments, and consist of containers with a version attached at deploy, and a tag for routing.
The environment handles routing to the proper deployment version at the load balancer by pointing a LINKED Record to a deployment tag.
Continue reading about deployments here.
Managing Configurations and Secrets in an Environment
It is often required, especially when dealing with deployments, to share variables, configurations, or secrets among multiple containers within an environment. Scoped variables are variables within an environment that can be shared between multiple containers, and across deployments.
Scoped variables have a lot of power behind them and can handle situations like timed access, file based configs, and a lot more. Read more about what scoped variables are capable of here.
Monitoring & Metrics
All environments come with basic monitoring, but can be upgraded for longer retention and more custom events and analysis tools. Environments will always monitor basic load balancer and other service metrics, containers, and basic security events.
Get Started With Environments on Cycle
Learn how to set up environments and deploy containers using the Cycle Platform.