You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/06/10 23:43:33 UTC

[GitHub] [airflow] ashb commented on a change in pull request #9220: Get all pod logs on Kube CI failure

ashb commented on a change in pull request #9220:
URL: https://github.com/apache/airflow/pull/9220#discussion_r438465611



##########
File path: scripts/ci/libraries/_kind.sh
##########
@@ -365,19 +365,23 @@ function apply_kubernetes_resources() {
 function dump_kubernetes_logs() {
     POD=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' \
         --cluster "${KUBECTL_CLUSTER_NAME}" | grep airflow | head -1)
+    kubectl get all
+    kubectl get all --namespace kube-system
+    echo "------coredns logs-------"
+    DNS_POD=$(kubectl get pods -o go-template -n kube-system --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' \
+        --cluster "${KUBECTL_CLUSTER_NAME}" | grep dns | head -1)
     echo "------- pod description -------"
     kubectl describe pod "${POD}" --cluster "${KUBECTL_CLUSTER_NAME}"
-    echo "------- webserver init container logs - init -------"
-    kubectl logs "${POD}" -c init --cluster "${KUBECTL_CLUSTER_NAME}" || true
-    if [[ "${KUBERNETES_MODE}" == "git" ]]; then
-        echo "------- webserver init container logs - git-sync-clone -------"
-        kubectl logs "${POD}" -c git-sync-clone --cluster "${KUBECTL_CLUSTER_NAME}" || true
-    fi
-    echo "------- webserver logs -------"
-    kubectl logs "${POD}" -c webserver --cluster "${KUBECTL_CLUSTER_NAME}" || true
-    echo "------- scheduler logs -------"
-    kubectl logs "${POD}" -c scheduler --cluster "${KUBECTL_CLUSTER_NAME}" || true
-    echo "--------------"
+    echo "------- airflow pod logs -------"
+    kubectl logs "${POD}" --all-containers=true || true
+    PG_POD=POD=$(kubectl get pods -o go-template --template '{{range .items}}{{.metadata.name}}{{"\n"}}{{end}}' \
+        --cluster "${KUBECTL_CLUSTER_NAME}" | grep postgres | head -1)
+    echo "------- postgres pod description -------"
+    kubectl describe pod "${PG_POD}" --cluster "${KUBECTL_CLUSTER_NAME}"
+    echo "------- postgres pod logs -------"
+    kubectl logs "${PG_POD}" --all-containers=true || true

Review comment:
       Something not quite right here: 
   ```
   ------- postgres pod description -------
   Error from server (NotFound): pods "POD=postgres-airflow-685c8f6684-6nxnl" not found
   ###########################################################################################
                      EXITING WITH STATUS CODE 1
   ###########################################################################################
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org