[383922] Add helm test to Armada

Add basic helm test to Armada

Change-Id: I9b1d77f434c5eb770247710d4dd5ef3c53aab513
This commit is contained in:
Anthony Lin 2018-03-28 07:38:20 +00:00
parent 950c6012ab
commit e42333c8bd
2 changed files with 47 additions and 0 deletions

View File

@ -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 }}

View File

@ -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