Skip to content

Conversation

@shrprasa
Copy link
Contributor

What changes were proposed in this pull request?

The PR fixes the authentication failure of the proxy user on driver side while accessing kerberized hdfs through spark on k8s job. It follows the similar approach as it was done for Mesos: d2iq-archive#26

Why are the changes needed?

When we try to access the kerberized HDFS through a proxy user in Spark Job running in cluster deploy mode with Kubernetes resource manager, we encounter AccessControlException. This is because authentication in driver is done using tokens of the proxy user and since proxy user doesn't have any delegation tokens on driver, auth fails.

Further details:
https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532063&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532063

https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532135&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532135

Does this PR introduce any user-facing change?

Yes, user will now be able to use proxy-user to access kerberized hdfs with Spark on K8s.

How was this patch tested?

The patch was tested by:

  1. Running job which accesses kerberized hdfs with proxy user in cluster mode and client mode with kubernetes resource manager.

  2. Running job which accesses kerberized hdfs without proxy user in cluster mode and client mode with kubernetes resource manager.

  3. Build and run test github action : https://github.com/shrprasa/spark/actions/runs/3051203625

@github-actions github-actions bot added the CORE label Sep 14, 2022
@AmplabJenkins
Copy link

Can one of the admins verify this patch?

@pan3793
Copy link
Member

pan3793 commented Sep 29, 2022

ping @yaooqinn

@mridulm
Copy link
Contributor

mridulm commented Sep 29, 2022

+CC @squito, @HyukjinKwon

@mridulm
Copy link
Contributor

mridulm commented Feb 17, 2023

+CC @Ngone51 , @HyukjinKwon

@shrprasa
Copy link
Contributor Author

ping @holdenk

@shrprasa
Copy link
Contributor Author

shrprasa commented Mar 3, 2023

Gentle ping @holdenk @dongjoon-hyun @Ngone51 , @HyukjinKwon

1 similar comment
@shrprasa
Copy link
Contributor Author

shrprasa commented Mar 7, 2023

Gentle ping @holdenk @dongjoon-hyun @Ngone51 , @HyukjinKwon

Copy link
Contributor

@holdenk holdenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shrprasa
Copy link
Contributor Author

shrprasa commented Mar 7, 2023

@holdenk Thanks for approving the PR. Can you please merge this PR or tag someone who can do it?

@yaooqinn yaooqinn closed this in b3b3557 Mar 8, 2023
yaooqinn pushed a commit that referenced this pull request Mar 8, 2023
…8s in cluster deploy mode

### What changes were proposed in this pull request?

The PR fixes the authentication failure of the proxy user on driver side while accessing kerberized hdfs through spark on k8s job. It follows the similar approach as it was done for Mesos: d2iq-archive#26

 ### Why are the changes needed?

When we try to access the kerberized HDFS through a proxy user in Spark Job running in cluster deploy mode with Kubernetes resource manager, we encounter AccessControlException. This is because  authentication in driver is done using tokens of the proxy user and since proxy user doesn't have any delegation tokens on driver, auth fails.

Further details:
https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532063&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532063

 https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532135&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532135

 ### Does this PR introduce _any_ user-facing change?

Yes, user will now be able to use proxy-user to access kerberized hdfs with Spark on K8s.

### How was this patch tested?

The patch was tested by:

1. Running job which accesses kerberized hdfs with proxy user in cluster mode and client mode with kubernetes resource manager.

2. Running job which accesses kerberized hdfs without proxy user in cluster mode and client mode with kubernetes resource manager.

3. Build and run test github action : https://github.com/shrprasa/spark/actions/runs/3051203625

Closes #37880 from shrprasa/proxy_user_fix.

Authored-by: Shrikant Prasad <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
(cherry picked from commit b3b3557)
Signed-off-by: Kent Yao <[email protected]>
yaooqinn pushed a commit that referenced this pull request Mar 8, 2023
…8s in cluster deploy mode

### What changes were proposed in this pull request?

The PR fixes the authentication failure of the proxy user on driver side while accessing kerberized hdfs through spark on k8s job. It follows the similar approach as it was done for Mesos: d2iq-archive#26

 ### Why are the changes needed?

When we try to access the kerberized HDFS through a proxy user in Spark Job running in cluster deploy mode with Kubernetes resource manager, we encounter AccessControlException. This is because  authentication in driver is done using tokens of the proxy user and since proxy user doesn't have any delegation tokens on driver, auth fails.

Further details:
https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532063&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532063

 https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532135&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532135

 ### Does this PR introduce _any_ user-facing change?

Yes, user will now be able to use proxy-user to access kerberized hdfs with Spark on K8s.

### How was this patch tested?

The patch was tested by:

1. Running job which accesses kerberized hdfs with proxy user in cluster mode and client mode with kubernetes resource manager.

2. Running job which accesses kerberized hdfs without proxy user in cluster mode and client mode with kubernetes resource manager.

3. Build and run test github action : https://github.com/shrprasa/spark/actions/runs/3051203625

Closes #37880 from shrprasa/proxy_user_fix.

Authored-by: Shrikant Prasad <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
(cherry picked from commit b3b3557)
Signed-off-by: Kent Yao <[email protected]>
yaooqinn pushed a commit that referenced this pull request Mar 8, 2023
…8s in cluster deploy mode

### What changes were proposed in this pull request?

The PR fixes the authentication failure of the proxy user on driver side while accessing kerberized hdfs through spark on k8s job. It follows the similar approach as it was done for Mesos: d2iq-archive#26

 ### Why are the changes needed?

When we try to access the kerberized HDFS through a proxy user in Spark Job running in cluster deploy mode with Kubernetes resource manager, we encounter AccessControlException. This is because  authentication in driver is done using tokens of the proxy user and since proxy user doesn't have any delegation tokens on driver, auth fails.

Further details:
https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532063&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532063

 https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532135&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532135

 ### Does this PR introduce _any_ user-facing change?

Yes, user will now be able to use proxy-user to access kerberized hdfs with Spark on K8s.

### How was this patch tested?

The patch was tested by:

1. Running job which accesses kerberized hdfs with proxy user in cluster mode and client mode with kubernetes resource manager.

2. Running job which accesses kerberized hdfs without proxy user in cluster mode and client mode with kubernetes resource manager.

3. Build and run test github action : https://github.com/shrprasa/spark/actions/runs/3051203625

Closes #37880 from shrprasa/proxy_user_fix.

Authored-by: Shrikant Prasad <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
(cherry picked from commit b3b3557)
Signed-off-by: Kent Yao <[email protected]>
@yaooqinn
Copy link
Member

yaooqinn commented Mar 8, 2023

thanks @shrprasa @holdenk, merged to master and brand-3.4/3.3/3.2

@shrprasa
Copy link
Contributor Author

shrprasa commented Mar 8, 2023

Thanks @yaooqinn for merging the PR.

@dongjoon-hyun
Copy link
Member

Thank you, @shrprasa and all!

@dongjoon-hyun
Copy link
Member

cc @kazuyukitanimura , too

dongjoon-hyun pushed a commit that referenced this pull request Mar 14, 2023
…void facing NPE in Kubernetes Case

### What changes were proposed in this pull request?

After #37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code.

### Why are the changes needed?

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164
```scala
args.deployMode.equals("client") &&
```

Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

![popo_2023-03-14  17-50-46](https://user-images.githubusercontent.com/52876270/224965310-ba9ec82f-e668-4a06-b6ff-34c3e80ca0b4.jpg)

Closes #40414 from zwangsheng/SPARK-42785.

Authored-by: zwangsheng <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun pushed a commit that referenced this pull request Mar 14, 2023
…void facing NPE in Kubernetes Case

### What changes were proposed in this pull request?

After #37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code.

### Why are the changes needed?

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164
```scala
args.deployMode.equals("client") &&
```

Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

![popo_2023-03-14  17-50-46](https://user-images.githubusercontent.com/52876270/224965310-ba9ec82f-e668-4a06-b6ff-34c3e80ca0b4.jpg)

Closes #40414 from zwangsheng/SPARK-42785.

Authored-by: zwangsheng <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 767253b)
Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun pushed a commit that referenced this pull request Mar 14, 2023
…void facing NPE in Kubernetes Case

### What changes were proposed in this pull request?

After #37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code.

### Why are the changes needed?

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164
```scala
args.deployMode.equals("client") &&
```

Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

![popo_2023-03-14  17-50-46](https://user-images.githubusercontent.com/52876270/224965310-ba9ec82f-e668-4a06-b6ff-34c3e80ca0b4.jpg)

Closes #40414 from zwangsheng/SPARK-42785.

Authored-by: zwangsheng <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 767253b)
Signed-off-by: Dongjoon Hyun <[email protected]>
dongjoon-hyun pushed a commit that referenced this pull request Mar 14, 2023
…void facing NPE in Kubernetes Case

### What changes were proposed in this pull request?

After #37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code.

### Why are the changes needed?

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164
```scala
args.deployMode.equals("client") &&
```

Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

![popo_2023-03-14  17-50-46](https://user-images.githubusercontent.com/52876270/224965310-ba9ec82f-e668-4a06-b6ff-34c3e80ca0b4.jpg)

Closes #40414 from zwangsheng/SPARK-42785.

Authored-by: zwangsheng <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 767253b)
Signed-off-by: Dongjoon Hyun <[email protected]>
sunchao pushed a commit to sunchao/spark that referenced this pull request Jun 2, 2023
…8s in cluster deploy mode

### What changes were proposed in this pull request?

The PR fixes the authentication failure of the proxy user on driver side while accessing kerberized hdfs through spark on k8s job. It follows the similar approach as it was done for Mesos: d2iq-archive#26

 ### Why are the changes needed?

When we try to access the kerberized HDFS through a proxy user in Spark Job running in cluster deploy mode with Kubernetes resource manager, we encounter AccessControlException. This is because  authentication in driver is done using tokens of the proxy user and since proxy user doesn't have any delegation tokens on driver, auth fails.

Further details:
https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532063&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532063

 https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532135&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532135

 ### Does this PR introduce _any_ user-facing change?

Yes, user will now be able to use proxy-user to access kerberized hdfs with Spark on K8s.

### How was this patch tested?

The patch was tested by:

1. Running job which accesses kerberized hdfs with proxy user in cluster mode and client mode with kubernetes resource manager.

2. Running job which accesses kerberized hdfs without proxy user in cluster mode and client mode with kubernetes resource manager.

3. Build and run test github action : https://github.com/shrprasa/spark/actions/runs/3051203625

Closes apache#37880 from shrprasa/proxy_user_fix.

Authored-by: Shrikant Prasad <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
(cherry picked from commit b3b3557)
Signed-off-by: Kent Yao <[email protected]>
sunchao pushed a commit to sunchao/spark that referenced this pull request Jun 2, 2023
…void facing NPE in Kubernetes Case

### What changes were proposed in this pull request?

After apache#37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code.

### Why are the changes needed?

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164
```scala
args.deployMode.equals("client") &&
```

Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

![popo_2023-03-14  17-50-46](https://user-images.githubusercontent.com/52876270/224965310-ba9ec82f-e668-4a06-b6ff-34c3e80ca0b4.jpg)

Closes apache#40414 from zwangsheng/SPARK-42785.

Authored-by: zwangsheng <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 767253b)
Signed-off-by: Dongjoon Hyun <[email protected]>
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Jun 20, 2023
…8s in cluster deploy mode

### What changes were proposed in this pull request?

The PR fixes the authentication failure of the proxy user on driver side while accessing kerberized hdfs through spark on k8s job. It follows the similar approach as it was done for Mesos: d2iq-archive#26

 ### Why are the changes needed?

When we try to access the kerberized HDFS through a proxy user in Spark Job running in cluster deploy mode with Kubernetes resource manager, we encounter AccessControlException. This is because  authentication in driver is done using tokens of the proxy user and since proxy user doesn't have any delegation tokens on driver, auth fails.

Further details:
https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532063&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532063

 https://issues.apache.org/jira/browse/SPARK-25355?focusedCommentId=17532135&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17532135

 ### Does this PR introduce _any_ user-facing change?

Yes, user will now be able to use proxy-user to access kerberized hdfs with Spark on K8s.

### How was this patch tested?

The patch was tested by:

1. Running job which accesses kerberized hdfs with proxy user in cluster mode and client mode with kubernetes resource manager.

2. Running job which accesses kerberized hdfs without proxy user in cluster mode and client mode with kubernetes resource manager.

3. Build and run test github action : https://github.com/shrprasa/spark/actions/runs/3051203625

Closes apache#37880 from shrprasa/proxy_user_fix.

Authored-by: Shrikant Prasad <[email protected]>
Signed-off-by: Kent Yao <[email protected]>
(cherry picked from commit b3b3557)
Signed-off-by: Kent Yao <[email protected]>
snmvaughan pushed a commit to snmvaughan/spark that referenced this pull request Jun 20, 2023
…void facing NPE in Kubernetes Case

### What changes were proposed in this pull request?

After apache#37880 when user spark submit without `--deploy-mode XXX` or `–conf spark.submit.deployMode=XXXX`, may face NPE with this code.

### Why are the changes needed?

https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala#164
```scala
args.deployMode.equals("client") &&
```

Of course, submit without `deployMode` is not allowed and will throw an exception and terminate the application, but we should leave it to the later logic to give the appropriate hint instead of giving a NPE.

### Does this PR introduce _any_ user-facing change?

No

### How was this patch tested?

![popo_2023-03-14  17-50-46](https://user-images.githubusercontent.com/52876270/224965310-ba9ec82f-e668-4a06-b6ff-34c3e80ca0b4.jpg)

Closes apache#40414 from zwangsheng/SPARK-42785.

Authored-by: zwangsheng <[email protected]>
Signed-off-by: Dongjoon Hyun <[email protected]>
(cherry picked from commit 767253b)
Signed-off-by: Dongjoon Hyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants