Terraform module to deploy Core API adapter for seller app.
Key components of this module consist of
- GKE Cluster with the following services deployed in the cluster
- BPP API
- Seller Adapter Service
- Callback Action Service
- Pub/Sub topics and subscriptions for relaying messages.
- Spanner Database for storing transactions To see database schema, see Spanner module
This is a overview of how messasges are being relayed through this module.
- The BPP API receive a message (eg. /search), the service validates an auth header and JSON payload, and publish it to the Pub/Sub topic.
- The Seller Adapter Service pulls the message from the Pub/Sub topic and sends it to your open-commerce seller application.
- Your open-commerce application responds a callback message back to the Seller Adapter Service. This is a sync communication.
- The Seller Adapter Service publishes your response to the Pub/Sub topic.
- The Callback Action Service pulls the message from Pub/Sub topic, creates an auth header and sends it to ONDC network.
- Open-commerce seller application that implements ONDC seller API. Note: instead of implementing API with async communication, you need to implement it with sync communication as shown in the communication flow.
- Setting up Ingress and Egress of the services
- connect Seller Adapter Service with your open-commerce seller application
- expose BPP API to the internet. You are free to design and add the required networking components as needed. We provide Load Balancer module as an helper module that you can use.
See the terraform/examples/sample
Name | Version |
---|---|
4.73.1 | |
google-beta | 4.73.1 |
kubectl | 1.14.0 |
random | 3.5.1 |
time | 0.9.1 |
Name | Version |
---|---|
4.73.1 | |
google-beta | 4.73.1 |
kubectl | 1.14.0 |
random | 3.5.1 |
time | 0.9.1 |
Name | Description | Type | Default | Required |
---|---|---|---|---|
allow_hosts | List of Allowed Hosts | list(string) |
[ |
no |
artifact_registry | Artifact Registry where the Docker images stored | object({ |
n/a | yes |
cluster_name | GKE Cluster Name | string |
n/a | yes |
env_prefix | Environment Prefix. This will be use as a prefix of resources that cannot be duplicated. | string |
"" |
no |
gateway_url | ONDC Gateway URL | string |
n/a | yes |
horizontal_pod_autoscaling | Enable Auto Pods Scaling | bool |
true |
no |
initial_node_count | Initial Number of Node within the Node Pool | number |
10 |
no |
ip_range_pods | GKE Pod IP Range | string |
"192.168.0.0/18" |
no |
ip_range_pods_name | GKE Pod IP Range's Name. Default: {cluster_name}-ip-range-pods | string |
"" |
no |
ip_range_services | GKE Service IP Range | string |
"192.168.64.0/18" |
no |
ip_range_services_name | GKE Service IP Range's Name. Default: {cluster_name}-ip-range-services | string |
"" |
no |
key_id | Unique Key ID of our entity that is registered to the ONDC network | string |
n/a | yes |
machine_type | Machine type of VM in the cluster. Refer to https://cloud.google.com/service-mesh/docs/unified-install/anthos-service-mesh-prerequisites#cluster_requirements for details. | string |
"e2-standard-4" |
no |
max_node_count | Maximum Number of Node within the Node Pool | number |
100 |
no |
min_node_count | Minimum Number of Node within the Node Pool | number |
5 |
no |
network_name | GKE Network Name | string |
"" |
no |
node_pool_name | GKE Node Pool Name | string |
"default-node-pool" |
no |
ondc_environment | Network environment of ONDC. It should be one of staging, pre-production, production | string |
"staging" |
no |
project_id | Google Cloud Project ID | string |
"" |
no |
pubsub_prefix | Prefix of each Pub/Sub resource | string |
"seller" |
no |
region | GKE Network Region | string |
"us-central1" |
no |
registry_url | ONDC Registry URL | string |
n/a | yes |
secret_id | Secret Manager's Secret ID that store our key pairs | string |
n/a | yes |
seller_system_url | Seller System's URL for receiving seller request eg. /search | string |
n/a | yes |
service_account | GKE Cluster Service Account | string |
n/a | yes |
spanner_database_name | Spanner Database name | string |
"seller-ondc-spanner-database" |
no |
spanner_display_name | Spanner Instance Display Name | string |
"Seller Spanner Instance" |
no |
spanner_instance_name | Spanner Instance name | string |
"seller-ondc-spanner-instance" |
no |
spanner_processing_unit | Spanner Processing Unit | number |
n/a | yes |
subnet_ip | GKE Node IP Range | string |
"" |
no |
subnet_name | GKE Subnet name | string |
"" |
no |
subscriber_id | Subscriber ID of the entity in the ONDC network eg. abcstore.com |
string |
n/a | yes |
subscriber_url | Subscriber URL of the entity in the ONDC network eg. https://abcstore.com/bpp |
string |
n/a | yes |
zones | GKE Network Zones | list(string) |
[ |
no |
Name | Description |
---|---|
cluster_name | GKE Cluster Name |
neg | Network Endpoint Groups |
network_name | GKE Network Name |
Name | Source | Version |
---|---|---|
gke | terraform-google-modules/kubernetes-engine/google | 27.0.0 |
network | terraform-google-modules/network/google | 7.1.0 |
pubsub | ../internal/pubsub | n/a |
spanner | ../internal/spanner | n/a |