This example installs Apigee hybrid in a non-prod environment on a GKE private cluster using Terraform and Ansible. The Terraform configuration deploys all the required infrastructure including a management VM used to run an ansible playbook to the actual Apigee Hybrid setup.
The diagram below depicts the architecture.
-
Clone this repository or open it in cloud shell, then go through the following steps to create resources:
-
Copy the file terraform.tfvars.sample to a file called
terraform.tfvars
and update the values if required. -
Initialize the terraform configuration
terraform init
-
Apply the terraform configuration
terraform apply
Create an A record in your DNS registrar to point the environment group hostname to the public IP address returned after the terraform configuration was applied. You might need to wait some time until the certificate is provisioned.
-
Install Apigee hybrid using de ansible playbook that is in the ansible folder by running this command
ansible-playbook playbook.yaml -vvv
-
Deploy an api proxy
./deploy-apiproxy.sh apis-test
-
Send a request
curl -v https://HOSTNAME/httpbin/headers
name | description | type | required | default |
---|---|---|---|---|
hostname | Host name. | string |
✓ | |
project_id | Project ID. | string |
✓ | |
cluster_machine_type | Cluster nachine type. | string |
"e2-standard-4" |
|
cluster_network_config | Cluster network configuration. | object({…}) |
{…} |
|
mgmt_server_config | Mgmt server configuration. | object({…}) |
{…} |
|
mgmt_subnet_cidr_block | Management subnet CIDR block. | string |
"10.0.2.0/28" |
|
project_create | Parameters for the creation of the new project. | object({…}) |
null |
|
region | Region. | string |
"europe-west1" |
|
zone | Zone. | string |
"europe-west1-c" |
name | description | sensitive |
---|---|---|
ip_address | GLB IP address. |
module "test" {
source = "./fabric/blueprints/apigee/hybrid-gke"
project_create = {
billing_account_id = "12345-12345-12345"
parent = "folders/123456789"
}
project_id = "my-project"
hostname = "test.myorg.org"
}
# tftest modules=18 resources=61