Skip to content

Commit 3583b81

Browse files
author
Klaus Ma
authored
Merge pull request #59 from volcano-sh/feature/support-controller-log
Support displaying log files
2 parents 91e8091 + 1218d20 commit 3583b81

File tree

6 files changed

+31
-13
lines changed

6 files changed

+31
-13
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,4 +124,4 @@ kubernetes.tar.gz
124124
*.pyc
125125

126126
# e2e log files
127-
/hack/*.log
127+
*.log

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,8 @@ jobs:
3131
- make cli
3232
- make docker
3333
- make e2e-test-kind
34+
after_failure:
35+
# Echo logs and upload
36+
- test -f volcano-admission.log && echo "******<<admission logs>>******" && cat volcano-admission.log
37+
- test -f volcano-controller.log && echo "******<<controller logs>>******" && cat volcano-controller.log
38+
- test -f volcano-scheduler.log && echo "******<<scheduler logs>>******" && cat volcano-scheduler.log

hack/run-e2e-kind.sh

+12
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ function uninstall-volcano {
7474
helm delete integration --purge --kubeconfig ${KUBECONFIG}
7575
}
7676

77+
function generate-log {
78+
echo "Generating volcano log files"
79+
kubectl logs -lapp=volcano-admission -n kube-system > volcano-admission.log
80+
kubectl logs -lapp=volcano-controller -n kube-system > volcano-controller.log
81+
kubectl logs -lapp=volcano-scheduler -n kube-system > volcano-scheduler.log
82+
}
83+
7784
# clean up
7885
function cleanup {
7986
uninstall-volcano
@@ -118,3 +125,8 @@ install-volcano
118125
# Run e2e test
119126
cd ${VK_ROOT}
120127
KUBECONFIG=${KUBECONFIG} go test ./test/e2e -v -timeout 30m
128+
129+
if [[ $? != 0 ]]; then
130+
generate-log
131+
exit 1
132+
fi

installer/chart/volcano/templates/admission.yaml

+5-8
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,18 @@ apiVersion: apps/v1
4040
kind: Deployment
4141
metadata:
4242
labels:
43-
app: admission
44-
admission: "true"
43+
app: volcano-admission
4544
name: {{ .Release.Name }}-admission
4645
namespace: {{ .Release.Namespace }}
4746
spec:
4847
replicas: 1
4948
selector:
5049
matchLabels:
51-
app: admission
52-
admission: "true"
50+
app: volcano-admission
5351
template:
5452
metadata:
5553
labels:
56-
app: admission
57-
admission: "true"
54+
app: volcano-admission
5855
spec:
5956
serviceAccount: {{ .Release.Name }}-admission
6057
{{ if .Values.basic.image_pull_secret }}
@@ -90,7 +87,7 @@ apiVersion: v1
9087
kind: Service
9188
metadata:
9289
labels:
93-
test: admission
90+
app: volcano-admission
9491
name: {{ .Release.Name }}-admission-service
9592
namespace: {{ .Release.Namespace }}
9693
spec:
@@ -99,5 +96,5 @@ spec:
9996
protocol: TCP
10097
targetPort: 443
10198
selector:
102-
admission: "true"
99+
app: volcano-admission
103100
sessionAffinity: None

installer/chart/volcano/templates/controllers.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,17 @@ apiVersion: apps/v1
6363
metadata:
6464
name: {{ .Release.Name }}-controllers
6565
namespace: {{ .Release.Namespace }}
66+
labels:
67+
app: volcano-controller
6668
spec:
6769
replicas: 1
6870
selector:
6971
matchLabels:
70-
vk-controllers: test
72+
app: volcano-controller
7173
template:
7274
metadata:
7375
labels:
74-
vk-controllers: test
76+
app: volcano-controller
7577
spec:
7678
serviceAccount: {{ .Release.Name }}-controllers
7779
{{ if .Values.basic.image_pull_secret }}

installer/chart/volcano/templates/scheduler.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,17 @@ apiVersion: apps/v1
8484
metadata:
8585
name: {{ .Release.Name }}-scheduler
8686
namespace: {{ .Release.Namespace }}
87+
labels:
88+
app: volcano-scheduler
8789
spec:
8890
replicas: 1
8991
selector:
9092
matchLabels:
91-
vk-scheduler: test
93+
app: volcano-scheduler
9294
template:
9395
metadata:
9496
labels:
95-
vk-scheduler: test
97+
app: volcano-scheduler
9698
spec:
9799
serviceAccount: {{ .Release.Name }}-scheduler
98100
containers:

0 commit comments

Comments
 (0)