diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/deployment.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/deployment.yaml index 659f7ecc39..8eb252c82d 100644 --- a/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/deployment.yaml +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/deployment.yaml @@ -56,10 +56,10 @@ spec: matchLabels: {{- if .Values.customMatchLabels }} {{ toYaml .Values.customMatchLabels | indent 6 }} - {{- else }} +{{- else }} app: {{ template ".Chart.Name .name" $ }} release: {{ $.Release.Name }} -{{- end }} +{{- end }} replicas: {{ $.Values.replicaCount }} minReadySeconds: {{ $.Values.MinReadySeconds }} template: @@ -71,20 +71,20 @@ spec: {{- end }} {{- end }} labels: + app: {{ template ".Chart.Name .name" $ }} + release: {{ $.Release.Name }} appId: {{ $.Values.app | quote }} envId: {{ $.Values.env | quote }} - {{- if .Values.appLabels }} -{{ toYaml .Values.appLabels | indent 8 }} -{{- end }} + release: {{ $.Release.Name }} {{- if .Values.customPodLabels }} -{{ toYaml .Values.customPodLabels | indent 8 }} - {{- else }} - app: {{ template ".Chart.Name .name" $ }} - release: {{ $.Release.Name }} +{{ toYaml .Values.customPodLabels | indent 8 }} +{{- end }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 8 }} +{{- end }} {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 8 }} {{- end }} -{{- end }} spec: {{- if $.Values.podExtraSpecs }} {{ toYaml .Values.podExtraSpecs | indent 6 }} @@ -492,7 +492,7 @@ spec: {{- end }} {{- end }} {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }} - {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }} + {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }} {{- if $.Values.appMetrics }} - name: envoy image: {{ $.Values.envoyproxy.image | default "quay.io/devtron/envoy:v1.16.0"}} @@ -666,9 +666,10 @@ spec: matchLabels: {{- if .Values.customMatchLabels }} {{ toYaml .Values.customMatchLabels | indent 6 }} -{{- end }} +{{- else }} app: {{ template ".Chart.Name .name" $ }} release: {{ $.Release.Name }} +{{- end }} replicas: {{ $.Values.secondaryWorkload.replicaCount | default 1 }} minReadySeconds: {{ $.Values.MinReadySeconds }} template: @@ -1102,7 +1103,7 @@ spec: {{- end }} {{- end }} {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }} - {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }} + {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }} {{- if $.Values.appMetrics }} - name: envoy image: {{ $.Values.envoyproxy.image | default "quay.io/devtron/envoy:v1.16.0"}} @@ -1233,7 +1234,7 @@ spec: {{- end }} {{- end }} {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) (eq (.Values.appMetrics) false) }} []{{- end }} - {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) (eq (.Values.appMetrics) false)}} [] {{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) (eq (.Values.appMetrics) false) }} [] {{- end }} revisionHistoryLimit: 3 ## pauseForSecondsBeforeSwitchActive: {{ $.Values.pauseForSecondsBeforeSwitchActive }} @@ -1248,4 +1249,5 @@ spec: {{- if eq .Values.deploymentType "RECREATE" }} type: "Recreate" {{- end }} -{{- end }} \ No newline at end of file +{{- end }} + diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/hpa.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/hpa.yaml index 91553a09f5..2c9aee0efc 100644 --- a/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/hpa.yaml +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/hpa.yaml @@ -22,6 +22,9 @@ metadata: {{- if .Values.autoscaling.labels }} {{ toYaml .Values.autoscaling.labels | indent 4 }} {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/keda-autoscaling.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/keda-autoscaling.yaml index 371363ab1a..780afa73b1 100644 --- a/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/keda-autoscaling.yaml +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/templates/keda-autoscaling.yaml @@ -69,7 +69,9 @@ metadata: release: {{ $.Release.Name }} appId: {{ $.Values.app | quote }} envId: {{ $.Values.env | quote }} - + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} spec: {{ toYaml $.Values.kedaAutoscaling.triggerAuthentication.spec | indent 2 }} {{- end }} diff --git a/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/test_values.yaml b/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/test_values.yaml index dd0395f97f..3f982f4f29 100644 --- a/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/test_values.yaml +++ b/scripts/devtron-reference-helm-charts/deployment-chart_4-20-0/test_values.yaml @@ -766,7 +766,7 @@ affinity: topologyKey: topology.kubernetes.io/zone secondaryWorkload: - enabled: true + enabled: false postfix: "od" replicaCount: 1 affinity: {} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/deployment.yaml b/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/deployment.yaml index 033933790a..46f42f2015 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/deployment.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/deployment.yaml @@ -55,10 +55,10 @@ spec: matchLabels: {{- if .Values.customMatchLabels }} {{ toYaml .Values.customMatchLabels | indent 6 }} - {{- else }} +{{- else }} app: {{ template ".Chart.Name .name" $ }} release: {{ $.Release.Name }} -{{- end }} +{{- end }} replicas: {{ $.Values.replicaCount }} minReadySeconds: {{ $.Values.MinReadySeconds }} template: @@ -70,20 +70,19 @@ spec: {{- end }} {{- end }} labels: + app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} envId: {{ $.Values.env | quote }} - {{- if .Values.appLabels }} -{{ toYaml .Values.appLabels | indent 8 }} -{{- end }} + release: {{ $.Release.Name }} {{- if .Values.customPodLabels }} -{{ toYaml .Values.customPodLabels | indent 8 }} - {{- else }} - app: {{ template ".Chart.Name .name" $ }} - release: {{ $.Release.Name }} +{{ toYaml .Values.customPodLabels | indent 8 }} +{{- end }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 8 }} +{{- end }} {{- if .Values.podLabels }} {{ toYaml .Values.podLabels | indent 8 }} {{- end }} -{{- end }} spec: {{- if $.Values.podExtraSpecs }} {{ toYaml .Values.podExtraSpecs | indent 6 }} @@ -622,4 +621,4 @@ spec: maxUnavailable: {{ $.Values.deployment.strategy.canary.maxUnavailable }} steps: {{ toYaml .Values.deployment.strategy.canary.steps | indent 8 }} - {{- end }} \ No newline at end of file + {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/hpa.yaml b/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/hpa.yaml index c7ba46e15b..95838e3df5 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/hpa.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/hpa.yaml @@ -22,6 +22,9 @@ metadata: {{- if .Values.autoscaling.labels }} {{ toYaml .Values.autoscaling.labels | indent 4 }} {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} spec: scaleTargetRef: apiVersion: argoproj.io/v1alpha1 diff --git a/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/keda-autoscaling.yaml b/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/keda-autoscaling.yaml index ae06dd63ee..b1ad9fa145 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/keda-autoscaling.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/templates/keda-autoscaling.yaml @@ -69,7 +69,9 @@ metadata: release: {{ $.Release.Name }} appId: {{ $.Values.app | quote }} envId: {{ $.Values.env | quote }} - + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} spec: {{ toYaml $.Values.kedaAutoscaling.triggerAuthentication.spec | indent 2 }} {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/test_values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/test_values.yaml index 7077cd4327..f7d096901f 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/test_values.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_4-20-0/test_values.yaml @@ -581,7 +581,7 @@ tolerations: [] # value: "value" # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" -appMetrics: false +appMetrics: true serviceAccount: ## @param serviceAccount.create Enable creation of ServiceAccount for pods ## diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/app-values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/app-values.yaml index 0555153aee..454d1b5fa9 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/app-values.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/app-values.yaml @@ -40,6 +40,8 @@ ContainerPort: useHTTP2: false supportStreaming: false idleTimeout: 1800s + protocol: TCP + resizePolicy: [] # servicemonitor: # enabled: true # path: /abc @@ -223,6 +225,10 @@ Spec: # Key: kops.k8s.io/instancegroup Values: +affinity: + enabled: false + values: {} + ambassadorMapping: enabled: false labels: {} @@ -247,6 +253,10 @@ autoscaling: annotations: {} labels: {} behavior: {} + containerResource: + enabled: false + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 # scaleDown: # stabilizationWindowSeconds: 300 # policies: @@ -299,7 +309,7 @@ servicemonitor: additionalLabels: {} envoyproxy: - image: docker.io/envoyproxy/envoy:v1.16.0 + image: quay.io/devtron/envoy:v1.16.0 configMapName: "" lifecycle: {} resources: @@ -425,3 +435,8 @@ hostAliases: [] # hostnames: # - "foo.remote" # - "bar.remote" +peristentVolumeClaim: {} + + +verticalPodScaling: + enabled: false \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/_helpers.tpl b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/_helpers.tpl index ada78dad51..170e5fb273 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/_helpers.tpl +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/_helpers.tpl @@ -140,3 +140,11 @@ Create chart name and version as used by the chart label. {{ default "default" .Values.serviceAccount.name }} {{- end -}} {{- end -}} + +{{- define "VerticalPodAutoScalingEnabled" -}} + {{- $SMenabled := false -}} + {{- if and .Values.verticalPodScaling.enabled }} + {{- $SMenabled = true -}} + {{- end }} + {{- $SMenabled -}} +{{- end -}} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/configmap.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/configmap.yaml index 72d5ca8479..4e7879665e 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/configmap.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/configmap.yaml @@ -6,8 +6,13 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ .name}}-{{ $.Values.app }} -{{- if $.Values.appLabels }} labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} {{ toYaml $.Values.appLabels | indent 4 }} {{- end }} data: diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/deployment.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/deployment.yaml index f10cf8325b..85e90fa56b 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/deployment.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/deployment.yaml @@ -11,6 +11,11 @@ {{- end }} {{- end }} + {{- $hasPVCExists := false -}} + {{- if .Values.persistentVolumeClaim.name }} + {{- $hasPVCExists = true }} + {{- end }} + {{- $hasSecretEnvExists := false -}} {{- $hasSecretVolumeExists := false -}} {{- if .Values.ConfigSecrets.enabled }} @@ -54,8 +59,12 @@ spec: {{- end }} selector: matchLabels: +{{- if .Values.customMatchLabels }} +{{ toYaml .Values.customMatchLabels | indent 6 }} +{{- else }} app: {{ template ".Chart.Name .name" $ }} release: {{ $.Release.Name }} +{{- end }} replicas: {{ $.Values.replicaCount }} minReadySeconds: {{ $.Values.MinReadySeconds }} template: @@ -71,6 +80,9 @@ spec: appId: {{ $.Values.app | quote }} envId: {{ $.Values.env | quote }} release: {{ $.Release.Name }} +{{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 8 }} +{{- end }} {{- if .Values.appLabels }} {{ toYaml .Values.appLabels | indent 8 }} {{- end }} @@ -97,12 +109,18 @@ spec: operator: In values: - {{ $.Values.Spec.Affinity.Values | default "nodes" }} +{{- else if $.Values.affinity.enabled }} + affinity: +{{ toYaml .Values.affinity.values | indent 8 }} {{- end }} {{- if $.Values.serviceAccountName }} serviceAccountName: {{ $.Values.serviceAccountName }} {{- else }} serviceAccountName: {{ template "serviceAccountName" . }} {{- end }} +{{- if $.Values.schedulerName }} + schedulerName: {{ .Values.schedulerName }} +{{- end }} {{- if .Values.tolerations }} tolerations: {{ toYaml .Values.tolerations | indent 8 }} @@ -155,64 +173,9 @@ spec: command: {{ toYaml .command | indent 12 -}} {{- end}} -{{- if .resources}} - resources: -{{ toYaml .resources | indent 12 -}} -{{- end}} -{{- if .volumeMounts}} - volumeMounts: -{{ toYaml .volumeMounts | indent 12 -}} -{{- end}} -{{- else}} - - -{{ toYaml . | indent 10 }} -{{- end}} -{{- end}} -{{- end}} - containers: -{{- if $.Values.appMetrics }} - - name: envoy - image: {{ $.Values.envoyproxy.image | default "envoyproxy/envoy:v1.14.1"}} - {{- if $.Values.envoyproxy.lifecycle }} - lifecycle: -{{ toYaml .Values.envoyproxy.lifecycle | indent 12 -}} - {{- else if $.Values.containerSpec.lifecycle.enabled }} - lifecycle: - {{- if $.Values.containerSpec.lifecycle.preStop }} - preStop: -{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} - {{- end }} - {{- end }} - resources: -{{ toYaml $.Values.envoyproxy.resources | trim | indent 12 }} - ports: - - containerPort: 9901 - protocol: TCP - name: envoy-admin - {{- range $index, $element := .Values.ContainerPort }} - - name: {{ $element.name}} - containerPort: {{ $element.envoyPort | default (add 8790 $index) }} - protocol: TCP - {{- end }} - command: ["/usr/local/bin/envoy"] - args: ["-c", "/etc/envoy-config/envoy-config.json", "-l", "info", "--log-format", "[METADATA][%Y-%m-%d %T.%e][%t][%l][%n] %v"] - volumeMounts: - - name: {{ $.Values.envoyproxy.configMapName | default "envoy-config-volume" }} - mountPath: /etc/envoy-config/ -{{- end}} -{{- if $.Values.containers }} -{{- range $i, $c := .Values.containers }} -{{- if .reuseContainerImage}} - - name: {{ $.Chart.Name }}-sidecontainer-{{ add1 $i }} - image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" - imagePullPolicy: {{ $.Values.image.pullPolicy }} -{{- if .securityContext }} - securityContext: -{{ toYaml .securityContext | indent 12 }} -{{- end }} -{{- if .command}} - command: -{{ toYaml .command | indent 12 -}} +{{- if .args}} + args: +{{ toYaml .args | indent 12 -}} {{- end}} {{- if .resources}} resources: @@ -228,6 +191,7 @@ spec: {{- end}} {{- end}} {{- end}} + containers: - name: {{ $.Chart.Name }} image: "{{ .Values.server.deployment.image }}:{{ .Values.server.deployment.image_tag }}" imagePullPolicy: {{ $.Values.image.pullPolicy }} @@ -260,7 +224,7 @@ spec: {{- range $.Values.ContainerPort }} - name: {{ .name}} containerPort: {{ .port }} - protocol: TCP + protocol: {{ .protocol | default "TCP" }} {{- end}} {{- if and $.Values.command.enabled $.Values.command.workingDir }} workingDir: {{ $.Values.command.workingDir }} @@ -275,9 +239,9 @@ spec: {{- end }} env: - name: CONFIG_HASH - value: {{ include (print $.Chart.Name "/templates/configmap.yaml") . | sha256sum }} + value: {{ include (print $.Chart.Name "/templates/configmap.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.ConfigHash) }}{{ .Values.devtronInternal.containerSpecs.ConfigHash }}{{ end }} - name: SECRET_HASH - value: {{ include (print $.Chart.Name "/templates/secret.yaml") . | sha256sum }} + value: {{ include (print $.Chart.Name "/templates/secret.yaml") . | sha256sum }}{{ if and (.Values.devtronInternal) (.Values.devtronInternal.containerSpecs.SecretHash) }}{{ .Values.devtronInternal.containerSpecs.SecretHash }}{{ end }} - name: DEVTRON_APP_NAME value: {{ template ".Chart.Name .name" $ }} - name: POD_NAME @@ -354,6 +318,7 @@ spec: httpGet: path: {{ $.Values.LivenessProbe.Path }} port: {{ $.Values.LivenessProbe.port }} + scheme: {{ $.Values.LivenessProbe.scheme }} {{- if $.Values.LivenessProbe.httpHeaders }} httpHeaders: {{- range $.Values.LivenessProbe.httpHeaders}} @@ -383,6 +348,7 @@ spec: httpGet: path: {{ $.Values.ReadinessProbe.Path }} port: {{ $.Values.ReadinessProbe.port }} + scheme: {{ $.Values.ReadinessProbe.scheme }} {{- if $.Values.ReadinessProbe.httpHeaders }} httpHeaders: {{- range $.Values.ReadinessProbe.httpHeaders}} @@ -441,6 +407,10 @@ spec: {{- with .Values.volumeMounts }} {{ toYaml . | trim | indent 12 }} {{- end }} +{{- if $.Values.persistentVolumeClaim.name }} + - name: {{ .Values.persistentVolumeClaim.name }}-vol + mountPath: {{ .Values.persistentVolumeClaim.mountPath | default "/tmp" }} +{{- end}} {{- if .Values.ConfigMaps.enabled }} {{- range .Values.ConfigMaps.maps }} {{- if eq .type "volume"}} @@ -471,7 +441,22 @@ spec: mountPath: {{ $cmMountPath }} {{- else }} - {{- range $k, $v := .data }} + {{if (or (eq .externalType "ESO_GoogleSecretsManager") (eq .externalType "ESO_AWSSecretsManager") (eq .externalType "ESO_HashiCorpVault") (eq .externalType "ESO_AzureSecretsManager"))}} + {{- if and (.esoSubPath) (ne (len .esoSubPath) 0) }} + {{- range .esoSubPath }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ . }} + subPath: {{ . }} + {{- end }} + {{- else }} + {{- range .esoSecretData.esoData }} + - name: {{ $cmName | replace "." "-"}}-vol + mountPath: {{ $cmMountPath}}/{{ .secretKey }} + subPath: {{ .secretKey }} + {{- end }} + {{- end }} + {{- else }} + {{- range $k, $v := .data }} # for others secrets the mount path will be .data[i].secretKey - name: {{ $cmName | replace "." "-"}}-vol mountPath: {{ $cmMountPath}}/{{ $k}} subPath: {{ $k}} @@ -480,15 +465,98 @@ spec: {{- end }} {{- end }} {{- end }} - {{- if and (eq (len .Values.volumes) 0) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }} - {{- if and (eq (len .Values.volumeMounts) 0) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} []{{- end }} - + {{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) }} []{{- end }} + {{- if and (eq (len .Values.volumeMounts) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) }} [] {{- end }} +{{- if $.Values.appMetrics }} + - name: envoy + image: {{ $.Values.envoyproxy.image | default "quay.io/devtron/envoy:v1.16.0"}} + {{- if $.Values.envoyproxy.lifecycle }} + lifecycle: +{{ toYaml .Values.envoyproxy.lifecycle | indent 12 -}} + {{- else if $.Values.containerSpec.lifecycle.enabled }} + lifecycle: + {{- if $.Values.containerSpec.lifecycle.preStop }} + preStop: +{{ toYaml $.Values.containerSpec.lifecycle.preStop | indent 12 -}} + {{- end }} + {{- end }} + resources: +{{ toYaml $.Values.envoyproxy.resources | trim | indent 12 }} + ports: + - containerPort: 9901 + protocol: TCP + name: envoy-admin + {{- range $index, $element := .Values.ContainerPort }} + - name: {{ $element.name}} + containerPort: {{ $element.envoyPort | default (add 8790 $index) }} + protocol: TCP + {{- end }} + command: ["/usr/local/bin/envoy"] + args: ["-c", "/etc/envoy-config/envoy-config.json", "-l", "info", "--log-format", "[METADATA][%Y-%m-%d %T.%e][%t][%l][%n] %v"] + volumeMounts: + - name: {{ $.Values.envoyproxy.configMapName | default "envoy-config-volume" }} + mountPath: /etc/envoy-config/ +{{- if $.Values.envoyproxy.readinessProbe}} + readinessProbe: +{{ toYaml $.Values.envoyproxy.readinessProbe | indent 12}} +{{- end }} +{{- if $.Values.envoyproxy.livenessProbe}} + livenessProbe: +{{ toYaml $.Values.envoyproxy.livenessProbe | indent 12}} +{{- end }} +{{- end}} +{{- if $.Values.containers }} +{{- range $i, $c := .Values.containers }} +{{- if .reuseContainerImage}} + - name: {{ $.Chart.Name }}-sidecontainer-{{ add1 $i }} + image: "{{ $.Values.server.deployment.image }}:{{ $.Values.server.deployment.image_tag }}" + imagePullPolicy: {{ $.Values.image.pullPolicy }} +{{- if .env }} + env: +{{ toYaml .env | indent 12 }} +{{- end }} + {{- if .envFrom }} + envFrom: +{{ toYaml .env | indent 12 }} +{{- end }} +{{- if .securityContext }} + securityContext: +{{ toYaml .securityContext | indent 12 }} +{{- end }} +{{- if .command}} + command: +{{ toYaml .command | indent 12 -}} +{{- end}} +{{- if .resizePolicy }} + resizePolicy: +{{ toYaml .resziePolicy | indent 12}} +{{- end }} +{{- if .resources}} + resources: +{{ toYaml .resources | indent 12 -}} +{{- end}} +{{- if .volumeMounts}} + volumeMounts: +{{ toYaml .volumeMounts | indent 12 -}} +{{- end}} +{{- else}} + - +{{ toYaml . | indent 10 }} +{{- end}} +{{- end}} +{{- end}} volumes: {{- if $.Values.appMetrics }} - name: envoy-config-volume configMap: name: sidecar-config-{{ template ".Chart.Name .name" $ }} {{- end }} +{{- if .Values.persistentVolumeClaim.name }} + - name: {{.Values.persistentVolumeClaim.name}}-vol + persistentVolumeClaim: + claimName: {{.Values.persistentVolumeClaim.name }} +{{- end}} {{- with .Values.volumes }} {{ toYaml . | trim | indent 8 }} {{- end }} @@ -527,9 +595,8 @@ spec: {{- end }} {{- end }} {{- end }} - {{- if and (eq (len .Values.volumes) 0) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) (eq (.Values.appMetrics) false) }} []{{- end }} - {{- if and (eq (len .Values.volumes) 0) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) (eq (.Values.appMetrics) false) }} []{{- end }} - + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (or (eq (.Values.ConfigSecrets.enabled) true) (eq (.Values.ConfigMaps.enabled) true)) (eq ($hasCMVolumeExists) false) (eq ($hasSecretVolumeExists) false) (eq (.Values.appMetrics) false) }} []{{- end }} + {{- if and (eq (len .Values.volumes) 0) (eq ($hasPVCExists) false) (eq (.Values.ConfigSecrets.enabled) false) (eq (.Values.ConfigMaps.enabled) false) (eq (.Values.appMetrics) false) }} []{{- end }} revisionHistoryLimit: 3 ## pauseForSecondsBeforeSwitchActive: {{ $.Values.pauseForSecondsBeforeSwitchActive }} # waitForSecondsBeforeScalingDown: {{ $.Values.waitForSecondsBeforeScalingDown }} @@ -549,6 +616,30 @@ spec: maxUnavailable: {{ $.Values.deployment.strategy.rolling.maxUnavailable }} {{- else if eq .Values.deploymentType "CANARY" }} canary: + {{- if .Values.deployment.strategy.canary.antiAffinity }} + antiAffinity: +{{ toYaml .Values.deployment.strategy.canary.antiAffinity | indent 8 }} + {{- end }} + {{- if .Values.deployment.strategy.canary.canaryMetadata }} + canaryMetadata: +{{ toYaml .Values.deployment.strategy.canary.canaryMetadata | indent 8 }} + {{- end }} +# {{- if .Values.deployment.strategy.canary.maxSurge }} +# maxSurge: +# {{ toYaml .Values.deployment.strategy.canary.maxSurge | indent 8 }} +# {{- end }} + {{- if .Values.deployment.strategy.canary.pingPong }} + pingPong: +{{ toYaml .Values.deployment.strategy.canary.pingPong | indent 8 }} + {{- end }} +# {{- if .Values.deployment.strategy.canary.maxUnavailable }} +# maxUnavailable: +# {{ toYaml .Values.deployment.strategy.canary.maxUnavailable | indent 8 }} +# {{- end }} + {{- if .Values.deployment.strategy.canary.stableMetadata }} + stableMetadata: +{{ toYaml .Values.deployment.strategy.canary.stableMetadata | indent 8 }} + {{- end }} {{- if .Values.deployment.strategy.canary.analysis }} analysis: {{ toYaml .Values.deployment.strategy.canary.analysis | indent 8 }} @@ -577,6 +668,40 @@ spec: {{- else }} trafficSplitName: {{ template ".Chart.Name .fullname" $ }}-traffic-split {{- end }} - {{- end }} + {{- else if .Values.deployment.strategy.canary.trafficRouting.alb }} + alb: + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.ingress }} + ingress: {{ .Values.deployment.strategy.canary.trafficRouting.alb.ingress }} + {{- else if $.Values.ingress.name }} + ingress: .Values.ingress.name + {{- else }} + ingress: {{ template ".Chart.Name .fullname" . }}-ingress + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.rootService }} + rootService: {{ .Values.deployment.strategy.canary.trafficRouting.alb.rootService }} + {{- else }} + rootService: {{ template ".servicename" . }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.annotationPrefix }} + annotationPrefix: {{ .Values.deployment.strategy.canary.trafficRouting.alb.annotationPrefix }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.servicePort }} + servicePort: {{ .Values.deployment.strategy.canary.trafficRouting.alb.servicePort }} + {{- else }} + {{- with index .Values.ContainerPort 0 }} + servicePort: {{ .servicePort }} + {{- end }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.stickinessConfig }} + stickinessConfig: +{{ toYaml .Values.deployment.strategy.canary.trafficRouting.alb.stickinessConfig | nindent 12 }} + {{- end }} + {{- if .Values.deployment.strategy.canary.trafficRouting.alb.ingresses }} + ingresses: + {{- range .Values.deployment.strategy.canary.trafficRouting.alb.ingresses }} + - {{ . }} + {{- end }} + {{- end }} + {{- end }} {{- end }} {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/externalsecrets.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/externalsecrets.yaml index bdb4223cc0..efd291af5d 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/externalsecrets.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/externalsecrets.yaml @@ -8,8 +8,13 @@ apiVersion: external-secrets.io/v1beta1 kind: SecretStore metadata: name: {{ .name}} -{{- if $.Values.appLabels }} labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} {{ toYaml $.Values.appLabels | indent 4 }} {{- end }} spec: @@ -21,8 +26,13 @@ apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret metadata: name: {{ .name }} -{{- if $.Values.appLabels }} labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ $.Release.Name }} +{{- if $.Values.appLabels }} {{ toYaml $.Values.appLabels | indent 4 }} {{- end }} spec: @@ -41,7 +51,15 @@ spec: {{- end }} target: name: {{ .name}} + {{- if .esoSecretData.template }} + template: + {{- toYaml .esoSecretData.template | nindent 6 }} + {{- end }} creationPolicy: Owner + {{- if .esoSecretData.esoDataFrom }} + dataFrom: + {{- toYaml .esoSecretData.esoDataFrom | nindent 4 }} + {{- else }} data: {{- range .esoSecretData.esoData }} - secretKey: {{ .secretKey }} @@ -54,4 +72,5 @@ spec: {{- end}} {{- end}} {{- end}} +{{- end}} {{- end}} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/hpa.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/hpa.yaml index a0e1515576..76ba9455c2 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/hpa.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/hpa.yaml @@ -8,15 +8,27 @@ apiVersion: autoscaling/v2beta1 {{- end }} kind: HorizontalPodAutoscaler metadata: + {{- if $.Values.autoscaling.name }} + name: {{ $.Values.autoscaling.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }}-hpa + {{- end }} {{- if .Values.autoscaling.annotations }} annotations: {{ toYaml .Values.autoscaling.annotations | indent 4 }} {{- end }} - {{- if .Values.autoscaling.labels }} labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + {{- if .Values.autoscaling.labels }} {{ toYaml .Values.autoscaling.labels | indent 4 }} {{- end }} +{{- if $.Values.appLabels }} +{{ toYaml $.Values.appLabels | indent 4 }} +{{- end }} spec: scaleTargetRef: apiVersion: argoproj.io/v1alpha1 @@ -25,6 +37,28 @@ spec: minReplicas: {{ $.Values.autoscaling.MinReplicas }} maxReplicas: {{ $.Values.autoscaling.MaxReplicas }} metrics: + {{- if $.Values.autoscaling.containerResource.enabled }} + {{- with $.Values.autoscaling.containerResource }} + {{- if .TargetCPUUtilizationPercentage }} + - type: ContainerResource + containerResource: + name: cpu + container: {{ $.Chart.Name }} + target: + type: Utilization + averageUtilization: {{ .TargetCPUUtilizationPercentage }} + {{- end}} + {{- if .TargetMemoryUtilizationPercentage }} + - type: ContainerResource + containerResource: + name: memory + container: {{ $.Chart.Name }} + target: + type: Utilization + averageUtilization: {{ .TargetMemoryUtilizationPercentage }} + {{- end}} + {{- end }} + {{- end }} {{- if $.Values.autoscaling.TargetMemoryUtilizationPercentage }} - type: Resource resource: diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/ingress.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/ingress.yaml index 416b1af567..1d47899d0b 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/ingress.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/ingress.yaml @@ -21,7 +21,11 @@ apiVersion: extensions/v1beta1 {{- end }} kind: Ingress metadata: + {{- if $.Values.ingress.name }} + name: {{ $.Values.ingress.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" . }}-ingress + {{- end }} namespace: {{ $.Values.NameSpace }} labels: app: {{ template ".Chart.Name .name" . }} @@ -106,7 +110,11 @@ apiVersion: extensions/v1beta1 {{- end }} kind: Ingress metadata: + {{- if $.Values.ingressInternal.name }} + name: {{ $.Values.ingressInternal.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" . }}-ingress-internal + {{- end }} namespace: {{ $.Values.NameSpace }} labels: app: {{ template ".Chart.Name .name" . }} @@ -114,6 +122,9 @@ metadata: envId: {{ $.Values.env | quote }} chart: {{ template ".Chart.Name .chart" . }} release: {{ .Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} {{- if .Values.ingressInternal.annotations }} annotations: {{ toYaml .Values.ingressInternal.annotations | indent 4 }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-authorizationpolicy.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-authorizationpolicy.yaml index ac7b456ec5..8340555ff3 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-authorizationpolicy.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-authorizationpolicy.yaml @@ -3,7 +3,11 @@ apiVersion: security.istio.io/v1beta1 kind: AuthorizationPolicy metadata: + {{- if .authorizationPolicy.name }} + name: {{ .authorizationPolicy.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-destinationrule.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-destinationrule.yaml index 47bef9a828..4d06deb0b8 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-destinationrule.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-destinationrule.yaml @@ -3,7 +3,11 @@ apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata: + {{- if .destinationRule.name }} + name: {{ .destinationRule.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }}-destinationrule + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-gateway.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-gateway.yaml index d657959010..ba654bc392 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-gateway.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-gateway.yaml @@ -2,7 +2,11 @@ apiVersion: networking.istio.io/v1beta1 kind: Gateway metadata: + {{- if .Values.istio.gateway.name }} + name: {{ .Values.istio.gateway.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }}-istio-gateway + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} @@ -28,7 +32,13 @@ spec: name: http protocol: HTTP hosts: +{{- if .Values.istio.gateway.host }} - {{ .Values.istio.gateway.host | quote -}} +{{- else if .Values.istio.gateway.hosts }} +{{- range .Values.istio.gateway.hosts }} + - {{ . | quote }} +{{- end }} +{{- end }} {{ with .Values.istio.gateway }} {{- if .tls.enabled }} tls: @@ -38,7 +48,13 @@ spec: name: https protocol: HTTPS hosts: +{{- if .host }} - {{ .host | quote }} +{{- else if .hosts }} +{{- range .hosts }} + - {{ . | quote }} +{{- end }} +{{- end }} tls: mode: SIMPLE credentialName: {{ .tls.secretName }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-peerauthentication.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-peerauthentication.yaml index 481f8a9647..dedd971c6d 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-peerauthentication.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-peerauthentication.yaml @@ -3,7 +3,11 @@ apiVersion: security.istio.io/v1beta1 kind: PeerAuthentication metadata: + {{- if .peerAuthentication.name }} + name: {{ .peerAuthentication.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-requestauthentication.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-requestauthentication.yaml index 3429cee146..b314653d31 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-requestauthentication.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-requestauthentication.yaml @@ -3,7 +3,11 @@ apiVersion: security.istio.io/v1beta1 kind: RequestAuthentication metadata: + {{- if .requestAuthentication.name }} + name: {{ .requestAuthentication.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }} + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-virtualservice.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-virtualservice.yaml index af61039b8d..76c2c14a8a 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-virtualservice.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/istio-virtualservice.yaml @@ -3,7 +3,11 @@ apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: - name: {{ template ".Chart.Name .fullname" $ }}-virtualservice + {{- if .virtualService.name }} + name: {{ .virtualService.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" $ }}-virtualservice + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} @@ -33,7 +37,13 @@ spec: {{- if or .gateway.enabled .virtualService.hosts }} hosts: {{- if .gateway.enabled }} + {{- if .gateway.host }} - {{ .gateway.host | quote }} + {{- else if .gateway.hosts }} +{{- range .gateway.hosts }} + - {{ . | quote }} +{{- end }} + {{- end }} {{- end }} {{- range .virtualService.hosts }} - {{ . | quote }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/keda-autoscaling.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/keda-autoscaling.yaml index 8c703a5647..850312e16d 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/keda-autoscaling.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/keda-autoscaling.yaml @@ -2,7 +2,28 @@ apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: + {{- if $.Values.kedaAutoscaling.name }} + name: {{ $.Values.kedaAutoscaling.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }}-keda + {{- end }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + release: {{ .Release.Name }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} + {{- if .Values.kedaAutoscaling.labels }} +{{ toYaml .Values.kedaAutoscaling.labels | indent 4 }} + {{- end }} + {{- if .Values.kedaAutoscaling.annotations }} + annotations: +{{ toYaml .Values.kedaAutoscaling.annotations | indent 4 }} + {{- end }} spec: scaleTargetRef: apiVersion: argoproj.io/v1alpha1 @@ -42,6 +63,15 @@ apiVersion: keda.sh/v1alpha1 kind: TriggerAuthentication metadata: name: {{ $.Values.kedaAutoscaling.triggerAuthentication.name }} + labels: + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} spec: {{ toYaml $.Values.kedaAutoscaling.triggerAuthentication.spec | indent 2 }} {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/networkpolicy.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/networkpolicy.yaml index 350232a23b..ee8bdaf8be 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/networkpolicy.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/networkpolicy.yaml @@ -1,9 +1,12 @@ {{- if .Values.networkPolicy.enabled -}} -{{- with .Values.networkPolicy }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: + {{- if .Values.networkPolicy.name }} + name: {{ .Values.networkPolicy.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }}-networkpolicy + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} @@ -46,5 +49,4 @@ spec: egress: {{ toYaml $.Values.networkPolicy.ingress | indent 4}} {{- end }} -{{- end }} {{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/persistent-volume-claim.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/persistent-volume-claim.yaml new file mode 100644 index 0000000000..cee0fb2fde --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/persistent-volume-claim.yaml @@ -0,0 +1,27 @@ +{{- if .Values.persistentVolumeClaim.name }} +kind: PersistentVolumeClaim +apiVersion: v1 +metadata: + name: {{.Values.persistentVolumeClaim.name }} + labels: + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + app: {{ template ".Chart.Name .name" $ }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} +{{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} +{{- end }} +{{- with .Values.persistentVolumeClaim }} +spec: + accessModes: +{{- range .accessMode }} + - {{ . }} +{{- end }} + resources: + requests: + storage: {{ .storage | default "5Gi" }} + storageClassName: {{ .storageClassName | default "default" }} + volumeMode: {{ .volumeMode | default "Filesystem" }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/poddisruptionbudget.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/poddisruptionbudget.yaml index c9cbb4162d..869d380d40 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/poddisruptionbudget.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/poddisruptionbudget.yaml @@ -6,11 +6,20 @@ apiVersion: policy/v1beta1 {{- end }} kind: PodDisruptionBudget metadata: + {{- if .Values.podDisruptionBudget.name }} + name: {{ .Values.podDisruptionBudget.name }} + {{- else }} name: {{ include ".Chart.Name .fullname" $ }} + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" $ }} + release: {{ $.Release.Name }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} spec: {{- if .Values.podDisruptionBudget.minAvailable }} minAvailable: {{ .Values.podDisruptionBudget.minAvailable }} @@ -20,6 +29,10 @@ spec: {{- end }} selector: matchLabels: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 6 }} + {{- else }} appId: {{ $.Values.app | quote }} envId: {{ $.Values.env | quote }} + {{- end }} {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/service.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/service.yaml index 97eb5a16c9..2c31e1450d 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/service.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/service.yaml @@ -39,7 +39,7 @@ spec: {{- if (and (eq $.Values.service.type "NodePort") .nodePort )}} nodePort: {{ .nodePort }} {{- end }} - protocol: TCP + protocol: {{ .protocol | default "TCP"}} name: {{ .name }} {{- end }} {{- if $.Values.appMetrics }} @@ -47,7 +47,18 @@ spec: name: envoy-admin {{- end }} selector: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 4 }} + {{- else }} app: {{ template ".Chart.Name .name" . }} + {{- end }} +{{- if .Values.service.sessionAffinity.enabled }} + sessionAffinity: ClientIP +{{- end }} +{{- if .Values.service.sessionAffinityConfig }} + sessionAffinityConfig: +{{ toYaml .Values.service.sessionAffinityConfig | indent 4 }} +{{- end }} {{- if or (eq .Values.deploymentType "BLUE-GREEN") (eq .Values.deploymentType "CANARY") }} --- apiVersion: v1 @@ -70,7 +81,7 @@ spec: - port: {{ .port }} {{- end }} targetPort: {{ .name }} - protocol: TCP + protocol: {{ .protocol | default "TCP"}} name: {{ .name }} {{- end }} {{- if $.Values.appMetrics }} @@ -78,6 +89,10 @@ spec: name: envoy-admin {{- end }} selector: + {{- if .Values.customPodLabels }} +{{ toYaml .Values.customPodLabels | indent 4 }} + {{- else }} app: {{ template ".Chart.Name .name" . }} + {{- end }} {{- end }} {{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/servicemonitor.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/servicemonitor.yaml index 1f90c722cb..8600f9d65b 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/servicemonitor.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/servicemonitor.yaml @@ -4,7 +4,11 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: + {{- if .Values.servicemonitor.name }} + name: {{ .Values.servicemonitor.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" . }}-sm + {{- end }} labels: kind: Prometheus app: {{ template ".Chart.Name .name" . }} @@ -15,13 +19,58 @@ metadata: {{- if .Values.servicemonitor.additionalLabels }} {{ toYaml .Values.servicemonitor.additionalLabels | indent 4 }} {{- end }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} spec: endpoints: {{- range .Values.ContainerPort }} {{- if .servicemonitor }} {{- if .servicemonitor.enabled}} - {{- if .servicePort }} + {{- if .servicemonitor.targetPort }} + - targetPort: {{ .servicemonitor.targetPort }} + {{- else if .servicePort }} - port: {{ .name }} + {{- end }} + {{- if .servicemonitor.path }} + path: {{ .servicemonitor.path}} + {{- end }} + {{- if .servicemonitor.scheme }} + scheme: {{ .servicemonitor.scheme}} + {{- end }} + {{- if .servicemonitor.interval }} + interval: {{ .servicemonitor.interval}} + {{- end }} + {{- if .servicemonitor.scrapeTimeout }} + scrapeTimeout: {{ .servicemonitor.scrapeTimeout | quote }} + {{- end }} + {{- if .servicemonitor.basicAuth }} + basicAuth: + {{- toYaml .servicemonitor.basicAuth | nindent 8 }} + {{- end }} + {{- if .servicemonitor.insecureTLS }} + tlsConfig: + insecureSkipVerify: true + {{- else if .servicemonitor.tlsConfig }} + tlsConfig: + {{- toYaml .servicemonitor.tlsConfig | nindent 8 }} + {{- end }} + {{- if .servicemonitor.metricRelabelings}} + metricRelabelings: +{{toYaml .servicemonitor.metricRelabelings | indent 8 }} + {{- end }} + {{- end }} + {{- end }} + {{- end }} + {{- range .Values.containers }} + {{- range .ports }} + {{- if .servicemonitor }} + {{- if .servicemonitor.enabled}} + {{- if .servicemonitor.targetPort }} + - targetPort: {{ .servicemonitor.targetPort }} + {{- else if .servicePort }} + - port: {{ .name }} + {{- end }} {{- if .servicemonitor.path }} path: {{ .servicemonitor.path}} {{- end }} @@ -34,6 +83,17 @@ spec: {{- if .servicemonitor.scrapeTimeout }} scrapeTimeout: {{ .servicemonitor.scrapeTimeout}} {{- end }} + {{- if .servicemonitor.basicAuth }} + basicAuth: + {{- toYaml .servicemonitor.basicAuth | nindent 8 }} + {{- end }} + {{- if .servicemonitor.insecureTLS }} + tlsConfig: + insecureSkipVerify: true + {{- else if .servicemonitor.tlsConfig }} + tlsConfig: + {{- toYaml .servicemonitor.tlsConfig | nindent 8 }} + {{- end }} {{- if .servicemonitor.metricRelabelings}} metricRelabelings: {{toYaml .servicemonitor.metricRelabelings | indent 8 }} @@ -42,7 +102,16 @@ spec: {{- end }} {{- end }} {{- end }} + {{- if .Values.servicemonitor.namespaceSelector }} + namespaceSelector: + matchNames: + {{- toYaml .Values.servicemonitor.namespaceSelector | nindent 6 }} + {{- end }} selector: matchLabels: + {{- if .Values.servicemonitor.matchLabels }} + {{- toYaml .Values.servicemonitor.matchLabels | nindent 6 }} + {{- else }} app: {{ template ".Chart.Name .name" $ }} + {{- end }} {{- end }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/vertical-pod-autoscaler.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/vertical-pod-autoscaler.yaml new file mode 100644 index 0000000000..7d1d1db475 --- /dev/null +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/vertical-pod-autoscaler.yaml @@ -0,0 +1,41 @@ +{{ $VerticalPodAutoScalingEnabled := include "VerticalPodAutoScalingEnabled" . }} +{{- if eq "true" $VerticalPodAutoScalingEnabled -}} +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + {{- if .Values.verticalPodScaling.name }} + name: {{ .Values.verticalPodScaling.name }} + {{- else }} + name: {{ template ".Chart.Name .fullname" . }}-vpa + {{- end }} + labels: + kind: Prometheus + app: {{ template ".Chart.Name .name" . }} + appId: {{ $.Values.app | quote }} + envId: {{ $.Values.env | quote }} + chart: {{ template ".Chart.Name .chart" . }} + release: {{ .Values.prometheus.release }} + {{- if .Values.appLabels }} +{{ toYaml .Values.appLabels | indent 4 }} + {{- end }} + {{- if $.Values.verticalPodScaling.labels }} +{{ toYaml $.Values.verticalPodScaling.labels | indent 4 }} + {{- end }} + {{- if $.Values.verticalPodScaling.annotations }} + annotations: +{{ toYaml $.Values.verticalPodScaling.annotations | indent 4 }} + {{- end }} +spec: +{{- if .Values.verticalPodScaling.resourcePolicy }} + resourcePolicy: +{{ toYaml .Values.verticalPodScaling.resourcePolicy}} +{{- end }} +{{- if .Values.verticalPodScaling.updatePolicy }} + updatePolicy: +{{ toYaml .Values.verticalPodScaling.updatePolicy}} +{{- end }} + targetRef: + apiVersion: argoproj.io/v1alpha1 + kind: Rollout + name: {{ include ".Chart.Name .fullname" $ }} +{{- end }} \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/winter-soldier.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/winter-soldier.yaml index 2d3e7bae0f..5ac2fd8443 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/winter-soldier.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/templates/winter-soldier.yaml @@ -2,7 +2,11 @@ apiVersion: {{ $.Values.winterSoldier.apiVersion }} kind: Hibernator metadata: + {{- if .Values.winterSoldier.name }} + name: {{ .Values.winterSoldier.name }} + {{- else }} name: {{ template ".Chart.Name .fullname" $ }}-hibernator + {{- end }} labels: app: {{ template ".Chart.Name .name" $ }} appId: {{ $.Values.app | quote }} diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/test_values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/test_values.yaml index 6b58952e67..d2bb08e778 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/test_values.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/test_values.yaml @@ -35,11 +35,12 @@ GracePeriod: 30 ContainerPort: - name: app port: 8080 - servicePort: 80 + servicePort: 8000 envoyTimeout: 15 targetPort: 8080 envoyPort: 8799 useHTTP2: false + protocol: UDP supportStreaming: false idleTimeout: 1800s servicemonitor: @@ -87,6 +88,10 @@ autoscaling: TargetCPUUtilizationPercentage: 90 TargetMemoryUtilizationPercentage: 80 behavior: {} + containerResource: + enable: false + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 # scaleDown: # stabilizationWindowSeconds: 300 # policies: @@ -123,6 +128,9 @@ service: annotations: {} # test1: test2 # test3: test4 + sessionAffinity: + enabled: false + sessionAffinityConfig: {} server: deployment: @@ -163,7 +171,11 @@ deployment: maxSurge: "25%" maxUnavailable: 1 # stableService: pro-rollout-manual-service - trafficRouting: {} + trafficRouting: + + alb: + rootService: kamal + ingresses: [] steps: - setWeight: 25 - pause: @@ -586,6 +598,10 @@ envoyproxy: requests: cpu: 50m memory: 50Mi + readinessProbe: + path: / + livenessProbe: + path: / podDisruptionBudget: {} # minAvailable: 1 @@ -601,7 +617,7 @@ tolerations: [] # value: "value" # effect: "NoSchedule|PreferNoSchedule|NoExecute(1.6 only)" -appMetrics: false +appMetrics: true serviceAccount: ## @param serviceAccount.create Enable creation of ServiceAccount for pods ## @@ -622,3 +638,7 @@ hostAliases: [] # hostnames: # - "foo.local" + + +verticalPodScaling: + enabled: false \ No newline at end of file diff --git a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/values.yaml b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/values.yaml index eba7f9eca3..4cd126fc19 100644 --- a/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/values.yaml +++ b/scripts/devtron-reference-helm-charts/reference-chart_5-0-0/values.yaml @@ -88,6 +88,10 @@ autoscaling: annotations: {} labels: {} behavior: {} + containerResource: + enable: false + TargetCPUUtilizationPercentage: 90 + TargetMemoryUtilizationPercentage: 80 # scaleDown: # stabilizationWindowSeconds: 300 # policies: @@ -152,6 +156,10 @@ service: annotations: {} # test1: test2 # test3: test4 + sessionAffinity: + enabled: false + sessionAffinityConfig: {} + server: deployment: @@ -177,25 +185,27 @@ EnvVariablesFromConfigMapKeys: [] # keyName: CONFIG_MAP_KEY LivenessProbe: - Path: / + Path: "" port: 8080 initialDelaySeconds: 20 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 failureThreshold: 3 + scheme: "" httpHeaders: [] # - name: Custom-Header # value: abc ReadinessProbe: - Path: / + Path: "" port: 8080 initialDelaySeconds: 20 periodSeconds: 10 successThreshold: 1 timeoutSeconds: 5 failureThreshold: 3 + scheme: "" httpHeaders: [] # - name: Custom-Header # value: abc @@ -537,11 +547,8 @@ winterSoldier: # - AfterTime(AddTime(ParseTime({{metadata.creationTimestamp}}, '2006-01-02T15:04:05Z'), '5m'), Now()) topologySpreadConstraints: [] - # - maxSkew: 1 - # topologyKey: zone - # whenUnsatisfiable: DoNotSchedule - # autoLabelSelector: true - # customLabelSelector: {} + +schedulerName: "" envoyproxy: image: docker.io/envoyproxy/envoy:v1.16.0 @@ -641,3 +648,13 @@ tolerations: [] imagePullSecrets: [] # - test1 # - test2 + +persistentVolumeClaim: {} + + +affinity: + enabled: false + values: {} + +verticalPodScaling: + enabled: false \ No newline at end of file