diff --git a/.gitignore b/.gitignore index d8d5e72370..bb6e39ea3a 100644 --- a/.gitignore +++ b/.gitignore @@ -124,4 +124,4 @@ kubernetes.tar.gz *.pyc # e2e log files -/hack/*.log +*.log diff --git a/.travis.yml b/.travis.yml index ccae8b5a75..1924b093e5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,3 +31,8 @@ jobs: - make cli - make docker - make e2e-test-kind + after_failure: + # Echo logs and upload + - test -f volcano-admission.log && echo "******<>******" && cat volcano-admission.log + - test -f volcano-controller.log && echo "******<>******" && cat volcano-controller.log + - test -f volcano-scheduler.log && echo "******<>******" && cat volcano-scheduler.log diff --git a/hack/run-e2e-kind.sh b/hack/run-e2e-kind.sh index eb94d15620..9ae2183cae 100755 --- a/hack/run-e2e-kind.sh +++ b/hack/run-e2e-kind.sh @@ -74,6 +74,13 @@ function uninstall-volcano { helm delete integration --purge --kubeconfig ${KUBECONFIG} } +function generate-log { + echo "Generating volcano log files" + kubectl logs -lapp=volcano-admission -n kube-system > volcano-admission.log + kubectl logs -lapp=volcano-controller -n kube-system > volcano-controller.log + kubectl logs -lapp=volcano-scheduler -n kube-system > volcano-scheduler.log +} + # clean up function cleanup { uninstall-volcano @@ -118,3 +125,8 @@ install-volcano # Run e2e test cd ${VK_ROOT} KUBECONFIG=${KUBECONFIG} go test ./test/e2e -v -timeout 30m + +if [[ $? != 0 ]]; then + generate-log + exit 1 +fi diff --git a/installer/chart/volcano/templates/admission.yaml b/installer/chart/volcano/templates/admission.yaml index 66ccc33375..85693450ec 100644 --- a/installer/chart/volcano/templates/admission.yaml +++ b/installer/chart/volcano/templates/admission.yaml @@ -40,21 +40,18 @@ apiVersion: apps/v1 kind: Deployment metadata: labels: - app: admission - admission: "true" + app: volcano-admission name: {{ .Release.Name }}-admission namespace: {{ .Release.Namespace }} spec: replicas: 1 selector: matchLabels: - app: admission - admission: "true" + app: volcano-admission template: metadata: labels: - app: admission - admission: "true" + app: volcano-admission spec: serviceAccount: {{ .Release.Name }}-admission {{ if .Values.basic.image_pull_secret }} @@ -90,7 +87,7 @@ apiVersion: v1 kind: Service metadata: labels: - test: admission + app: volcano-admission name: {{ .Release.Name }}-admission-service namespace: {{ .Release.Namespace }} spec: @@ -99,5 +96,5 @@ spec: protocol: TCP targetPort: 443 selector: - admission: "true" + app: volcano-admission sessionAffinity: None diff --git a/installer/chart/volcano/templates/controllers.yaml b/installer/chart/volcano/templates/controllers.yaml index d19a973219..4a25b183af 100644 --- a/installer/chart/volcano/templates/controllers.yaml +++ b/installer/chart/volcano/templates/controllers.yaml @@ -63,15 +63,17 @@ apiVersion: apps/v1 metadata: name: {{ .Release.Name }}-controllers namespace: {{ .Release.Namespace }} + labels: + app: volcano-controller spec: replicas: 1 selector: matchLabels: - vk-controllers: test + app: volcano-controller template: metadata: labels: - vk-controllers: test + app: volcano-controller spec: serviceAccount: {{ .Release.Name }}-controllers {{ if .Values.basic.image_pull_secret }} diff --git a/installer/chart/volcano/templates/scheduler.yaml b/installer/chart/volcano/templates/scheduler.yaml index 8a4423316a..bb66a79576 100644 --- a/installer/chart/volcano/templates/scheduler.yaml +++ b/installer/chart/volcano/templates/scheduler.yaml @@ -84,15 +84,17 @@ apiVersion: apps/v1 metadata: name: {{ .Release.Name }}-scheduler namespace: {{ .Release.Namespace }} + labels: + app: volcano-scheduler spec: replicas: 1 selector: matchLabels: - vk-scheduler: test + app: volcano-scheduler template: metadata: labels: - vk-scheduler: test + app: volcano-scheduler spec: serviceAccount: {{ .Release.Name }}-scheduler containers: