Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug-657197 update CPU request value and HPA target CPU value #322

Merged
merged 4 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/pega/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ You can optionally configure the resource allocation and limits for a tier using
Parameter | Description | Default value
--- | --- | ---
`replicas` | Specify the number of Pods to deploy in the tier. | `1`
`cpuRequest` | Initial CPU request for pods in the current tier. | `2`
`cpuRequest` | Initial CPU request for pods in the current tier. | `3`
`cpuLimit` | CPU limit for pods in the current tier. | `4`
`memRequest` | Initial memory request for pods in the current tier. | `12Gi`
`memLimit` | Memory limit for pods in the current tier. | `12Gi`
Expand Down Expand Up @@ -474,7 +474,7 @@ Parameter | Description | Default value
--- | --- | ---
`hpa.minReplicas` | Minimum number of replicas that HPA can scale-down | `1`
`hpa.maxReplicas` | Maximum number of replicas that HPA can scale-up | `5`
`hpa.targetAverageCPUValue` | Threshold value for scaling based on absolute CPU usage (The default value is `2.8` which represents 2.8 [Kubernetes CPU units](https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#cpu-units)) | `2.8`
`hpa.targetAverageCPUValue` | Threshold value for scaling based on absolute CPU usage (The default value is `2.55` which represents 2.55 [Kubernetes CPU units](https://kubernetes.io/docs/tasks/configure-pod-container/assign-cpu-resource/#cpu-units)) | `2.55`
`hpa.targetAverageCPUUtilization` | Threshold value for scaling based on initial CPU request utilization (Can be set instead of `hpa.targetAverageCPUValue` to set the threshold as a percentage of the requested CPU) |
`hpa.targetAverageMemoryUtilization` | Threshold value for scaling based on initial memory utilization (The default value is `85` which corresponds to 85% of 12Gi ) | `85`
`hpa.enableCpuTarget` | Set to true if you want to enable scaling based on CPU utilization or false if you want to disable it | true
Expand Down
2 changes: 1 addition & 1 deletion charts/pega/templates/_pega-deployment.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ spec:
{{- if .node.cpuRequest }}
cpu: "{{ .node.cpuRequest }}"
{{- else }}
cpu: 2
cpu: 3
{{- end }}
{{- if .node.memRequest }}
memory: "{{ .node.memRequest }}"
Expand Down
2 changes: 1 addition & 1 deletion charts/pega/templates/_pega_hpa.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
averageUtilization: {{ .hpa.targetAverageCPUUtilization }}
{{- else }}
type: Value
averageValue: 2.8
averageValue: 2.55
{{- end }}
{{- end }}
{{- if (hasKey .hpa "enableMemoryTarget" | ternary .hpa.enableMemoryTarget false) }}
Expand Down
1 change: 1 addition & 0 deletions terratest/src/test/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion terratest/src/test/pega/pega-tier-deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func VerifyDeployment(t *testing.T, pod *k8score.PodSpec, expectedSpec pegaDeplo
require.Equal(t, getObjName(options, "-environment-config"), pod.Containers[0].EnvFrom[0].ConfigMapRef.LocalObjectReference.Name)
require.Equal(t, "4", pod.Containers[0].Resources.Limits.Cpu().String())
require.Equal(t, "12Gi", pod.Containers[0].Resources.Limits.Memory().String())
require.Equal(t, "2", pod.Containers[0].Resources.Requests.Cpu().String())
require.Equal(t, "3", pod.Containers[0].Resources.Requests.Cpu().String())
require.Equal(t, "12Gi", pod.Containers[0].Resources.Requests.Memory().String())

require.Equal(t, "pega-volume-config", pod.Containers[0].VolumeMounts[0].Name)
Expand Down
6 changes: 3 additions & 3 deletions terratest/src/test/pega/pega-tier-hpa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ func TestPegaTierHPA(t *testing.T) {
kind: "Deployment",
apiversion: "apps/v1",
cpu: true,
cpuValue: parseResourceValue(t, "2.8"),
cpuValue: parseResourceValue(t, "2.55"),
},
{
name: getObjName(options, "-batch-hpa"),
targetRefName: getObjName(options, "-batch"),
kind: "Deployment",
apiversion: "apps/v1",
cpu: true,
cpuValue: parseResourceValue(t, "2.8"),
cpuValue: parseResourceValue(t, "2.55"),
},
})
}
Expand Down Expand Up @@ -107,7 +107,7 @@ func TestPegaTierHPADisableTarget(t *testing.T) {
kind: "Deployment",
apiversion: "apps/v1",
cpu: true,
cpuValue: parseResourceValue(t, "2.8"),
cpuValue: parseResourceValue(t, "2.55"),
},
})
}
Expand Down