Files
deployment-portal-be/templates/rollout_analysis_template.jsonnet
Ashvin S ef9cc1b0fc INFRA-2881 | Ashvin | Add support for multiple EFS (#818)
* INFRA-2881 | Ashvin | Remove EFS flag from manifest and jsonnetfmt the directory

* INFRA-2881 | Ashvin | Support multiple EFS volumes

* INFRA-2881 | Ashvin | Add null field check and fix tests

* INFRA-2881 | Ashvin | Add EFS jsonschema for validation

* INFRA-2881 | Ashvin | Extract EFS required condition in a variable
2024-02-27 22:39:25 +05:30

34 lines
1.2 KiB
Jsonnet

local chart = import 'chart.jsonnet';
local common = import 'common.jsonnet';
local deployment_manifest = import 'deployment_manifest.jsonnet';
local deployment = deployment_manifest.deployment;
local vars = import 'vars.jsonnet';
local templateEnabled = if 'analysisTemplate' in deployment.strategyConfig then true else false;
if (deployment.controller == vars.rolloutController && templateEnabled) then {
apiVersion: 'argoproj.io/v1alpha1',
kind: 'AnalysisTemplate',
metadata: {
name: chart.full_service_name(deployment.name),
labels: common.labels,
namespace: deployment_manifest.deployment.namespace,
annotations: common.annotations,
},
spec: {
metrics: [
{
name: 'degrade-rollout',
interval: deployment.strategyConfig.analysisTemplate.interval,
successCondition: 'result' + deployment.strategyConfig.analysisTemplate.operator + deployment.strategyConfig.analysisTemplate.threshold,
failureLimit: deployment.strategyConfig.analysisTemplate.failureLimit,
provider: {
prometheus: {
address: 'http://prometheus-kube-prometheus.monitoring.svc.cluster.local:9090',
query: deployment.strategyConfig.analysisTemplate.query,
},
},
},
],
},
}