243 lines
12 KiB
YAML
243 lines
12 KiB
YAML
<% if (deploymentStrategy == 'canary'){ print "canary:\n enabled: true\n slackChannel: ${canary.slackChannel}\n enableManualPromotion: ${enableManualPromotion}\n skipAnalysis: ${canary.skipAnalysis}\n service:\n port: 80\n targetPort: ${primary_port}\n progressDeadlineSeconds: ${canary.progressDeadlineSeconds}\n minCanaryReplicas: ${minCanaryReplicas}\n maxCanaryReplicas: ${maxCanaryReplicas}\n analysisInterval: ${canary.analysisInterval}\n analysisThreshold: ${canary.analysisThreshold}\n analysisMaxWeight: ${canary.analysisMaxWeight}\n analysisStepWeight: ${canary.analysisStepWeight}\n analysisMetrics:\n thresholdRangeMin: ${canary.analysisMetrics.thresholdRangeMin}\n interval: ${canary.analysisMetrics.interval}\n" } else { print "canary:\n enabled: false\n" } %>repoName: ${repo_name}
|
|
cron:
|
|
enabled: false
|
|
serviceAccount:
|
|
enabled: false
|
|
applicationName: ${app_name}
|
|
appType: ${dockerBuildVersion}
|
|
autoscaling:
|
|
enabled: ${as_enabled}
|
|
maxReplicas: ${as_max}
|
|
minReplicas: ${as_min}
|
|
pollingInterval: ${as_poll}
|
|
scaledown:
|
|
policies:
|
|
- periodseconds: ${as_down_period}
|
|
type: Pods
|
|
value: ${as_down_pod_count}
|
|
selectpolicy: Min
|
|
stabilizationWindowSeconds: ${as_down_stable_window}
|
|
scaleup:
|
|
policies:
|
|
- periodseconds: ${as_up_period}
|
|
type: Pods
|
|
value: ${as_up_pod_count}
|
|
- periodseconds: ${as_up_period}
|
|
type: Percent
|
|
value: ${as_up_pod_percentage}
|
|
selectpolicy: Max
|
|
stabilizationWindowSeconds: ${as_up_stable_window}
|
|
<% if(!triggers){print " triggers:\n - metadata:\n value: \"${as_trigger_value}\"\n metricType: ${as_trigger_type}\n type: ${as_trigger_metric}"} else {println ' triggers:'; for(val in triggers){if(val instanceof Map){ val.each{k,v -> if (v instanceof Map) { println ' - '+k+':'; v.each{a,b -> if(b.isNumber()){println " ${a}: \"${b}\"" } else {println " ${a}: ${b}" }}} else {println" ${k}: ${v}"}}}}} %>
|
|
deployment:
|
|
enabled: <% if (kind == "deployment" || kind == "Deployment") { print "true" } else { print "false" } %>
|
|
updateStrategy:
|
|
strategy:
|
|
rollingUpdate:
|
|
maxUnavailable: 0%
|
|
maxSurge: <% print "${maxSurge}%" %>
|
|
type: RollingUpdate
|
|
affinity: {}
|
|
podDistributionSkew: ${podDistributionSkew}
|
|
env:
|
|
- name: SUPERVISORD_CONFIG_FILE
|
|
value: ${supervisord_config_path}
|
|
envFrom:
|
|
secretRef: ${app_name}
|
|
image:
|
|
pullPolicy: IfNotPresent
|
|
pullSecret: ""
|
|
repository: ${registry}/${environment}/${build_team}/<% print module=='module_less'?repo_name.toLowerCase():repo_name.toLowerCase()+'/'+module %>
|
|
tag: ${tag}
|
|
<% if(lifecycle) { println ' lifecycle:\n preStop:\n exec:\n command:'; for(val in lifecycle.preStop.exec.command){ println " - $val" }} else {print " lifecycle:\n preStop:\n exec:\n command:\n - /bin/bash\n - -c\n - kill -SIGQUIT 1 ; /bin/sleep 60"} %>
|
|
minReadySeconds: 10
|
|
podAnnotations:
|
|
<% if (appMetrics) { print 'prometheus.io/path: /actuator/prometheus' %>
|
|
<% print 'prometheus.io/port: "'+app_port+'"' %>
|
|
<% print 'prometheus.io/scrape: "true"'} %>
|
|
<% if (pod_annotations) {pod_annotations.each{k,v -> println " ${k}: ${v}"};} else {print ''} %>
|
|
ports:
|
|
- containerPort: ${app_port}
|
|
name: http
|
|
protocol: TCP
|
|
- containerPort: 9901
|
|
name: metric
|
|
protocol: TCP
|
|
probes:
|
|
liveness:
|
|
failureThreshold: ${liveness_failure_threshold}
|
|
initialDelaySeconds: ${initialDelaySeconds}
|
|
path: ${health_check}
|
|
periodSeconds: ${liveness_period_seconds}
|
|
port: http
|
|
scheme: HTTP
|
|
successThreshold: ${liveness_success_threshold}
|
|
timeoutSeconds: ${liveness_timeout_seconds}
|
|
readiness:
|
|
failureThreshold: ${readiness_failure_threshold}
|
|
initialDelaySeconds: ${initialDelaySeconds}
|
|
path: ${health_check}
|
|
periodSeconds: ${readiness_period_seconds}
|
|
port: http
|
|
scheme: HTTP
|
|
successThreshold: ${readiness_success_threshold}
|
|
timeoutSeconds: ${readiness_timeout_seconds}
|
|
replicaCount: ${replica_count}
|
|
resources:
|
|
limits:
|
|
cpu: ${cpu_limit}
|
|
memory: ${memory_limit}i
|
|
requests:
|
|
cpu: ${cpu_request}
|
|
memory: ${memory_request}i
|
|
revisionHistoryLimit: 6
|
|
<% if(serviceAccount){println ' serviceAccount:\n annotations:';serviceAccount.annotations.each{k,v -> println " ${k}: ${v}"};println " enabled: ${serviceAccount.enabled}"} else {print ' serviceAccount:\n annotations: null\n enabled: false'} %>
|
|
nodeSelector:
|
|
${nodeSelector}: ${nodeSelectorValue}
|
|
<% if (hostAliases){println ' hostAliases:';for(arr in hostAliases){println ' - ip: '+arr.get("ip"); println ' hostnames:'; for (ele in arr.get("hostnames")) { println ' - '+ele } }} %>
|
|
tolerations:
|
|
- effect: NoSchedule
|
|
key: ${nodeSelector}
|
|
operator: Equal
|
|
value: ${nodeSelectorValue}
|
|
externalSecret:
|
|
annotations:
|
|
<% if (external_secrets_annotations) {external_secrets_annotations.each{k,v -> println " ${k}: ${v}"};} else {print ''} %>
|
|
enabled: true
|
|
path: meesho/${vault_env}/${bu}/${team}/${app_name}
|
|
version: ${tag}
|
|
name: ${env_ns}-${app_name}
|
|
target: ${app_name}
|
|
fullnameOverride: ""
|
|
replicaCount: ${replica_count}
|
|
ingress:
|
|
annotations:
|
|
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
|
|
nginx.ingress.kubernetes.io/rewrite-target: /
|
|
nginx.ingress.kubernetes.io/ssl-redirect: "false"
|
|
enabled: true
|
|
<% if(grpc_host){println " grpc_hosts:\n - host: ${grpc_host}\n paths:\n - pathType: ImplementationSpecific\n path: /"} else if (grpc_hosts) {println " grpc_hosts:";for(host_arr in grpc_hosts){println " - host: ${host_arr.host}\n paths:";for(path_arr in host_arr.paths){println " - pathType: ${path_arr.pathType}\n path: ${path_arr.path}"; if(path_arr.targetService) { println " targetService: ${path_arr.targetService}" } }}} %>
|
|
<% if(host){println " hosts:\n - host: ${host}\n paths:\n - pathType: ImplementationSpecific\n path: /"} else {println " hosts:";for(host_arr in hosts){println " - host: ${host_arr.host}\n paths:";for(path_arr in host_arr.paths){println " - pathType: ${path_arr.pathType}\n path: ${path_arr.path}"; if(path_arr.targetService) { println " targetService: ${path_arr.targetService}" } }}} %> ingressClassName: ${ingress_class}
|
|
servicePort: http
|
|
enableWebsocket: ${enableWebsocket}
|
|
slowStart:
|
|
enabled: <% if (slowStartWindow) { print "true" } else { print "false" } %>
|
|
window: <% if (slowStartWindow) { print "${slowStartWindow}" } else { print "120s" } %>
|
|
aggression: <% if (slowStartAggression) { print "${slowStartAggression}" } else { print "1.0" } %>
|
|
minPercent: <% if (slowStartMinPercent) { print "${slowStartMinPercent}" } else { print "10" } %>
|
|
jmxconfig:
|
|
enabled: true
|
|
labels:
|
|
priority: <% print priority?:'p1' %>
|
|
priority_v2: <% print priority_v2?:'cp3' %>
|
|
primary_owner: ${primary_owner}
|
|
secondary_owner: ${secondary_owner}
|
|
env: ${environment_norm}
|
|
team: ${team_norm}
|
|
bu: ${bu_norm}
|
|
<% if (service_type_norm) { println "service_type: ${service_type_norm}" } %>
|
|
commit_id: ${commit_id}
|
|
nameOverride: ""
|
|
namespace: ${env_ns}-${app_name}
|
|
podDisruptionBudget:
|
|
enabled: false
|
|
maxUnavailable: 100%
|
|
minAvailable: ${pdbMinAvailable}
|
|
podSecurityContext:
|
|
fsGroup: 65534
|
|
runAsGroup: 65534
|
|
runAsUser: 65534
|
|
service:
|
|
<% if (service_annotations) { println " annotations:"; service_annotations.each{k,v -> println " ${k}: \"${v}\""};} else { println " annotations: null" } %>
|
|
enabled: true
|
|
ports:
|
|
- name: http
|
|
port: 80
|
|
protocol: TCP
|
|
targetPort: ${app_port}
|
|
type: ClusterIP
|
|
statefulset:
|
|
enabled: <% if (kind == "statefulset" || kind == "StatefulSet" || kind == "statefulSet") { print "true" } else { print "false" } %>
|
|
updateStrategy: <% if (statefulset.updateStrategy == "RollingUpdate" || statefulset.updateStrategy == "rollingUpdate" || statefulset.updateStrategy == "rollingupdate") { print "RollingUpdate" } else { print "null" } %>
|
|
volumeType: ${statefulset.volumeType}
|
|
<% if(statefulset.volumeType == "static" || statefulset.volumeType == "Static") { println " staticVolume:"; statefulset.staticVolume.each{k,v -> println " ${k}: ${v}"};} else {print " staticVolume:\n accessMode: ReadWriteMany\n mountPath: /opt/data\n size: 5Gi\n storageClass: meesho-gp2\n volumeHandle: fs-0e2a97a38b01857d1::fsap-07b146e3bc7aef280\n csiDriver: efs.csi.aws.com"} %>
|
|
<% if(statefulset.volumeType == "dynamic" || statefulset.volumeType == "Dynamic") { println " dynamicVolume:"; statefulset.dynamicVolume.each{k,v -> println " ${k}: ${v}"};} else {print " dynamicVolume:\n accessMode: ReadWriteMany\n mountPath: /opt/data\n size: 5Gi\n storageClass: meesho-gp2"} %>
|
|
createContourGateway: <% if (createContourGateway) { print "${createContourGateway}" } else { print "false" } %>
|
|
contourResponseTimeout: ${contourResponseTimeout}
|
|
podtemplate:
|
|
affinity: {}
|
|
env:
|
|
- name: SUPERVISORD_CONFIG_FILE
|
|
value: ${supervisord_config_path}
|
|
envFrom:
|
|
secretRef: ${app_name}
|
|
image:
|
|
pullPolicy: IfNotPresent
|
|
pullSecret: ""
|
|
repository: ${registry}/${environment}/${build_team}/<% print module=='module_less'?repo_name.toLowerCase():repo_name.toLowerCase()+'/'+module %>
|
|
tag: ${tag}
|
|
<% if(lifecycle) { println ' lifecycle:\n preStop:\n exec:\n command:'; for(val in lifecycle.preStop.exec.command){ println " - $val" }} else {print " lifecycle:\n preStop:\n exec:\n command:\n - /bin/bash\n - -c\n - kill -SIGQUIT 1 ; /bin/sleep 60"} %>
|
|
minReadySeconds: 10
|
|
podAnnotations:
|
|
<% if (appMetrics) { print 'prometheus.io/path: /actuator/prometheus' %>
|
|
<% print 'prometheus.io/port: "'+app_port+'"' %>
|
|
<% print 'prometheus.io/scrape: "true"'} %>
|
|
<% if (pod_annotations) {pod_annotations.each{k,v -> println " ${k}: ${v}"};} else {print ''} %>
|
|
ports:
|
|
- containerPort: ${app_port}
|
|
name: http
|
|
protocol: TCP
|
|
- containerPort: 9901
|
|
name: metric
|
|
protocol: TCP
|
|
probes:
|
|
liveness:
|
|
failureThreshold: ${liveness_failure_threshold}
|
|
initialDelaySeconds: ${initialDelaySeconds}
|
|
path: ${health_check}
|
|
periodSeconds: ${liveness_period_seconds}
|
|
port: http
|
|
scheme: HTTP
|
|
successThreshold: ${liveness_success_threshold}
|
|
timeoutSeconds: ${liveness_timeout_seconds}
|
|
readiness:
|
|
failureThreshold: ${readiness_failure_threshold}
|
|
initialDelaySeconds: ${initialDelaySeconds}
|
|
path: ${health_check}
|
|
periodSeconds: ${readiness_period_seconds}
|
|
port: http
|
|
scheme: HTTP
|
|
successThreshold: ${readiness_success_threshold}
|
|
timeoutSeconds: ${readiness_timeout_seconds}
|
|
replicaCount: ${replica_count}
|
|
resources:
|
|
limits:
|
|
cpu: ${cpu_limit}
|
|
memory: ${memory_limit}i
|
|
requests:
|
|
cpu: ${cpu_request}
|
|
memory: ${memory_request}i
|
|
revisionHistoryLimit: 6
|
|
serviceAccount:
|
|
annotations: null
|
|
enabled: false
|
|
nodeSelector:
|
|
${nodeSelector}: ${nodeSelectorValue}
|
|
<% if (hostAliases){println ' hostAliases:';for(arr in hostAliases){println ' - ip: '+arr.get("ip"); println ' hostnames:'; for (ele in arr.get("hostnames")) { println ' - '+ele } }} %>
|
|
tolerations:
|
|
- effect: NoSchedule
|
|
key: ${nodeSelector}
|
|
operator: Equal
|
|
value: ${nodeSelectorValue}
|
|
appConfig:
|
|
enabled: <% if(appConfigEnabled) { print "true" } else { print "false"} %>
|
|
env: ${environment}
|
|
<% if(appConfigEnabled) {%>
|
|
staticAppConfig:
|
|
data: |
|
|
${staticAppConfigData.trim().replaceAll("(?m)^", " ")}
|
|
dynamicAppConfig:
|
|
data: |
|
|
${dynamicAppConfigData.trim().replaceAll("(?m)^", " ")}
|
|
<% }
|
|
%>
|