hí ộ
This commit is contained in:
330
templates/schemas/generic-http-service.v4.json
Normal file
330
templates/schemas/generic-http-service.v4.json
Normal file
@@ -0,0 +1,330 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://platform.example/templates/generic-http-service/v4",
|
||||
"title": "generic-http-service@v4",
|
||||
"description": "One HTTP workload with a stable ClusterIP Service per logical service.",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"templateRef",
|
||||
"metadata",
|
||||
"runtime",
|
||||
"replicas",
|
||||
"resources",
|
||||
"healthCheck"
|
||||
],
|
||||
"properties": {
|
||||
"templateRef": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name",
|
||||
"version"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "generic-http-service"
|
||||
},
|
||||
"version": {
|
||||
"const": "v4"
|
||||
}
|
||||
}
|
||||
},
|
||||
"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",
|
||||
"ports"
|
||||
],
|
||||
"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"
|
||||
}
|
||||
},
|
||||
"ports": {
|
||||
"type": "array",
|
||||
"minItems": 1,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"name",
|
||||
"containerPort"
|
||||
],
|
||||
"properties": {
|
||||
"name": {
|
||||
"type": "string",
|
||||
"maxLength": 15,
|
||||
"pattern": "^(?=[a-z0-9-]*[a-z])[a-z0-9]+(?:-[a-z0-9]+)*$"
|
||||
},
|
||||
"containerPort": {
|
||||
"type": "integer",
|
||||
"minimum": 1,
|
||||
"maximum": 65535
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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
|
||||
}
|
||||
}
|
||||
},
|
||||
"exposure": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"public": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"path": {
|
||||
"const": "/"
|
||||
}
|
||||
}
|
||||
},
|
||||
"secretRefs": {
|
||||
"type": "array",
|
||||
"maxItems": 0
|
||||
},
|
||||
"dependencies": {
|
||||
"type": "array",
|
||||
"maxItems": 20,
|
||||
"items": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": [
|
||||
"serviceId",
|
||||
"alias",
|
||||
"protocol",
|
||||
"portName"
|
||||
],
|
||||
"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"
|
||||
},
|
||||
"portName": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z0-9](?:[-a-z0-9]{0,18}[a-z0-9])?$"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"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": [
|
||||
"exposure"
|
||||
],
|
||||
"properties": {
|
||||
"exposure": {
|
||||
"required": [
|
||||
"public"
|
||||
],
|
||||
"properties": {
|
||||
"public": {
|
||||
"const": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"metadata": {
|
||||
"required": [
|
||||
"labels"
|
||||
],
|
||||
"properties": {
|
||||
"labels": {
|
||||
"required": [
|
||||
"service"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"required": [
|
||||
"volumeAttachments"
|
||||
],
|
||||
"properties": {
|
||||
"volumeAttachments": {
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"properties": {
|
||||
"replicas": {
|
||||
"const": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"runtime": {
|
||||
"properties": {
|
||||
"ports": {
|
||||
"minItems": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user