How do I debug the initialization of a pod on Kubernetes

9/30/2019

I'm using the stable/airflow helm chart, and would like to debug the initialization of the git-clone container. According to the readme, this container requires a secret, which I created as follows:

kubectl create secret generic rein-ai-secret --from-file=id_rsa=/home/juanpa/.ssh/airflow-key --from-file=known_hosts=/home/juanpa/.ssh/known_hosts --from-file=id_rsa.pub=/home/juanpa/.ssh/airflow-key.pub

I'm using a very simplified config.yaml

airflow:
  image:
    repository: puckel/docker-airflow
    tag: 1.10.4
  schedulerNumRuns: "-1"
  config:
    AIRFLOW__CORE__DAGS_FOLDER: /usr/local/airflow/repo/data-pipeline/airflow_data/dags
dags:
  path: /usr/local/airflow/repo
  git:
    url: git@github.com:acend-io/data-pipeline.git
    ref: master
    secret: rein-ai-secret
  initContainer:
    enabled: true
    image:
      repository: alpine/git
      tag: 1.0.7
      pullPolicy: IfNotPresent
    installRequirements: false

However, the airflow-scheduler, airflow-worker and airflow-webserver are in the Init:CrashLoopBackOff state meaning they keep restarting. kubectl describe doesn't give adequate information. How can I debug this problem? Or is something obviously wrong with my secret or config.yaml file?

Thanks for the support!

-- juanp_1982
airflow
airflow-operator
kubernetes-helm

1 Answer

11/26/2019

To debug, you can use kubectl logs <web-pod-name> -c git-clone to get the output of the git-clone bash command.

-- Robert Yi
Source: StackOverflow