Skip to content

Commit

Permalink
Added folder with Score schema reference
Browse files Browse the repository at this point in the history
  • Loading branch information
sujaya-sys committed Aug 18, 2023
1 parent 4880635 commit 10abfb1
Showing 1 changed file with 336 additions and 0 deletions.
336 changes: 336 additions & 0 deletions schema/schema/schema-v1b1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,336 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://score.dev/schemas/score",
"title": "Score schema",
"description": "Score workload specification",
"type": "object",
"required": [
"apiVersion",
"metadata",
"containers"
],
"additionalProperties": false,
"properties": {
"apiVersion": {
"description": "The declared Score Specification version.",
"type": "string"
},
"metadata": {
"description": "The metadata description of the Workload.",
"type": "object",
"required": [
"name"
],
"additionalProperties": true,
"properties": {
"name": {
"description": "A string that can describe the Workload.",
"type": "string"
}
}
},
"service": {
"description": "The service that the workload provides.",
"type": "object",
"additionalProperties": false,
"properties": {
"ports": {
"description": "List of network ports published by the service.",
"type": "object",
"additionalProperties": true,
"minProperties": 1,
"patternProperties": {
"^*": {
"description": "The network port description.",
"type": "object",
"required": [
"targetPort"
],
"additionalProperties": false,
"properties": {
"port": {
"description": "The public service port.",
"type": "number"
},
"targetPort": {
"description": "The internal service port.",
"type": "number"
}
}
}
}
}
}
},
"containers": {
"description": "The declared Score Specification version.",
"type": "object",
"additionalProperties": true,
"minProperties": 1,
"patternProperties": {
"^*": {
"description": "The container name.",
"type": "object",
"required": [
"image"
],
"additionalProperties": false,
"properties": {
"image": {
"description": "The image name and tag.",
"type": "string"
},
"command": {
"description": "If specified, overrides container entry point.",
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"args": {
"description": "If specified, overrides container entry point arguments.",
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
},
"variables": {
"description": "The environment variables for the container.",
"type": "object",
"minProperties": 1,
"additionalProperties": { "type": "string" }
},
"files": {
"description": "The extra files to mount.",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"target",
"content"
],
"properties": {
"target": {
"description": "The file path and name.",
"type": "string"
},
"mode": {
"description": "The file access mode.",
"type": "string"
},
"content": {
"description": "The inline content for the file.",
"type": "array",
"minItems": 1,
"items": {
"type": "string"
}
}
}
}
},
"volumes": {
"description": "The volumes to mount.",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": [
"source",
"target"
],
"properties": {
"source": {
"description": "The external volume reference.",
"type": "string"
},
"path": {
"description": "An optional sub path in the volume.",
"type": "string"
},
"target": {
"description": "The target mount on the container.",
"type": "string"
},
"read_only": {
"description": "Indicates if the volume should be mounted in a read-only mode.",
"type": "boolean"
}
}
}
},
"resources": {
"description": "The compute resources for the container.",
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"properties": {
"limits": {
"description": "The maximum allowed resources for the container.",
"$ref": "#/properties/containers/definitions/resourcesLimits"
},
"requests": {
"description": "The minimal resources required for the container.",
"$ref": "#/properties/containers/definitions/resourcesLimits"
}
}
},
"livenessProbe": {
"description": "The liveness probe for the container.",
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"properties": {
"httpGet": {
"description": "",
"$ref": "#/properties/containers/definitions/httpProbe"
}
}
},
"readinessProbe": {
"description": "The readiness probe for the container.",
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"properties": {
"httpGet": {
"description": "",
"$ref": "#/properties/containers/definitions/httpProbe"
}
}
}
}
}
},
"definitions": {
"resourcesLimits": {
"description": "The compute resources limits.",
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"properties": {
"memory": {
"description": "The memory limit.",
"type": "string"
},
"cpu": {
"description": "The CPU limit.",
"type": "string"
}
}
},
"httpProbe": {
"description": "An HTTP probe details.",
"type": "object",
"additionalProperties": false,
"required": [
"path"
],
"properties": {
"path": {
"description": "The path of the HTTP probe endpoint.",
"type": "string"
},
"port": {
"description": "The path of the HTTP probe endpoint.",
"type": "number"
},
"httpHeaders": {
"description": "Additional HTTP headers to send with the request",
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"description": "The HTTP header name.",
"type": "string"
},
"value": {
"description": "The HTTP header value.",
"type": "string"
}
}
}
}
}
}
}
},
"resources": {
"description": "The dependencies needed by the Workload.",
"type": "object",
"minProperties": 1,
"additionalProperties": true,
"patternProperties": {
"^*": {
"description": "The resource name.",
"type": "object",
"additionalProperties": false,
"required": [
"type"
],
"properties": {
"type": {
"description": "The resource in the target environment.",
"type": "string"
},
"metadata": {
"description": "The metadata for the resource.",
"type": "object",
"minProperties": 1,
"additionalProperties": true,
"properties": {
"annotations": {
"description": "Annotattions that apply to the property.",
"type": "object",
"minProperties": 1,
"additionalProperties": { "type": "string" }
}
}
},
"properties": {
"description": "The properties that can be referenced in other places in the Score Specification file.",
"type": "object",
"minProperties": 1,
"patternProperties": {
"^*": {
"description": "The property name.",
"type": ["object", "null"],
"minProperties": 1,
"additionalProperties": false,
"properties": {
"type": {
"description": "The property value type.",
"type": "string"
},
"default": {
"description": "A value that applies for the property by default.",
"type": ["integer", "string", "boolean"]
},
"required": {
"description": "Indictes if the property value is requred.",
"type": "boolean"
},
"secret": {
"description": "Indicates if the property value contains sensitive information.",
"type": "boolean"
}
}
}
}
},
"params": {
"description": "The parameters used to validate or provision the resource in the environment.",
"type": "object"
}
}
}
}
}
}
}

0 comments on commit 10abfb1

Please sign in to comment.