|
||
---|---|---|
.. | ||
Dockerfile | ||
README.md | ||
main.tf | ||
outputs.tf | ||
reverse-proxy.png | ||
variables.tf | ||
versions.tf |
README.md
Nginx-based reverse proxy cluster
This blueprint shows how to deploy an autoscaling reverse proxy cluster using Nginx, based on regional Managed Instance Groups.
The autoscaling is driven by Nginx current connections metric, sent by Cloud Ops Agent.
The example is for Nginx, but it could be easily adapted to any other reverse proxy software (eg. Squid, Varnish, etc).
Ops Agent image
There is a simple Dockerfile
available for building Ops Agent to be run inside the ContainerOS instance. Build the container, push it to your Container/Artifact Repository and set the ops_agent_image
to point to the image you built.
Variables
name | description | type | required | default |
---|---|---|---|---|
autoscaling_metric | object({…} |
✓ | ||
project_name | Name of an existing project or of the new project | string |
✓ | |
autoscaling | Autoscaling configuration for the instance group. | object({…}) |
{…} |
|
backends | Nginx locations configurations to proxy traffic to. | string |
"<<-EOT…EOT" |
|
cidrs | Subnet IP CIDR ranges. | map(string) |
{…} |
|
network | Network name. | string |
"reverse-proxy-vpc" |
|
network_create | Create network or use existing one. | bool |
true |
|
nginx_image | Nginx container image to use. | string |
"gcr.io/cloud-marketplace/google/nginx1:latest" |
|
ops_agent_image | Google Cloud Ops Agent container image to use. | string |
"gcr.io/sfans-hub-project-d647/ops-agent:latest" |
|
prefix | Prefix used for resources that need unique names. | string |
"" |
|
project_create | Parameters for the creation of the new project | object({…}) |
null |
|
region | Default region for resources. | string |
"europe-west4" |
|
subnetwork | Subnetwork name. | string |
"gce" |
|
tls | Also offer reverse proxying with TLS (self-signed certificate). | bool |
false |
Outputs
name | description | sensitive |
---|---|---|
load_balancer_url | Load balancer for the reverse proxy instance group. |