252 lines
5.2 KiB
JSON
252 lines
5.2 KiB
JSON
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://platform.example/templates/generic-http-service/v5",
|
|
"title": "generic-http-service@v5",
|
|
"description": "Port-free HTTP workload with headless discovery and independently managed networking.",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"templateRef",
|
|
"metadata",
|
|
"runtime",
|
|
"replicas",
|
|
"resources"
|
|
],
|
|
"properties": {
|
|
"templateRef": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"version"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"const": "generic-http-service"
|
|
},
|
|
"version": {
|
|
"const": "v5"
|
|
}
|
|
}
|
|
},
|
|
"type": {
|
|
"const": "web"
|
|
},
|
|
"metadata": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"description": {
|
|
"type": "string"
|
|
},
|
|
"owner": {
|
|
"type": "string"
|
|
},
|
|
"labels": {
|
|
"type": "object",
|
|
"propertyNames": {
|
|
"not": {
|
|
"pattern": "^platform\\.example/"
|
|
}
|
|
},
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"runtime": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"image",
|
|
"resolvedImage"
|
|
],
|
|
"properties": {
|
|
"image": {
|
|
"type": "string"
|
|
},
|
|
"resolvedImage": {
|
|
"type": "string",
|
|
"pattern": "^[^ @]+@sha256:[a-f0-9]{64}$"
|
|
},
|
|
"command": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"args": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"runAsRoot": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"env": {
|
|
"type": "object",
|
|
"propertyNames": {
|
|
"pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
|
|
},
|
|
"additionalProperties": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"replicas": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 10
|
|
},
|
|
"resources": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"size"
|
|
],
|
|
"properties": {
|
|
"size": {
|
|
"enum": [
|
|
"nano",
|
|
"small",
|
|
"medium",
|
|
"large"
|
|
]
|
|
}
|
|
}
|
|
},
|
|
"healthCheck": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"path",
|
|
"port",
|
|
"initialDelaySeconds"
|
|
],
|
|
"properties": {
|
|
"path": {
|
|
"type": "string",
|
|
"pattern": "^/"
|
|
},
|
|
"port": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 65535
|
|
},
|
|
"initialDelaySeconds": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"maximum": 600
|
|
}
|
|
}
|
|
},
|
|
"secretRefs": {
|
|
"type": "array",
|
|
"maxItems": 0
|
|
},
|
|
"dependencies": {
|
|
"type": "array",
|
|
"maxItems": 20,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"serviceId",
|
|
"alias",
|
|
"protocol",
|
|
"port"
|
|
],
|
|
"properties": {
|
|
"serviceId": {
|
|
"type": "string",
|
|
"pattern": "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"
|
|
},
|
|
"alias": {
|
|
"type": "string",
|
|
"pattern": "^[A-Z][A-Z0-9_]{0,48}$"
|
|
},
|
|
"protocol": {
|
|
"const": "http"
|
|
},
|
|
"port": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 65535
|
|
},
|
|
"routingMode": {
|
|
"enum": [
|
|
"headless",
|
|
"clusterIP"
|
|
],
|
|
"default": "headless"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"contract": {
|
|
"type": "object",
|
|
"additionalProperties": false
|
|
},
|
|
"volumeAttachments": {
|
|
"type": "array",
|
|
"maxItems": 8,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": [
|
|
"name",
|
|
"mountPath",
|
|
"storageProfile",
|
|
"size"
|
|
],
|
|
"properties": {
|
|
"name": {
|
|
"type": "string",
|
|
"pattern": "^[a-z0-9](?:[-a-z0-9]{0,18}[a-z0-9])?$"
|
|
},
|
|
"mountPath": {
|
|
"type": "string",
|
|
"pattern": "^/(?!/).+"
|
|
},
|
|
"storageProfile": {
|
|
"type": "string",
|
|
"pattern": "^[a-z][a-z0-9-]{0,31}$"
|
|
},
|
|
"size": {
|
|
"type": "string",
|
|
"pattern": "^[0-9]+(?:\\.[0-9]+)?(?:[EPTGMK]i?|m)?$"
|
|
},
|
|
"readOnly": {
|
|
"type": "boolean",
|
|
"default": true
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"allOf": [
|
|
{
|
|
"if": {
|
|
"required": [
|
|
"volumeAttachments"
|
|
],
|
|
"properties": {
|
|
"volumeAttachments": {
|
|
"minItems": 1
|
|
}
|
|
}
|
|
},
|
|
"then": {
|
|
"properties": {
|
|
"replicas": {
|
|
"const": 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
]
|
|
}
|