<p>Difficulty running airflow commands when running Airflow on Kubernetes that I installed from the Helm stable/airflow repo. For instance I try to exec into the scheduler pod and run <code>airflow list</code> and I get the following error:</p>
<pre><code>airflow.exceptions.AirflowConfigException: error: cannot use sqlite with the KubernetesExecutor airlow
</code></pre>
<p>Ok so I switch to the celery executor.</p>
<p>Same thing</p>
<pre><code>airflow.exceptions.AirflowConfigException: error: cannot use sqlite with the CeleryExecutor
</code></pre>
<p>So what is the correct way to run airflow CLI commands when running on K8s?</p>

<p>Make sure you are using <code>bash</code>. <code>/home/airflow/.bashrc</code> imports the environment variables from <code>/home/airflow/airflow_env.sh</code> to setup the connection. The following are some examples:</p>
<pre class="lang-bash prettyprint-override"><code>kubectl exec -ti airflow-scheduler-nnn-nnn -- /bin/bash
$ airflow list_dags
</code></pre>
<p>Or with shell you can import the env vars yourself:</p>
<pre class="lang-bash prettyprint-override"><code>kubectl exec -ti airflow-scheduler-nnn-nnn -- sh -c &quot;. /home/airflow/airflow_env.sh &amp;&amp; airflow list_dags&quot;
</code></pre>
