60 lines
3.8 KiB
Markdown
60 lines
3.8 KiB
Markdown
|
# Apigee Hybrid on GKE
|
||
|
|
||
|
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.
|
||
|
|
||
|
![Diagram](./diagram.png)
|
||
|
|
||
|
## Running the blueprint
|
||
|
|
||
|
1. Clone this repository or [open it in cloud shell](https://ssh.cloud.google.com/cloudshell/editor?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fterraform-google-modules%2Fcloud-foundation-fabric&cloudshell_print=cloud-shell-readme.txt&cloudshell_working_dir=blueprints%2Fapigee%2Fhybrid), then go through the following steps to create resources:
|
||
|
|
||
|
2. Copy the file [terraform.tfvars.sample](./terraform.tfvars.sample) to a file called ```terraform.tfvars``` and update the values if required.
|
||
|
|
||
|
3. Initialize the terraform configuration
|
||
|
|
||
|
```
|
||
|
terraform init
|
||
|
```
|
||
|
|
||
|
4. Apply the terraform configuration
|
||
|
|
||
|
```
|
||
|
terraform apply
|
||
|
```
|
||
|
|
||
|
## Testing the blueprint
|
||
|
|
||
|
2. Deploy an api proxy
|
||
|
|
||
|
```
|
||
|
./deploy-apiproxy.sh
|
||
|
```
|
||
|
|
||
|
3. In the console check the IP address that has been allocated to the Apigee ingress gateway and send some traffic to the deployed API proxy.
|
||
|
|
||
|
```
|
||
|
curl -k -v -H "Host:HOSTNAME" \
|
||
|
--resolve HOSTNAME:443:IP_ADDRESS \
|
||
|
https://HOSTNAME/httpbin/headers
|
||
|
```
|
||
|
<!-- BEGIN TFDOC -->
|
||
|
|
||
|
## Variables
|
||
|
|
||
|
| name | description | type | required | default |
|
||
|
|---|---|:---:|:---:|:---:|
|
||
|
| [hostname](variables.tf#L43) | Host name. | <code>string</code> | ✓ | |
|
||
|
| [project_id](variables.tf#L79) | Project ID. | <code>string</code> | ✓ | |
|
||
|
| [cluster_machine_type](variables.tf#L17) | Cluster nachine type. | <code>string</code> | | <code>"e2-standard-4"</code> |
|
||
|
| [cluster_network_config](variables.tf#L23) | Cluster network configuration. | <code title="object({ nodes_cidr_block = string pods_cidr_block = string services_cidr_block = string master_authorized_cidr_blocks = map(string) master_cidr_block = string })">object({…})</code> | | <code title="{ nodes_cidr_block = "10.0.1.0/24" pods_cidr_block = "172.16.0.0/20" services_cidr_block = "192.168.0.0/24" master_authorized_cidr_blocks = { internal = "10.0.0.0/8" } master_cidr_block = "10.0.0.0/28" }">{…}</code> |
|
||
|
| [mgmt_server_config](variables.tf#L48) | Mgmt server configuration. | <code title="object({ disk_size = number disk_type = string image = string instance_type = string })">object({…})</code> | | <code title="{ disk_size = 50 disk_type = "pd-ssd" image = "projects/ubuntu-os-cloud/global/images/family/ubuntu-2204-lts" instance_type = "n1-standard-2" }">{…}</code> |
|
||
|
| [mgmt_subnet_cidr_block](variables.tf#L64) | Management subnet CIDR block. | <code>string</code> | | <code>"10.0.2.0/28"</code> |
|
||
|
| [project_create](variables.tf#L70) | Parameters for the creation of the new project. | <code title="object({ billing_account_id = string parent = string })">object({…})</code> | | <code>null</code> |
|
||
|
| [region](variables.tf#L84) | Region. | <code>string</code> | | <code>"europe-west1"</code> |
|
||
|
| [zone](variables.tf#L90) | Zone. | <code>string</code> | | <code>"europe-west1-c"</code> |
|
||
|
|
||
|
<!-- END TFDOC -->
|