Commit ca64bb39 authored by Shinya Maeda's avatar Shinya Maeda
Browse files

Merge branch 'hustewart-update-autoscaling' into 'master'

parents c0ea260f da9e63d6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -44,7 +44,7 @@
| hpa.minReplicas               |             | `1`                                |
| hpa.maxReplicas               |             | `5`                                |
| hpa.targetCPUUtilizationPercentage | `autoscaling/v1` - Percentage threshold for when HPA begins scaling out pods. Ignored if `hpa.metrics` is present. | `nil` |
| hpa.metrics                   | `autoscaling/v2beta2`  [metrics](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/) definitions for when HPA begins scaling out pods.  | `nil` |
| hpa.metrics                   | `autoscaling/v2`  [metrics](https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/) definitions for when HPA begins scaling out pods.  | `nil` |
| gitlab.app                    | GitLab project slug. | `nil` |
| gitlab.env                    | GitLab environment slug. | `nil` |
| gitlab.envName                | GitLab environment name. | `nil` |
+1 −1
Original line number Diff line number Diff line
{{- if and .Values.hpa.enabled .Values.resources.requests -}}
{{- if .Values.hpa.metrics }}
apiVersion: autoscaling/v2beta2
apiVersion: autoscaling/v2
{{- else }}
apiVersion: autoscaling/v1
{{- end }}
+3 −3
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ import (
	"github.com/gruntwork-io/terratest/modules/helm"
	"github.com/stretchr/testify/require"
	autoscalingV1 "k8s.io/api/autoscaling/v1"
	autoscalingV2Beta2 "k8s.io/api/autoscaling/v2beta2"
	autoscalingV2 "k8s.io/api/autoscaling/v2"
)

func TestHPA_AutoscalingV1(t *testing.T) {
@@ -63,7 +63,7 @@ func TestHPA_AutoscalingV1(t *testing.T) {
	}
}

func TestHPA_AutoscalingV2beta2(t *testing.T) {
func TestHPA_AutoscalingV2(t *testing.T) {
	templates := []string{"templates/hpa.yaml"}
	releaseName := "hpa-test"

@@ -128,7 +128,7 @@ resources:
				return
			}

			hpa := new(autoscalingV2Beta2.HorizontalPodAutoscaler)
			hpa := new(autoscalingV2.HorizontalPodAutoscaler)
			helm.UnmarshalK8SYaml(t, output, hpa)
			require.Equal(t, tc.expectedName, hpa.ObjectMeta.Name)
			require.Equal(t, tc.expectedMinReplicas, *hpa.Spec.MinReplicas)
+1 −1
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ hpa:
  maxReplicas: 5
  # Only one of targetCPUUtilizationPercentage and metrics can be chosen.
  # This is because targetCPUUtilizationPercentage is from autoscaling/v1,
  # whereas metrics is from autoscaling/v2beta2. If both are provided, only
  # whereas metrics is from autoscaling/v2. If both are provided, only
  # metrics will be used.
  # See https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/
  # for examples of each.