Required parameters to customize traffic switch and metric-based rollbacks
Here is the JSON schema that you have to include inside the parameters
field in your deployment strategy to let
nullplatform handle the traffic switch pace and to enable rollbacks by the http.error_rate
metric:
{
"type": "object",
"title": "Deployment strategy parameters",
"uiSchema": {
"type": "VerticalLayout",
"elements": [
{
"type": "Control",
"scope": "#/properties/metrics/properties/enabled",
"label": "Enable metric-based rollback"
},
{
"type": "Control",
"scope": "#/properties/metrics/properties/rules",
"label": "",
"options": {
"style": {
"p": 2,
"bgcolor": "background.surface",
"borderRadius": ".5rem",
"& .MuiInputBase-input": {
"bgcolor": "background.paper",
"borderRadius": ".5rem"
},
"& .MuiOutlinedInput-root": {
"bgcolor": "background.paper",
"borderRadius": ".5rem"
}
}
},
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/metrics/properties/enabled",
"schema": {
"const": true
}
}
}
},
{
"type": "Control",
"scope": "#/properties/traffic/properties/enable_auto_switch",
"label": "Customize traffic switch"
},
{
"type": "Group",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/traffic/properties/enable_auto_switch",
"schema": {
"const": true
}
}
},
"options": {
"style": {
"bgcolor": "background.surface",
"borderRadius": ".em",
"& .MuiInputBase-input": {
"bgcolor": "background.paper"
},
"& .MuiOutlinedInput-root": {
"bgcolor": "background.paper"
}
}
},
"elements": [
{
"type": "Control",
"scope": "#/properties/traffic/properties/step",
"label": "Step size",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/traffic/properties/enable_auto_switch",
"schema": {
"const": true
}
}
}
},
{
"type": "Control",
"scope": "#/properties/traffic/properties/interval",
"label": "Interval in seconds",
"rule": {
"effect": "SHOW",
"condition": {
"scope": "#/properties/traffic/properties/enable_auto_switch",
"schema": {
"const": true
}
}
}
}
]
}
]
},
"properties": {
"metrics": {
"type": "object",
"title": "Metrics configuration",
"description": "Configure metrics monitoring for deployment validation",
"default": {
"enabled": false,
"rules": []
},
"properties": {
"enabled": {
"type": "boolean",
"title": "Enable metric-based rollback",
"description": "Set a criteria for auto-rollback upon certain metric threshold is exceeded.",
"default": false
},
"rules": {
"type": "array",
"default": [],
"items": {
"type": "object",
"title": "Metric rule",
"properties": {
"name": {
"type": "string",
"title": "Metric name",
"description": "Name of the metric to monitor",
"examples": [
"error_rate",
"response_time",
"cpu_usage"
]
},
"operator": {
"type": "string",
"title": "Comparison operator",
"description": "How to compare the metric value against the threshold",
"oneOf": [
{
"const": "greater_than",
"title": "Greater than or equal to"
},
{
"const": "less_than",
"title": "Less than or equal to"
},
{
"const": "equals",
"title": "Equals to"
}
],
"default": "equals"
},
"threshold": {
"type": "number",
"title": "Threshold value",
"description": "Threshold value for the metric",
"placeholder": "eg., 10"
}
}
}
}
},
"if": {
"properties": {
"enabled": {
"const": true
}
}
},
"then": {
"properties": {
"rules": {
"minItems": 1,
"items": {
"properties": {
"name": {
"minLength": 2
},
"threshold": {
"minimum": 0
}
},
"required": [
"name",
"threshold",
"operator"
]
}
}
}
}
},
"traffic": {
"type": "object",
"title": "Traffic management",
"description": "Configure traffic switching behavior",
"default": {
"enable_auto_switch": false,
"interval": 10,
"step": 0.1
},
"properties": {
"enable_auto_switch": {
"type": "boolean",
"title": "Customize traffic switch",
"description": "Set the pace at which the traffic switch phase will take place.",
"default": false
},
"interval": {
"type": "integer",
"title": "Interval in seconds",
"description": "Seconds between traffic increments",
"default": 10
},
"step": {
"title": "Step size",
"description": "Traffic increment step as percentage",
"oneOf": [
{
"const": 0.05,
"title": "5%"
},
{
"const": 0.1,
"title": "10%"
},
{
"const": 0.15,
"title": "15%"
},
{
"const": 0.2,
"title": "20%"
},
{
"const": 0.25,
"title": "25%"
},
{
"const": 0.3,
"title": "30%"
},
{
"const": 0.35,
"title": "35%"
},
{
"const": 0.4,
"title": "40%"
},
{
"const": 0.45,
"title": "45%"
},
{
"const": 0.5,
"title": "50%"
},
{
"const": 1,
"title": "100%"
}
],
"default": 0.1
}
},
"if": {
"properties": {
"enable_auto_switch": {
"const": true
}
}
},
"then": {
"required": [
"interval",
"step"
],
"properties": {
"interval": {
"minimum": 1,
"maximum": 120
}
}
}
}
}
}