[Improvement] Launching k8s engine pods with respective users
- Dominant language
- Scala
- Stars
- 2.4k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
### Search before asking
- [X] I have searched in the [issues](https://github.com/apache/kyuubi/issues?q=is%3Aissue) and found no similar issues.
### What would you like to be improved?
Spark submit
Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https:///api/v1/namespaces/genai/pods. Message: Forbidden! User doesn't have permission. pods is forbidden: User "madlnu" cannot create resource "pods" in API group "" in the namespace "genai".
Kyuubi engine launch in share level USER
Caused by: io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https:///api/v1/namespaces/genai/pods. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. pods is forbidden: User "system:serviceaccount:scaas:spark" cannot create resource "pods" in API group "" in the namespace "genai".
**When an USER engine is launched in k8s cluster, it is taking the user with which kyuubi server is running rather than actual users.**
Configurations:
kyuubi.authentication=KERBEROS
kyuubi.spnego.keytab=spnego.keytab
kyuubi.spnego.principal=spnego@DOMAIN.COM
kyuubi.kinit.principal=hive@DOMAIN.COM
kyuubi.kinit.keytab=hive.keytab
spark.kubernetes.namespace=genai
kyuubi.kubernetes.master.address=k8s://https://
spark.master=k8s://https://
kyuubi.kubernetes.namespace=scaas
spark.submit.deployMode=cluster
spark.kubernetes.authenticate.serviceAccountName=spark
spark.kubernetes.authenticate.driver.serviceAccountName=spark
### How should we improve?
Expectation is user authentication should happen, while launching the engine pods.
### Are you willing to submit PR?
- [X] Yes. I would be willing to submit a PR with guidance from the Kyuubi community to improve.
- [ ] No. I cannot submit a PR at this time.
Contributor guide
Research direction
Start by tracing the Kyuubi USER engine launch path and Spark submit configuration for Kubernetes, using the reported Forbidden errors as the reproduction case. Review how Kerberos authentication and Kubernetes service accounts are selected. Done means USER engines launch pods using the actual user's authentication rather than the Kyuubi server user or configured service account.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes, scala, spark
- Domain
- authentication, cloud, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 28/100