diff --git a/CHANGELOG.md b/CHANGELOG.md index a009d9e7..614b3c4f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,9 +8,11 @@ All notable changes to this project will be documented in this file. - Bumped image to `3.3.0-stackable0.2.0` in tests and docs ([#145]) - BREAKING: use resource limit struct instead of passing spark configuration arguments ([#147]) +- Fixed resources test ([#151]) [#145]: https://github.com/stackabletech/spark-k8s-operator/pull/145 [#147]: https://github.com/stackabletech/spark-k8s-operator/pull/147 +[#151]: https://github.com/stackabletech/spark-k8s-operator/pull/151 ## [0.5.0] - 2022-09-06 diff --git a/tests/templates/kuttl/resources/10-assert.yaml b/tests/templates/kuttl/resources/10-assert.yaml index 3af4f245..e40a762e 100644 --- a/tests/templates/kuttl/resources/10-assert.yaml +++ b/tests/templates/kuttl/resources/10-assert.yaml @@ -3,10 +3,44 @@ apiVersion: kuttl.dev/v1beta1 kind: TestAssert timeout: 900 --- -# The Job starting the whole process apiVersion: spark.stackable.tech/v1alpha1 kind: SparkApplication metadata: name: spark-resources status: phase: Succeeded +--- +apiVersion: v1 +kind: Pod +metadata: + labels: + spark-role: driver + app.kubernetes.io/managed-by: spark-k8s-operator +spec: + containers: + - name: spark-driver + resources: + limits: + cpu: 1500m + # N.B. spark adds memoryOverhead of 10% by default + memory: 1408Mi + requests: + cpu: "1" + memory: 1408Mi +--- +apiVersion: v1 +kind: Pod +metadata: + labels: + job-name: spark-resources + app.kubernetes.io/managed-by: spark-k8s-operator +spec: + containers: + - name: spark-submit + resources: + limits: + cpu: 200m + memory: 1Gi + requests: + cpu: 100m + memory: 1Gi diff --git a/tests/templates/kuttl/resources/13-assert.yaml b/tests/templates/kuttl/resources/13-assert.yaml deleted file mode 100644 index 70e61f8a..00000000 --- a/tests/templates/kuttl/resources/13-assert.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -apiVersion: kuttl.dev/v1beta1 -kind: TestAssert -timeout: 240 -skipLogOutput: true -commands: - - script: kubectl get cm -n $NAMESPACE spark-resources-pod-template -o yaml | yq -r '.data."driver.yml"' | yq -r '.spec.containers[0].resources.limits.cpu' | grep 1500m - - script: kubectl get cm -n $NAMESPACE spark-resources-pod-template -o yaml | yq -r '.data."driver.yml"' | yq -r '.spec.containers[0].resources.requests.cpu' | grep 1 - - script: kubectl get cm -n $NAMESPACE spark-resources-pod-template -o yaml | yq -r '.data."executor.yml"' | yq -r '.spec.containers[0].resources.limits.cpu' | grep 2 - - script: kubectl get cm -n $NAMESPACE spark-resources-pod-template -o yaml | yq -r '.data."executor.yml"' | yq -r '.spec.containers[0].resources.requests.cpu' | grep 1