diff --git a/Charts/qtest-mgr/Chart.yaml b/Charts/qtest-mgr/Chart.yaml index 95071420..43ee2ab9 100644 --- a/Charts/qtest-mgr/Chart.yaml +++ b/Charts/qtest-mgr/Chart.yaml @@ -65,7 +65,7 @@ icon: https://images.g2crowd.com/uploads/product/image/social_landscape/social_l # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.7.3 +version: 1.8.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. diff --git a/Charts/qtest-mgr/templates/deployment.yaml b/Charts/qtest-mgr/templates/deployment.yaml index 53bb6443..bcca5433 100644 --- a/Charts/qtest-mgr/templates/deployment.yaml +++ b/Charts/qtest-mgr/templates/deployment.yaml @@ -64,6 +64,10 @@ spec: {{ toYaml .Values.podLabels | nindent 8 }} {{- end}} spec: + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml . | indent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} @@ -244,11 +248,7 @@ metadata: {{ $key }}: {{ $value }} {{- end }} spec: - {{- if .Values.rollouts.enabled }} - replicas: 0 - {{- else }} replicas: {{ .Values.autoscaling.minReplicas.poller }} - {{- end }} revisionHistoryLimit: 3 selector: matchLabels: @@ -275,6 +275,10 @@ spec: {{ toYaml .Values.podLabels | nindent 8 }} {{- end}} spec: + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml . | indent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} @@ -478,6 +482,10 @@ spec: {{ toYaml .Values.podLabels | nindent 8 }} {{- end}} spec: + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml . | indent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} @@ -681,6 +689,10 @@ spec: {{ toYaml .Values.podLabels | nindent 8 }} {{- end}} spec: + {{- with .Values.topologySpreadConstraints }} + topologySpreadConstraints: +{{ toYaml . | indent 8 }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} diff --git a/Charts/qtest-mgr/templates/hpa.yaml b/Charts/qtest-mgr/templates/hpa.yaml index a9af8766..425650f9 100644 --- a/Charts/qtest-mgr/templates/hpa.yaml +++ b/Charts/qtest-mgr/templates/hpa.yaml @@ -1,17 +1,19 @@ {{- if .Values.autoscaling.enabled }} -{{- if .Values.rollouts.enabled -}} +{{- $targetType := ternary "Rollout" "Deployment" .Values.rollouts.enabled -}} +{{- $targetSuffix := ternary "rollout" "deployment" .Values.rollouts.enabled -}} +{{- $targetApiVersion := ternary "argoproj.io/v1alpha1" "apps/v1" .Values.rollouts.enabled -}} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: mgr-ui-rollout + name: mgr-ui-{{ $targetSuffix }} namespace: {{ .Values.namespace.name }} labels: {{- include "qtest-mgr.labels" . | nindent 4 }} spec: scaleTargetRef: - apiVersion: argoproj.io/v1alpha1 - kind: Rollout - name: mgr-ui-rollout + apiVersion: {{ $targetApiVersion }} + kind: {{ $targetType }} + name: mgr-ui-{{ $targetSuffix }} minReplicas: {{ .Values.autoscaling.minReplicas.ui }} maxReplicas: {{ .Values.autoscaling.maxReplicas.ui }} metrics: @@ -36,15 +38,15 @@ spec: apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: mgr-api-rollout + name: mgr-api-{{ $targetSuffix }} namespace: {{ .Values.namespace.name }} labels: {{- include "qtest-mgr.labels" . | nindent 4 }} spec: scaleTargetRef: - apiVersion: argoproj.io/v1alpha1 - kind: Rollout - name: mgr-api-rollout + apiVersion: {{ $targetApiVersion }} + kind: {{ $targetType }} + name: mgr-api-{{ $targetSuffix }} minReplicas: {{ .Values.autoscaling.minReplicas.api }} maxReplicas: {{ .Values.autoscaling.maxReplicas.api }} metrics: @@ -68,47 +70,15 @@ spec: apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: - name: mgr-poller-rollout + name: mgr-notification-{{ $targetSuffix }} namespace: {{ .Values.namespace.name }} labels: {{- include "qtest-mgr.labels" . | nindent 4 }} spec: scaleTargetRef: - apiVersion: argoproj.io/v1alpha1 - kind: Rollout - name: mgr-poller-rollout - minReplicas: {{ .Values.autoscaling.minReplicas.poller }} - maxReplicas: {{ .Values.autoscaling.maxReplicas.poller }} - metrics: - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} ---- -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: mgr-notification-rollout - namespace: {{ .Values.namespace.name }} - labels: - {{- include "qtest-mgr.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: argoproj.io/v1alpha1 - kind: Rollout - name: mgr-notification-rollout + apiVersion: {{ $targetApiVersion }} + kind: {{ $targetType }} + name: mgr-notification-{{ $targetSuffix }} minReplicas: {{ .Values.autoscaling.minReplicas.notification }} maxReplicas: {{ .Values.autoscaling.maxReplicas.notification }} metrics: @@ -128,73 +98,8 @@ spec: type: Utilization averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} -{{- end -}} -{{- else }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: mgr-ui-deployment - namespace: {{ .Values.namespace.name }} - labels: - {{- include "qtest-mgr.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: mgr-ui-deployment - minReplicas: {{ .Values.autoscaling.minReplicas.ui }} - maxReplicas: {{ .Values.autoscaling.maxReplicas.ui }} - metrics: - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} ---- -{{ if not .Values.testconductor.environment.singleInstance }} -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: mgr-api-deployment - namespace: {{ .Values.namespace.name }} - labels: - {{- include "qtest-mgr.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: mgr-api-deployment - minReplicas: {{ .Values.autoscaling.minReplicas.api }} - maxReplicas: {{ .Values.autoscaling.maxReplicas.api }} - metrics: - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} --- +{{- end -}} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: @@ -226,38 +131,4 @@ spec: type: Utilization averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} ---- -apiVersion: autoscaling/v2 -kind: HorizontalPodAutoscaler -metadata: - name: mgr-notification-deployment - namespace: {{ .Values.namespace.name }} - labels: - {{- include "qtest-mgr.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: mgr-notification-deployment - minReplicas: {{ .Values.autoscaling.minReplicas.notification }} - maxReplicas: {{ .Values.autoscaling.maxReplicas.notification }} - metrics: - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} -{{- end -}} {{- end }} -{{- end }} \ No newline at end of file diff --git a/Charts/qtest-mgr/templates/rollout.yaml b/Charts/qtest-mgr/templates/rollout.yaml index 65973573..2c6c1e93 100644 --- a/Charts/qtest-mgr/templates/rollout.yaml +++ b/Charts/qtest-mgr/templates/rollout.yaml @@ -35,27 +35,6 @@ spec: --- apiVersion: argoproj.io/v1alpha1 kind: Rollout -metadata: - name: mgr-poller-rollout - namespace: {{ .Values.namespace.name }} -spec: - replicas: {{ .Values.autoscaling.minReplicas.poller }} - revisionHistoryLimit: 3 - workloadRef: - apiVersion: apps/v1 - kind: Deployment - name: mgr-poller-deployment - strategy: - {{- with .Values.rollouts.strategy -}} - {{- toYaml . | nindent 4 }} - {{- end }} - steps: - {{- with .Values.rollouts.steps -}} - {{- toYaml . | nindent 8 }} - {{- end }} ---- -apiVersion: argoproj.io/v1alpha1 -kind: Rollout metadata: name: mgr-notification-rollout namespace: {{ .Values.namespace.name }} diff --git a/Charts/qtest-mgr/values.yaml b/Charts/qtest-mgr/values.yaml index 1cec69f7..368d60ab 100644 --- a/Charts/qtest-mgr/values.yaml +++ b/Charts/qtest-mgr/values.yaml @@ -519,6 +519,7 @@ startupSslProbe: nodeSelector: {} tolerations: [] affinity: {} +topologySpreadConstraints: {} ### qtest-launch ################################################### qtest-launch: enabled: false