diff --git a/charts/armada/templates/tests/test-armada-api.yaml b/charts/armada/templates/tests/test-armada-api.yaml new file mode 100644 index 00000000..89cbf51a --- /dev/null +++ b/charts/armada/templates/tests/test-armada-api.yaml @@ -0,0 +1,38 @@ +{{/* +# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. */}} +{{/* +Test the Armada API, to ensure that the health endpoint is active and able to respond. +*/}} +{{- if .Values.manifests.test_armada_api }} +--- +apiVersion: v1 +kind: Pod +metadata: + name: "{{ .Release.Name }}-armada-api-test" + annotations: + "helm.sh/hook": "test-success" +spec: + restartPolicy: Never + containers: + - name: "{{ .Release.Name }}-armada-api-test" + env: + - name: 'ARMADA_URL' + value: {{ tuple "armada" "internal" "api" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" | quote }} + image: {{ .Values.images.tags.api }} + imagePullPolicy: {{ .Values.images.pull_policy }} +{{ tuple . .Values.pod.resources.test.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }} + command: ["/bin/bash", "-c", "curl -v -X GET --fail ${ARMADA_URL}/api/v1.0/health; exit $?"] +... +{{- end }} diff --git a/charts/armada/values.yaml b/charts/armada/values.yaml index 7dd2ce6b..5994e62a 100644 --- a/charts/armada/values.yaml +++ b/charts/armada/values.yaml @@ -228,6 +228,14 @@ pod: requests: memory: "128Mi" cpu: "100m" + test: + api: + limits: + memory: "128Mi" + cpu: "100m" + requests: + memory: "128Mi" + cpu: "100m" manifests: configmap_bin: true @@ -242,3 +250,4 @@ manifests: service_api: true service_ingress_api: true service_tiller_deploy: true + test_armada_api: true