Files
deployment-portal-be/templates/rollout.jsonnet

32 lines
1.4 KiB
Jsonnet

local chart = import 'chart.jsonnet';
local common = import 'common.jsonnet';
local deployment_manifest = import 'deployment_manifest.jsonnet';
local deployment_util = import 'deployment_util.jsonnet';
local pod_template = import 'pod_template.jsonnet';
local deployment = deployment_manifest.deployment;
local vars = import 'vars.jsonnet';
local strategyConfig = deployment.strategy.config;
if (deployment.controller == vars.rolloutController) then {
apiVersion: 'argoproj.io/v1alpha1',
kind: 'Rollout',
metadata: {
name: chart.full_service_name(deployment.name),
labels: common.labels {
linkConfig: std.toString(deployment_manifest.deployment.isLinkConfig),
},
namespace: deployment_manifest.deployment.namespace,
annotations: common.annotations,
},
spec: {
progressDeadlineSeconds: deployment.progressDeadlineSeconds,
selector: {
matchLabels: common.matchLabels,
},
template: pod_template,
strategy: if deployment.strategy == 'canary' then deployment_util.strategy.canary(if 'canaryConfig' in deployment.strategyConfig then deployment.strategyConfig.canaryConfig else {})
else if deployment.strategy == 'rollingUpdateWithCanaryMixIn' then deployment_util.strategy.rollingUpdateWithCanaryMixIn(deployment.strategyConfig.rollingUpdateWithCanaryMixInConfig)
else deployment_util.strategy.rollingUpdate(),
},
}