forked from meshery/meshery
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ananya Gautam <[email protected]>
- Loading branch information
1 parent
69686ff
commit 516e5c3
Showing
3 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 101 additions & 0 deletions
101
docs/pages/project/contributing/contributing-relationships.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
layout: page | ||
title: Contributing to MeshModel | ||
permalink: project/contributing/contributing-meshmodel | ||
redirect_from: project/contributing/contributing-meshmodel/ | ||
description: How to contribute to MeshModel | ||
language: en | ||
type: project | ||
category: contributing | ||
--- | ||
|
||
MeshModel serves as a foundational element in the Meshery ecosystem, representing the interconnectedness of various components inside the infrastructure of a service mesh. | ||
|
||
In the context of MeshModel, the core constructs of MeshModel are represented in three forms: | ||
|
||
1. Schema (static): The schema represents the skeletal structure of a construct and provides a logical view of its size, shape, and characteristics. It defines the expected properties and attributes of the construct. The schema serves as a blueprint or template for creating instances of the construct. It is a static representation that defines the structure and properties but does not contain specific configuration values. | ||
|
||
2. Definition (static): The definition is an implementation of the schema. It contains specific configurations and values for the construct at hand. The definition provides the actual configuration details for a specific instance of the construct. It is static because it is created based on the schema but does not change once created. The definition is used to instantiate instances of the construct. | ||
|
||
3. Instance (dynamic): The instance represents a realized construct. It is a dynamic representation that corresponds to a deployed or discovered instance of the construct. The instance is created based on the definition and represents an actual running or deployed version of the construct within the service mesh environment. | ||
|
||
If a specific attribute is not provided with a value in the definition, it means that the value for that attribute has to be written or configured per construct. In other words, the absence of a value indicates that the configuration for that attribute is required and specific to each individual construct instance. | ||
|
||
### Model Packaging | ||
Model Packaging in MeshModel allows constructs to be imported and exported as OCI-compatible images, making them portable and encapsulating intellectual property invested into models. Model packages are versioned bundles of Mesh Model constructs. | ||
|
||
### Contribute to MeshModel Relationships | ||
|
||
Relationships within MeshModel play a crucial role in establishing concrete visualisations of efficient data flow between different components of Meshery. These are used to classify the nature of interaction between one or more interconnected Components. | ||
|
||
1. Identify the relationship and any specific constraints to be enforced between the two specific components, their models or potentially other components, models, or environmental considerations. | ||
2. Propose a specific visual representation for the relationship. | ||
3. Visual representation examples: | ||
- [Hierarchical](../../../../.github/assets/images/hierarchical_relationship.png) | ||
- [Sibling](../../../../.github/assets/images/sibling_relationship.png) | ||
- [Binding](../../../../.github/assets/images/binding_realtionship.png) | ||
4. Prospose the appropriate relationship type, using one of the predefined set of relationship types or suggest a new relationship where an existing type does not fit. | ||
5. Create a Relationship Definition (yaml). | ||
6. Create a policy for evaluation of the relationship (rego). See [examples](../../../../server/meshmodel/policies/). | ||
7. Add in Documentation. | ||
|
||
Example of a Network Edge Relationship Schema is: | ||
|
||
```yaml | ||
apiVersion: core.meshery.io/vlalphal | ||
|
||
kind: RelationshipDefinition | ||
|
||
metadata: | ||
name: Network Edge Relationship | ||
description: Network edge relationship | ||
type: edge | ||
sub-type: network | ||
status: | ||
spec: | ||
schematic: | ||
cue: | | ||
selectors: | ||
allow: | ||
from: [self | other ] | ||
kind: | ||
model: | ||
version: | ||
patch: | ||
patchStrategy: replace | ||
mutatorRef: (#jsonref to value from where patch should be applied.) | ||
|
||
to: [self | other ] | ||
kind: (a package can reference components from another package) | ||
model: | ||
version: | ||
patch: | ||
patchStrategy: replace | ||
mutatedRef: (#jsonRef to value that should be patched.) | ||
|
||
deny: | ||
to: [self | other ] | ||
kind: (a package can reference components from another package) | ||
model: | ||
version: | ||
from: [self | other ] | ||
kind: (a package can reference components from another package) | ||
model: | ||
version: | ||
``` | ||
**Existing Relationships and Subtypes** | ||
1. Hierarchical | ||
- [Inventory](../../../../server/meshmodel/relationships/hierarchical_inv_wasm_filters.json) | ||
- [Parent](../../../../server/meshmodel/relationships/hierarchical_parent.json) | ||
2. Edge | ||
- [Mount](../../../../server/meshmodel/relationships/mount_edge.json) | ||
- [Network](../../../../server/meshmodel/relationships/network_edge.json) | ||
- [Firewall](../../../../server/meshmodel/relationships/network_policy_edge.json) | ||
- [Permission Edge](../../../../server/meshmodel/relationships/permission_edge.json) | ||
3. Sibling | ||
- [Sibling](../../../../server/meshmodel/relationships/sibling.json) | ||
For more information refer - [MesheryModel Design Specs](https://docs.google.com/document/d/16z5hA8qVfSq885of9LXFUVvfom-hQXr-6oTD_GgoFmk/edit) |