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 2021/01/22 07:42:15 UTC

[GitHub] [airflow] Iamcerba commented on issue #13076: Getting "Invalid kube-config file" when trying to run SparkKubernetesOperator

Iamcerba commented on issue #13076:
URL: https://github.com/apache/airflow/issues/13076#issuecomment-765204373


   @Coqueiro it actually not completely correct, but will work in your case.
   
   Underneath this connection string converted to dict using "json.loads" and eventually in the code the following check applied:
   
   ```
           in_cluster = extras.get("extra__kubernetes__in_cluster")
   
           if in_cluster:
               self.log.debug("loading kube_config from: in_cluster configuration")
               config.load_incluster_config()
               return client.ApiClient()
   ```
   
   If you provide any string in the value of {"extra__kubernetes__in_cluster":"<any non empty string>"} you will enter IF clause as soon as bool("<any non empty string>") == True.
   
   The correct connection string will be:
   ```
   {"extra__kubernetes__in_cluster":true}
   ```
   


----------------------------------------------------------------
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