File tree Expand file tree Collapse file tree 4 files changed +45
-3
lines changed
spark-integration-test-kubeadm-k8s
spark-integration-test-minikube-k8s
roles/create-single-k8s-cluster-with-minikube/tasks Expand file tree Collapse file tree 4 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 1+ - hosts : all
2+ become : yes
3+ tasks :
4+ - name : Collect k8s cluster log
5+ shell : |
6+ set -ex
7+ export KUBECONFIG=/etc/kubernetes/admin.conf
8+ mkdir -p '{{ k8s_log_dir }}'
9+ pods=$(kubectl -n kube-system get pods -o jsonpath='{.items[*].metadata.name}')
10+ for pod in $pods; do
11+ for co in $(kubectl -n kube-system get pods $pod -o jsonpath='{.spec.containers[*].name}'); do
12+ kubectl -n kube-system logs $pod -c $co > '{{ k8s_log_dir }}'/$pod-$co.log
13+ done
14+ done
15+ args :
16+ executable : /bin/bash
Original file line number Diff line number Diff line change 1+ - hosts : all
2+ become : yes
3+ tasks :
4+ - name : Collect k8s cluster log
5+ shell : |
6+ set -ex
7+ mkdir -p '{{ k8s_log_dir }}'
8+ pods=$(kubectl -n kube-system get pods -o jsonpath='{.items[*].metadata.name}')
9+ for pod in $pods; do
10+ for co in $(kubectl -n kube-system get pods $pod -o jsonpath='{.spec.containers[*].name}'); do
11+ kubectl -n kube-system logs $pod -c $co > '{{ k8s_log_dir }}'/$pod-$co.log
12+ done
13+ done
14+ args :
15+ executable : /bin/bash
Original file line number Diff line number Diff line change 77 curl -Lo /usr/local/bin/kubectl https://storage.googleapis.com/kubernetes-release/release/"{{ kubectl_version }}"/bin/linux/amd64/kubectl && chmod +x /usr/local/bin/kubectl
88 sed -i 's/nameserver 127.0.0.1/nameserver 8.8.8.8/' /etc/resolv.conf
99 minikube start --cpus 4 --memory 6144 --vm-driver=none
10- # Sleep 4 mins, waiting for cluster ready
11- sleep 240
12- kubectl get pods --all-namespaces
10+ # sleep for waiting cluster ready
11+ sleep 180
12+ timeout 300 bash -c '
13+ while :
14+ do
15+ [ -z "$(kubectl -n kube-system get pods --field-selector=status.phase!=Running)" ] && break
16+ sleep 5
17+ done
18+ '
19+ kubectl -n kube-system get all
1320 args :
1421 executable : /bin/bash
Original file line number Diff line number Diff line change 10871087 description : |
10881088 Run integration tests of spark of master with k8s cluster deployed by kubeadm
10891089 run : playbooks/spark-integration-test-kubeadm-k8s/run.yaml
1090+ vars :
1091+ k8s_log_dir : ' {{ ansible_user_dir }}/workspace/logs/kubernetes'
10901092
10911093- job :
10921094 name : spark-integration-test-minikube-k8s
10951097 Run integration tests of spark of v2.4.0 with k8s cluster deployed by minikube
10961098 run : playbooks/spark-integration-test-minikube-k8s/run.yaml
10971099 override-checkout : branch-2.4
1100+ vars :
1101+ k8s_log_dir : ' {{ ansible_user_dir }}/workspace/logs/kubernetes'
You can’t perform that action at this time.
0 commit comments