Skip to content

Commit

Permalink
Merge pull request #554 from boozallen/546-helm-resource-specification
Browse files Browse the repository at this point in the history
Update helm charts to allow resource specification
  • Loading branch information
carter-cundiff authored Jan 31, 2025
2 parents 23e9099 + 69eb5d8 commit cda8f46
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 1 deletion.
7 changes: 7 additions & 0 deletions DRAFT_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,13 @@ Spark and PySpark have been upgraded from version 3.5.2 to 3.5.4.
## Record Relation
To enable nested data records, we have added a new relation feature to the record metamodel. This allows records to reference other records. For more details, refer to the [Record Relation Options].(https://boozallen.github.io/aissemble/aissemble/current-dev/record-metamodel.html#_record_relation_options)

## Helm Charts Resource Specification
The following Helm charts have been updated to include the configuration options for specifying container resource requests/limits:
- `aissemble-spark-history-chart`
- `aissemble-quarkus-chart`

See the[official Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) for more details.

# Breaking Changes
_Note: instructions for adapting to these changes are outlined in the upgrade instructions below._

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ helm install my-quarkus-app oci://ghcr.io/boozallen/aissemble-quarkus-chart --ve
| deployment.args | The args for the pod | No | None |
| deployment.hostname | The hostname for the pod. Overrides the Chart.Name value | No | Chart.Name |
| deployment.restartPolicy | The restart policy | No | Always |
| deployment.resources | Specify container resource requests/limits (ref: [Kubernetes Resource Management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)) | No | None |
| service.type | The service type | No | ClusterIP |
| service.ports | The service ports | No | - name: http <br/>&emsp;&emsp;port: 8080<br/>&emsp;&emsp;protocol: TCP<br/>&emsp;&emsp;targetPort: 8080 |
| configMap.supplementalQuarkusConfig | List of additional properties to provide to the Quarkus app | No | [] |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.deployment.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.deployment.startupProbe }}
startupProbe:
{{- toYaml . | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ tests:
content:
name: quarkus-application-properties
any: true
- notExists:
path: spec.template.spec.containers[0].resources
- it: Should set values appropriately
set:
deployment:
Expand Down Expand Up @@ -126,4 +128,27 @@ tests:
value: /path/health
- equal:
path: spec.template.spec.containers[0].startupProbe.httpGet.port
value: http
value: http
- it: When specifying container resources requests and limits, appropriate requests and limits are configured
set:
deployment:
resources:
requests:
memory: 300Mi
cpu: 100m
limits:
memory: 500Mi
cpu: 200m
asserts:
- equal:
path: spec.template.spec.containers[0].resources.requests.memory
value: 300Mi
- equal:
path: spec.template.spec.containers[0].resources.requests.cpu
value: 100m
- equal:
path: spec.template.spec.containers[0].resources.limits.memory
value: 500Mi
- equal:
path: spec.template.spec.containers[0].resources.limits.cpu
value: 200m
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ _**NOTE:**_ *the version should match the aiSSEMBLE project version.*
| deployment.command | Command to run in the container. | `["/opt/spark/sbin/start-spark-history-server.sh"]` |
| deployment.env | Environment variables to set in the Spark History Server Deployment. | `SPARK_NO_DAEMONIZE: "true"` |
| deployment.envFromSecret | Environment variables to pull from a Secret. Format: <br/>`ENV_VAR.secretName: k8s_secret_name`<br/>`ENV_VAR.key: k8s_secret_key` | {} |
| deployment.resources | Specify container resource requests/limits (ref: [Kubernetes Resource Management](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)) | None |
| deployment.volumes | Volumes to attach to the Spark History Server Deployment. | [] |
| deployment.volumeMounts | Volume mounts to attach to the Spark History Server Deployment. | [] |
| deployment.affinity | Node Affinity rule to constrain which nodes your Pod can be scheduled on based on node labels. | {} | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ spec:
name: {{ $v.secretName }}
key: {{ $v.key }}
{{- end }}
{{- with .Values.deployment.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- containerPort: {{ .Values.service.port.port }}
name: {{ .Values.service.port.name }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,31 @@ tests:
values:
- arm64

- it: When specifying container resources requests and limits, appropriate requests and limits are configured
set:
deployment:
resources:
requests:
memory: 300Mi
cpu: 100m
limits:
memory: 500Mi
cpu: 200m
asserts:
- equal:
path: spec.template.spec.containers[0].resources.requests.memory
value: 300Mi
- equal:
path: spec.template.spec.containers[0].resources.requests.cpu
value: 100m
- equal:
path: spec.template.spec.containers[0].resources.limits.memory
value: 500Mi
- equal:
path: spec.template.spec.containers[0].resources.limits.cpu
value: 200m

- it: By default, does not include resource requests and limits
asserts:
- notExists:
path: spec.template.spec.containers[0].resources

0 comments on commit cda8f46

Please sign in to comment.