-
Notifications
You must be signed in to change notification settings - Fork 0
Redis intent proposal #15
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
Open
rshreenivas
wants to merge
7
commits into
main
Choose a base branch
from
redis_intent
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
46325df
Redis intent initial commit
rshreenivas ceb5b92
Redis intent initial commit
rshreenivas 8628422
add `aof` part in redis schema
RoguedBear 7963666
remove `cache`, modify `auth` and add `redis_conf` block
RoguedBear 9d212a6
Review changes
rshreenivas 68ae837
remove `size` from schema
RoguedBear 0d70189
convert `auth`'s type to object
RoguedBear 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 hidden or 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,27 @@ | ||
| # Redis Intent Type | ||
|
|
||
| ## Overview | ||
|
|
||
| This intent type is designed to represent a Redis database configuration within an Infrastructure Catalog. It encapsulates the necessary information for provisioning and managing a Redis database instance. | ||
|
|
||
| ## Fields | ||
|
|
||
| - `metadata`: Contains auxiliary information such as the maintainer, documentation link, labels, name, and description. | ||
| - `kind`: Specifies the kind of the resource, in this case, `redis`. | ||
| - `spec`: Contains detailed information about the Redis instance including the Redis version. | ||
| - `disabled`: Indicates if the resource is disabled (`true`) or enabled (`false`) by default. | ||
| - `flavor`: Specifies the default implementation details, including the version and name. | ||
|
|
||
| ## Specification | ||
|
|
||
| In the `spec` object: | ||
| - `version`: Specifies the Redis version (e.g., `7.2.2`, `6.2.14`). | ||
| - `server_mode`: A field to specify if want to Redis in standalone or cluster mode | ||
| - `persistence`: Optional configuration for enabling redis persistence, here you can specify persistence options like RBD, AOF | ||
| - `replication`: Optional configuration for enabling redis master slave replication, you can specify replicas required | ||
| - `cache`: Optional Configuring Redis as a cache - setting maxmemory and maxmemory-policy | ||
| - `auth`: TBD - support for acl | ||
|
|
||
| ## Example | ||
|
|
||
| See the `sample.json` file for an example instance of this intent type. |
This file contains hidden or 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,5 @@ | ||
| { | ||
| "name": "Redis Database", | ||
| "api_version": "v1alpha1", | ||
| "description": "An Intent Type for deploying and managing Redis Memory Storage, following Kubernetes style version naming." | ||
| } |
This file contains hidden or 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,46 @@ | ||
| { | ||
| "api_version": "v1alpha1", | ||
| "metadata": { | ||
| "maintainer": "[email protected]", | ||
| "documentation_link": "https://example.com/documentation", | ||
| "labels": { | ||
| "owner": "[email protected]" | ||
| }, | ||
| "name": "my-redis-instance", | ||
| "description": "A Redis database instance." | ||
| }, | ||
| "kind": "redis", | ||
| "spec": { | ||
| "version": "7.2.2", | ||
| "server_mode" : "standalone", | ||
| "persistence": { | ||
| "rdb": { | ||
| "enable": true, | ||
| "snapshotTimeInSec": 300, | ||
| "noOfchanges": 10 | ||
| }, | ||
| "aof" : { | ||
| "enable" : false | ||
| } | ||
| }, | ||
| "replication": { | ||
| "enabled": true, | ||
| "replica_count": 2 | ||
| }, | ||
| "cache" : { | ||
| "enable" : true, | ||
| "maxmemory" : "10mb", | ||
| "maxmemory-policy" : "allkeys-lru" | ||
| }, | ||
| "size" : { | ||
|
||
| "cpu" : "200m", | ||
| "memory" : "10G" | ||
| } | ||
| }, | ||
| "disabled": false, | ||
| "flavor": { | ||
| "version": "1.0", | ||
| "name": "standard" | ||
| }, | ||
| "advanced": {} | ||
| } | ||
This file contains hidden or 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,245 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema", | ||
| "type": "object", | ||
| "required": [ | ||
| "api_version", | ||
| "metadata", | ||
| "kind", | ||
| "spec", | ||
| "flavor" | ||
| ], | ||
| "properties": { | ||
| "api_version": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "v1alpha1" | ||
| ], | ||
| "description": "Specifies the version of the schema." | ||
| }, | ||
| "metadata": { | ||
| "type": "object", | ||
| "required": [ | ||
| "name" | ||
| ], | ||
| "properties": { | ||
| "maintainer": { | ||
| "type": "string" | ||
| }, | ||
| "documentation_link": { | ||
| "type": "string" | ||
| }, | ||
| "labels": { | ||
| "type": "object", | ||
| "additionalProperties": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "name": { | ||
| "type": "string" | ||
| }, | ||
| "description": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "kind": { | ||
| "type": "string" | ||
| }, | ||
| "spec": { | ||
| "type": "object", | ||
| "required": [ | ||
| "version", | ||
| "server_mode", | ||
| "size" | ||
| ], | ||
| "properties": { | ||
| "version": { | ||
| "type": "string" | ||
| }, | ||
| "server_mode": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "standalone", | ||
| "replication" | ||
| ], | ||
| "description": "The server mode to run redis in" | ||
| }, | ||
| "persistence": { | ||
| "type": "object", | ||
| "properties": { | ||
| "rdb": { | ||
| "type": "object", | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean" | ||
| }, | ||
| "snapshotTimeInSec": { | ||
| "type": "integer" | ||
| }, | ||
| "noOfchanges": { | ||
| "type": "integer" | ||
| } | ||
| }, | ||
| "if": { | ||
| "properties": { | ||
| "enabled": { | ||
| "const": true | ||
| } | ||
| } | ||
| }, | ||
| "then": { | ||
| "required": [ | ||
| "snapshotTimeInSec", | ||
| "noOfchanges" | ||
| ] | ||
| } | ||
| }, | ||
| "aof": { | ||
| "type": "object", | ||
| "properties": { | ||
| "enable": { | ||
| "type": "boolean" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "enable" | ||
| ] | ||
| } | ||
| }, | ||
| "description": "Optional persistence config. Either specify `rdb` config or `aos` config" | ||
| }, | ||
| "replication": { | ||
| "type": "object", | ||
| "description": "Configure the replication count (optional)", | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean" | ||
| }, | ||
| "replica_count": { | ||
| "type": "integer" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "enabled" | ||
| ], | ||
| "if": { | ||
| "properties": { | ||
| "enabled": { | ||
| "const": true | ||
| } | ||
| } | ||
| }, | ||
| "then": { | ||
| "required": [ | ||
| "replica_count" | ||
| ] | ||
| } | ||
| }, | ||
| "cache": { | ||
| "type": "object", | ||
| "properties": { | ||
| "enable": { | ||
| "type": "boolean" | ||
| }, | ||
| "maxmemory": { | ||
| "type": "string" | ||
| }, | ||
| "maxmemory-policy": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "noeviction", | ||
| "allkeys-lru", | ||
| "allkeys-lfu", | ||
| "volatile-lru", | ||
| "volatile-lfu", | ||
| "allkeys-random", | ||
| "volatile-random", | ||
| "volatile-ttl" | ||
| ] | ||
| } | ||
| }, | ||
| "required": [ | ||
| "enable" | ||
| ], | ||
| "if": { | ||
| "properties": { | ||
| "enable": { | ||
| "const": true | ||
| } | ||
| } | ||
| }, | ||
| "then": { | ||
| "required": [ | ||
| "maxmemory", | ||
| "maxmemory-policy" | ||
| ] | ||
| } | ||
| }, | ||
| "auth": { | ||
| "type": "object", | ||
| "properties": { | ||
| "enabled": { | ||
| "type": "boolean" | ||
| }, | ||
| "username": { | ||
| "type": "string" | ||
| }, | ||
| "password": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "if": { | ||
| "properties": { | ||
| "enabled": { | ||
| "const": true | ||
| } | ||
| } | ||
| }, | ||
| "then": { | ||
| "required": [ | ||
| "username", | ||
| "password" | ||
| ] | ||
| } | ||
| }, | ||
| "size": { | ||
| "type": "object", | ||
| "properties": { | ||
| "cpu": { | ||
| "type": "string" | ||
| }, | ||
| "memory": { | ||
| "type": "string" | ||
| } | ||
| }, | ||
| "required": [ | ||
| "cpu", | ||
| "memory" | ||
| ] | ||
| } | ||
| } | ||
| }, | ||
| "disabled": { | ||
| "type": "boolean", | ||
| "default": false | ||
| }, | ||
| "flavor": { | ||
| "type": "object", | ||
| "required": [ | ||
| "version", | ||
| "name" | ||
| ], | ||
| "properties": { | ||
| "version": { | ||
| "type": "string" | ||
| }, | ||
| "name": { | ||
| "type": "string" | ||
| } | ||
| } | ||
| }, | ||
| "advanced": { | ||
| "type": "object" | ||
| } | ||
| } | ||
| } |
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.
move these to configuration