Skip to content

Latest commit

 

History

History
 
 

seller

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

ONDC Seller Module

Terraform module to deploy Core API adapter for seller app.

Features

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

Communication flow

This is a overview of how messasges are being relayed through this module.

  1. 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.
  2. The Seller Adapter Service pulls the message from the Pub/Sub topic and sends it to your open-commerce seller application.
  3. Your open-commerce application responds a callback message back to the Seller Adapter Service. This is a sync communication.
  4. The Seller Adapter Service publishes your response to the Pub/Sub topic.
  5. The Callback Action Service pulls the message from Pub/Sub topic, creates an auth header and sends it to ONDC network.

Requirements for connecting to Seller Module

  1. 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.
  2. 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.

Example Usage

See the terraform/examples/sample

Requirements

Name Version
google 4.73.1
google-beta 4.73.1
kubectl 1.14.0
random 3.5.1
time 0.9.1

Providers

Name Version
google 4.73.1
google-beta 4.73.1
kubectl 1.14.0
random 3.5.1
time 0.9.1

Inputs

Name Description Type Default Required
allow_hosts List of Allowed Hosts list(string)
[
"*"
]
no
artifact_registry Artifact Registry where the Docker images stored
object({
project_id = string,
location = string,
repository = string,
})
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)
[
"us-central1-c"
]
no

Outputs

Name Description
cluster_name GKE Cluster Name
neg Network Endpoint Groups
network_name GKE Network Name

Modules

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

Resources

Name Type
google-beta_google_gke_hub_feature_membership.feature_member resource
google-beta_google_gke_hub_membership.fleet_membership resource
google-beta_google_project_iam_member.hub_service_agent_gke resource
google-beta_google_project_iam_member.workload_identity_user resource
google-beta_google_project_service_identity.sa_gkehub resource
google_artifact_registry_repository_iam_member.reader resource
google_compute_firewall.allow_healthcheck_and_proxy resource
google_project_iam_member.k8s_member_workload_identity resource
google_project_iam_member.logWriter resource
google_project_iam_member.metricWriter resource
google_project_iam_member.publisher resource
google_project_iam_member.pubsubAdmin resource
google_project_iam_member.viewer resource
google_spanner_database_iam_member.spannerDatabaseAdmin resource
kubectl_manifest.allow_egress_googleapis resource
kubectl_manifest.app_deployments resource
kubectl_manifest.app_gateways resource
kubectl_manifest.app_services resource
kubectl_manifest.app_servieaccounts resource
kubectl_manifest.configs resource
kubectl_manifest.istio_ingress resource
kubectl_manifest.namespaces resource
random_id.suffix resource
time_sleep.for_asm_ready resource
google_client_config.main data source
google_compute_network_endpoint_group.neg data source
google_project.main data source