-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add AppScope Configuration #147
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,73 @@ | ||
# AppScope Configuration | ||
|
||
This section describes how application scope can be set up using app-scope configuration. | ||
|
||
An app scope needs to be set up before used in the deployment of components. To set up an app scope, we just deploy an app-scope configuration. | ||
|
||
An app-scope configuration (abbr. `scope config`) is managed by the _app operator_ role, and provides information specific to the current set-up of an app scope. | ||
|
||
## Defining an AppScope Configuration | ||
|
||
### Top-Level Attributes | ||
|
||
The top-level attributes of an app-scope config define its apiVersion, kind, metadata, and spec. | ||
|
||
| Attribute | Type | Required | Default Value | Description | | ||
|-----------|------|----------|---------------|-------------| | ||
| `apiVersion` | `string` | Y || The API version of the specification in use. At present only `core.hydra.io/v1alpha1` is defined. | | ||
| `kind` | `string` | Y || The string `AppScopeConfiguration` | | ||
| `metadata` | [`Metadata`](#metadata) | Y | | AppScope configuration metadata. | | ||
| `spec`| [`Spec`](#spec) | Y || A container for exposing configuration attributes. | | ||
|
||
### Metadata | ||
|
||
Metadata describes this trait. The metadata section is defined in [Section 3](3.component_model.md#metadata). | ||
|
||
|
||
### Spec | ||
The specification follows the structure as below: | ||
|
||
| Attribute | Type | Required | Default Value | Description | | ||
|-----------|------|----------|---------------|-------------| | ||
| `appScopeType` | `string` | Y | | The type of the app-scope to create an instance of. | | ||
| `properties` | [`Properties`](#properties) | N | | The properties attached to this scope. | | ||
|
||
### Properties | ||
|
||
`properties` is an object whose structure is determined by the scope property schema. It may be a simple value, or it may be a complex object. Properties are validated against the appropriate schema for the scope. For example, if a scope defines a schema for properties that requires an array of integers with at least one member, the `properties` object is expected to be an array of integers with at least one member. During validation of the `properties` object, the scope's property schema will be applied. | ||
|
||
If no schema is supplied, a property will be passed to the scope runtime without structural validation. As long as it parses as YAML or JSON, it will be considered valid. | ||
|
||
## Example | ||
The following is an example of a complete YAML file that illustrates the configurational elements above: | ||
|
||
```yaml | ||
apiVersion: core.hydra.io/v1alpha1 | ||
kind: AppScopeConfiguration | ||
metadata: | ||
name: public-vpc | ||
spec: | ||
appScopeType: core.hydra.io/v1alpha1.Network | ||
properties: | ||
- name: network-id | ||
value: myNetwork | ||
- name: subnet-id | ||
value: public-subnet | ||
- name: gateway-type | ||
value: public | ||
|
||
--- | ||
apiVersion: core.hydra.io/v1alpha1 | ||
kind: AppScopeConfiguration | ||
metadata: | ||
name: private-vpc | ||
spec: | ||
appScopeType: core.hydra.io/v1alpha1.Network | ||
properties: | ||
- name: network-id | ||
value: myNetwork | ||
- name: subnet-id | ||
value: private-subnet | ||
- name: gateway-type | ||
value: nat | ||
``` | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add an example of HealthScope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing.
I am still waiting for more feedback from @mikkelhegn @technosophos @suhuruli to see if we all agree on this spec/model.
Once consensus is made, I will add more examples to demonstrate usability!