Skip to content

Commit

Permalink
Fix: Update HorizontalPodAutoscaler to autoscaling/v2
Browse files Browse the repository at this point in the history
  • Loading branch information
bokysan committed Apr 21, 2024
1 parent 55f2f71 commit aba3d60
Show file tree
Hide file tree
Showing 17 changed files with 30,561 additions and 10 deletions.
19 changes: 19 additions & 0 deletions helm/mail/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@ spec:
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }}
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- if .Values.autoscaling.targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- else }}
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
resource:
Expand All @@ -37,4 +55,5 @@ spec:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

11,035 changes: 11,035 additions & 0 deletions helm/schemas/cached/99f9af78423183d5b0f41de6962964f8047f2c374668ef89d61379cd7213bbeb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

10,082 changes: 10,082 additions & 0 deletions helm/schemas/cached/e900c45a86858dee3e60e3dcbf07211cbb405fa322784c8d888dc88842faa7ba

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Empty file.
1,245 changes: 1,245 additions & 0 deletions helm/schemas/master-standalone/horizontalpodautoscaler-autoscaling-v2beta1.json

Large diffs are not rendered by default.

1,616 changes: 1,616 additions & 0 deletions helm/schemas/master-standalone/horizontalpodautoscaler-autoscaling-v2beta2.json

Large diffs are not rendered by default.

37 changes: 27 additions & 10 deletions helm/tests.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#!/usr/bin/env bash
set -e

reset="$(printf '\033[0m')"
green="$(printf '\033[38;5;46m')"
yellow="$(printf '\033[38;5;178m')"
orange="$(printf '\033[38;5;208m')"
orange_emphasis="$(printf '\033[38;5;220m')"
lightblue="$(printf '\033[38;5;147m')"
red="$(printf '\033[91m')"
gray="$(printf '\033[38;5;245m')"
emphasis="$(printf '\033[38;5;111m')"
underline="$(printf '\033[4m')"

SCRIPT_DIR="$( pwd; )/$( dirname -- $0; )"
cd "${SCRIPT_DIR}"
FIND="find"
Expand All @@ -12,16 +23,22 @@ if command -v gfind >/dev/null 2>&2; then
fi

do_the_test() {
local i="${1}"
echo "☆☆☆☆☆☆☆☆☆☆ $i ☆☆☆☆☆☆☆☆☆☆"
helm template -f $i --dry-run mail > fixtures/demo.yaml
docker run \
-v "${SCRIPT_DIR}/fixtures:/fixtures" \
-v "${SCRIPT_DIR}/schemas:/schemas" \
garethr/kubeval \
--force-color \
--additional-schema-locations file:///schemas \
fixtures/demo.yaml
local i="${1}" v
printf '%s' "${gray}☆☆☆☆☆☆☆☆☆☆${reset} ${orange_emphasis}$i${reset}: ${gray}☆☆☆☆☆☆☆☆☆☆${reset}"
echo
for v in 1.22.9 1.29.4; do
printf '%s' "${emphasis}${lightblue}k8s v${v}${reset}${lightblue}... ${reset}"
helm template -f "${i}" --kube-version "${v}" --dry-run mail > fixtures/demo.yaml
docker run \
-v "${SCRIPT_DIR}/fixtures:/fixtures" \
-v "${SCRIPT_DIR}/schemas:/schemas" \
ghcr.io/yannh/kubeconform:latest-alpine \
-summary -debug -kubernetes-version "${v}" \
-cache "./schemas/cached" \
-schema-location "https://raw.githubusercontent.com/yannh/kubernetes-json-schema/master/{{ .NormalizedKubernetesVersion }}-standalone{{ .StrictSuffix }}/{{ .ResourceKind }}{{ .KindSuffix }}.json" \
-schema-location "./schemas/master-standalone/{{ .ResourceKind }}{{ .KindSuffix }}.json" \
fixtures/demo.yaml
done
}


Expand Down

0 comments on commit aba3d60

Please sign in to comment.