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/07/09 11:19:04 UTC

[GitHub] [airflow] jpatel-fpmx opened a new issue #16909: Unable to connect to Kubernetes cluster from Airflow

jpatel-fpmx opened a new issue #16909:
URL: https://github.com/apache/airflow/issues/16909


   <!--
   
   Welcome to Apache Airflow!  For a smooth issue process, try to answer the following questions.
   Don't worry if they're not all applicable; just try to include what you can :-)
   
   If you need to include code snippets or logs, please put them in fenced code
   blocks.  If they're super-long, please use the details tag like
   <details><summary>super-long log</summary> lots of stuff </details>
   
   Please delete these comment blocks before submitting the issue.
   
   -->
   
   **Apache Airflow version**: v2.1.1
   
   
   **Kubernetes version (if you are using kubernetes)** (use `kubectl version`):-
   Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:52:14Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"darwin/amd64"}
   Server Version: version.Info{Major:"1", Minor:"19+", GitVersion:"v1.19.8-eks-96780e", GitCommit:"96780e1b30acbf0a52c38b6030d7853e575bcdf3", GitTreeState:"clean", BuildDate:"2021-03-10T21:32:29Z", GoVersion:"go1.15.8", Compiler:"gc", Platform:"linux/amd64"}
   
   **Environment**: Development
   
   - **Cloud provider or hardware configuration**: AWS
   - **OS** (e.g. from /etc/os-release): 
   - **Kernel** (e.g. `uname -a`):
   - **Install tools**:
   - **Others**:
   
   **What happened**:
   I am unable to connect to my Kubernetes cluster from Airflow while using SparkKubernetesOperator. I have hosted Airflow and Spark-operator on EKS. I have created a connection on Airflow to connect to kubernetes cluster by using "in cluster configuration".
   I am just running the sample application just to check the execution of spark on Kubernetes through Airflow. Please find below the sample application link:-
   https://github.com/apache/airflow/blob/main/airflow/providers/cncf/kubernetes/example_dags/example_spark_kubernetes.py
   
   <!-- (please include exact error messages if you can) -->
   HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"sparkapplications.sparkoperator.k8s.io is forbidden: User \"system:serviceaccount:***:***-cluster\" cannot create resource \"sparkapplications\" in API group \"sparkoperator.k8s.io\" in the namespace \"spark-operator\"","reason":"Forbidden","details":{"group":"sparkoperator.k8s.io","kind":"sparkapplications"},"code":403}
   
   **What you expected to happen**:
   Kubernetes Airflow should schedule and run spark job using spark operator.
   
   <!-- What do you think went wrong? -->
   The Airflow Kubernetes connection is not working.
   
   **How to reproduce it**:
   1. Deploy Spark operator using helm on Kubernetes cluster.
   2. Deploy Airflow using helm on Kubernetes cluster.
   3. Deploy below application by writing Airflow DAG:-
   https://github.com/apache/airflow/blob/main/airflow/providers/cncf/kubernetes/example_dags/example_spark_kubernetes.py
   
   
   **Anything else we need to know**:
   
   <!--
   
   How often does this problem occur? Once? Every time etc? Everytime
   
   HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"sparkapplications.sparkoperator.k8s.io is forbidden: User \"system:serviceaccount:***:***-cluster\" cannot create resource \"sparkapplications\" in API group \"sparkoperator.k8s.io\" in the namespace \"spark-operator\"","reason":"Forbidden","details":{"group":"sparkoperator.k8s.io","kind":"sparkapplications"},"code":403}
   
   -->
   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] potiuk commented on issue #16909: Unable to connect to Kubernetes cluster from Airflow

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #16909:
URL: https://github.com/apache/airflow/issues/16909#issuecomment-877606462


   Apparently you have problem with permissions in your deployment. You need to configure your service account to have access to create resources. 


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] boring-cyborg[bot] commented on issue #16909: Unable to connect to Kubernetes cluster from Airflow

Posted by GitBox <gi...@apache.org>.
boring-cyborg[bot] commented on issue #16909:
URL: https://github.com/apache/airflow/issues/16909#issuecomment-877112778


   Thanks for opening your first issue here! Be sure to follow the issue template!
   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] jpatel-fpmx commented on issue #16909: Unable to connect to Kubernetes cluster from Airflow

Posted by GitBox <gi...@apache.org>.
jpatel-fpmx commented on issue #16909:
URL: https://github.com/apache/airflow/issues/16909#issuecomment-878168802


   Thanks @potiuk for your suggestion.
   
   I have tried by creating a service account with cluster edit permission but still, the SparkApplications pod is not getting spin up.
   
   As per your suggestion, I have open a 'GitHub Discussion' (https://github.com/apache/airflow/discussions/16940) with complete details. So requesting you to have a look and suggest me to get rid of this issue. I am stuck due to this.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] potiuk commented on issue #16909: Unable to connect to Kubernetes cluster from Airflow

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #16909:
URL: https://github.com/apache/airflow/issues/16909#issuecomment-878369525


   I am not sure I can help (not my area). But possibly someone who looks at it will.


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] potiuk commented on issue #16909: Unable to connect to Kubernetes cluster from Airflow

Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #16909:
URL: https://github.com/apache/airflow/issues/16909#issuecomment-877606651


   If you want to discuss and get some help it's  better to open a 'GitHub Discussion' or discuss it on slack, rather than opening an issue 


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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



[GitHub] [airflow] potiuk closed issue #16909: Unable to connect to Kubernetes cluster from Airflow

Posted by GitBox <gi...@apache.org>.
potiuk closed issue #16909:
URL: https://github.com/apache/airflow/issues/16909


   


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

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

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