Concepts: Service & Sharing

Last updated 2 min read
Report issue

Overview#

GritivaCore introduces a unique Service primitive and Sharing/Ingress model that allows for efficient communication between different scopes. This document outlines the key concepts, definitions, and importance of services and sharing within the GritivaCore framework.

Key Concepts#

Definition of Service#

A Service in GritivaCore is defined as a named endpoint within a specific scope that can be consumed by other scopes. The scope that hosts the service is referred to as the producer, while the consuming scopes reference the service using the format <scope>:<service-name>.

Definition of Sharing#

The Sharing model in GritivaCore governs which consumer scopes are permitted to access which producer services. It operates on an explicit allow-list principle, meaning that access is denied by default unless explicitly allowed.

Service and Sharing Model#

ASCII Diagram#

TEXT
Producer Scope (my-db)
   |
   |  Sharing Rule
   |
Consumer Scope (my-app)

Sharing Rules#

A Sharing rule consists of the following attributes:

  • producer_scope: The scope that produces the service.
  • service_name: The name of the service being shared.
  • consumer_scope: The scope that is allowed to consume the service.
  • allowed: bool: Indicates whether the consumer is permitted access.

Ingress Model#

The Ingress model is a special type of Sharing rule where the consumer is the public internet, allowing external access via Digital Rights Management (DRM).

Lifecycle Commands#

To manage services and sharing rules, the following commands can be used:

BASH
gritivactl service create db --scope my-db --port 5432
BASH
gritivactl share allow --service my-db:db --to my-app
BASH
gritivactl share deny --service my-db:db --from another-scope
BASH
gritivactl share list

Resolution Process#

Within a consumer scope, the service my-db:db resolves through the gmesh DNS overlay to the actual IP and port of the producer service.

Conclusion#

Understanding the Service and Sharing model in GritivaCore is crucial for operators and developers. This framework not only facilitates efficient service consumption but also ensures secure access control through its Sharing rules.

Important Note

Important Note
This document focuses specifically on GritivaCore's Service and Sharing model. It does not cover Kubernetes Services or generic microservices introductions.

Further Reading

Further Reading
For detailed architectural information, refer to the [Sharing and Ingress Architecture Document](docs/SHARING_AND_INGRESS_ARCHITECTURE.md).