title: Unable to use airflow KubernetesPodOperator on development machine
body: <p>I am trying to use KubernetesPodOperator for testing on development iMac (10.15.6) machine.
  Versions used for  minikube and kubectl are shown below. the airflow version used <code>apache-airflow[kubernetes]==1.10.11</code></p>
  <p>I am not able to run any pods using the KubernetesPodOperator. I have 2 issues.</p>
  <ol>
  <li>If I set <code>in_cluster=False</code>, then I get <code>FileNotFoundError: [Errno 2] No such file or directory: '/root/.kube/config'</code> issue</li>
  <li>If I set <code>in_cluster=True</code>, then I get <code>kubernetes.config.config_exception.ConfigException: Service host/port is not set.</code></li>
  </ol>
  <p>Do notice I tried mounting <code>~./kube/config</code> as volume using <code>Secret</code> and <code>Volume</code> from kubernetes secrets. This happened with both <code>docker-desktop</code> and <code>minikube</code></p>
  <ol>
  <li>can you help me with what I am doing wring with mounting</li>
  <li>can you suggest solutions for the service port complains ?</li>
  </ol>
  <pre class="lang-sh prettyprint-override"><code>$ kubectl version
  Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;16+&quot;, GitVersion:&quot;v1.16.6-beta.0&quot;, GitCommit:&quot;e7f962ba86f4ce7033828210ca3556393c377bcc&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-01-15T08:26:26Z&quot;, GoVersion:&quot;go1.13.5&quot;, Compiler:&quot;gc&quot;, Platform:&quot;darwin/amd64&quot;}
  Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;17&quot;, GitVersion:&quot;v1.17.3&quot;, GitCommit:&quot;06ad960bfd03b39c8310aaf92d1e7c12ce618213&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2020-02-11T18:07:13Z&quot;, GoVersion:&quot;go1.13.6&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
  $ minikube version
  minikube version: v1.12.1
  commit: 5664228288552de9f3a446ea4f51c6f29bbdd0e0
  </code></pre>
  <pre class="lang-py prettyprint-override"><code>
  
  from datetime import timedelta
  from airflow import DAG
  
  from airflow.operators.dummy_operator import DummyOperator
  from airflow.contrib.operators.kubernetes_pod_operator import KubernetesPodOperator
  from airflow.kubernetes.volume import Volume
  from airflow.kubernetes.volume_mount import VolumeMount
  from airflow.kubernetes.secret import Secret
  from airflow.kubernetes.pod import Port
  
  from airflow.utils.dates import days_ago
  
  default_args = {
      'owner': 'airflow',
      'depends_on_past': False,
      'start_date': days_ago(1),
      'email': ['username@domain.com'],
      'email_on_failure': False,
      'email_on_retry': False,
      'retries': 0,
      'retry_delay': timedelta(minutes=24*60)
  }
  
  dag = DAG('kubernetes_sample', 
              default_args=default_args, 
              schedule_interval=timedelta(minutes=24*60))
  
  start = DummyOperator(task_id='START', dag=dag)
  
  secret_volume_config = {
      &quot;secret&quot;: {
          &quot;secretName&quot;: &quot;local-dev-secrets&quot;
      }
  }
  kubeconfig_volume_config = {
      &quot;secret&quot;: {
          &quot;secretName&quot;: &quot;local-dev-secrets-kubeconfig&quot;
      }
  }
  
  volumes = [
      Volume(name='local-dev-secrets', configs=secret_volume_config),
      Volume(name='local-dev-secrets-kubeconfig', configs=kubeconfig_volume_config),
  ]
  
  volume_mounts = [
      VolumeMount('local-dev-secrets', mount_path='/secrets', sub_path=None, read_only=True),
      VolumeMount('local-dev-secrets-kubeconfig', mount_path='/root/.kube/config', sub_path=None, read_only=True),
      VolumeMount('local-dev-secrets-kubeconfig', mount_path='/kubeconfig', sub_path=None, read_only=True)
  ]
  
  # secret_folder = Secret(deploy_type='volume', deploy_target=&quot;/secrets&quot;, secret='local-dev-secrets', key=None)
  # secret_kubeconfig_file = Secret(deploy_type='volume', deploy_target=&quot;/root/.kube/config&quot;, secret='local-dev-secrets-kubeconfig', key=None)
  
  ports = [Port('http', 80),Port('http', 443)]
  
  current_task = KubernetesPodOperator(
                          task_id=&quot;current-task&quot;,
                          name=&quot;current-task&quot;,
                          namespace='default',dag=dag,
                          image=&quot;busybox:latest&quot;,
                          image_pull_policy='Always',
                          get_logs=True,
                          do_xcom_push=False, # local development
                          in_cluster=False,
                          is_delete_operator_pod=False,
                          # hostnetwork=True,
                          # ports=[ports],
                          # secrets=[secret_kubeconfig_file],
                          # config_file=&quot;/kubeconfig&quot;
                          volumes=volumes,
                          volume_mounts=volume_mounts,
                          # cmds=[&quot;ls&quot;,&quot;-alth&quot;, &quot;/&quot;],
                          log_events_on_failure=True
                          )
  
  current_task.set_upstream(start)
  
  </code></pre>