-
Notifications
You must be signed in to change notification settings - Fork 624
[LIVY-703] Show SparkUI link on Livy UI when running on Kubernetes #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
f06df47
Implement base kubernetes fetures.
jahstreet 6e8d226
Add kubernetes dependency version to pom.xml
jahstreet e392787
Fix scalastyle
jahstreet 176208d
Added SparkKubernetesApp test, minor refactoring
jahstreet 2961663
Minor cleanup
jahstreet dec48b1
Add Kubernetes default namespace config
jahstreet 02aee5b
Update livy.conf.template
jahstreet b521c3e
Minor refactoring
jahstreet 085b7a6
Remove appInfoChanged on finish monitoring app
jahstreet 05cc3a9
Build Spark UI links when running on Kubernetes
jahstreet 4050c0d
Fix appInfoChanged after rebase
jahstreet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,6 +63,12 @@ object LivyConf { | |
| val SERVER_BASE_PATH = Entry("livy.ui.basePath", "") | ||
|
|
||
| val UI_ENABLED = Entry("livy.ui.enabled", true) | ||
| // Wether to display on Livy UI links to Spark UI when running on Kubernetes | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: "Whether' |
||
| val UI_KUBERNETES_SPARK_UI_ENABLED = Entry("livy.ui.kubernetes.sparkui.enabled", false) | ||
| // String format to use to build links to Spark UI to be displayed on Livy UI when running on | ||
| // Kubernetes. Use '%s' placeholder for the link url part to be replaced by Spark application ID | ||
| val UI_KUBERNETES_SPARK_UI_LINK_FORMAT = | ||
| Entry("livy.ui.kubernetes.sparkui.link-format", "http://localhost/%s") | ||
|
|
||
| val REQUEST_HEADER_SIZE = Entry("livy.server.request-header.size", 131072) | ||
| val RESPONSE_HEADER_SIZE = Entry("livy.server.response-header.size", 131072) | ||
|
|
@@ -220,6 +226,35 @@ object LivyConf { | |
| // how often to check livy session leakage | ||
| val YARN_APP_LEAKAGE_CHECK_INTERVAL = Entry("livy.server.yarn.app-leakage.check-interval", "60s") | ||
|
|
||
| // Kubernetes oauth token file path. | ||
| val KUBERNETES_OAUTH_TOKEN_FILE = Entry("livy.server.kubernetes.oauthTokenFile", "") | ||
| // Kubernetes oauth token string value. | ||
| val KUBERNETES_OAUTH_TOKEN_VALUE = Entry("livy.server.kubernetes.oauthTokenValue", "") | ||
| // Kubernetes CA cert file path. | ||
| val KUBERNETES_CA_CERT_FILE = Entry("livy.server.kubernetes.caCertFile", "") | ||
| // Kubernetes client key file path. | ||
| val KUBERNETES_CLIENT_KEY_FILE = Entry("livy.server.kubernetes.clientKeyFile", "") | ||
| // Kubernetes client cert file path. | ||
| val KUBERNETES_CLIENT_CERT_FILE = Entry("livy.server.kubernetes.clientCertFile", "") | ||
| // Kubernetes client default namespace. | ||
| val KUBERNETES_DEFAULT_NAMESPACE = Entry("livy.server.kubernetes.defaultNamespace", "") | ||
|
|
||
| // Comma-separated list of the Kubernetes namespaces to allow for applications creation. | ||
| // All namespaces are allowed if empty. | ||
| val KUBERNETES_ALLOWED_NAMESPACES = Entry("livy.server.kubernetes.allowedNamespaces", null) | ||
|
|
||
| // If Livy can't find the Kubernetes app within this time, consider it lost. | ||
| val KUBERNETES_APP_LOOKUP_TIMEOUT = Entry("livy.server.kubernetes.app-lookup-timeout", "600s") | ||
| // How often Livy polls Kubernetes to refresh Kubernetes app state. | ||
| val KUBERNETES_POLL_INTERVAL = Entry("livy.server.kubernetes.poll-interval", "15s") | ||
|
|
||
| // How long to check livy session leakage. | ||
| val KUBERNETES_APP_LEAKAGE_CHECK_TIMEOUT = | ||
| Entry("livy.server.kubernetes.app-leakage.check-timeout", "600s") | ||
| // How often to check livy session leakage. | ||
| val KUBERNETES_APP_LEAKAGE_CHECK_INTERVAL = | ||
| Entry("livy.server.kubernetes.app-leakage.check-interval", "60s") | ||
|
|
||
| // Whether session timeout should be checked, by default it will be checked, which means inactive | ||
| // session will be stopped after "livy.server.session.timeout" | ||
| val SESSION_TIMEOUT_CHECK = Entry("livy.server.session.timeout-check", true) | ||
|
|
@@ -331,6 +366,15 @@ class LivyConf(loadDefaults: Boolean) extends ClientConf[LivyConf](null) { | |
| /** Return true if spark master starts with yarn. */ | ||
| def isRunningOnYarn(): Boolean = sparkMaster().startsWith("yarn") | ||
|
|
||
| /** Return true if spark master starts with k8s. */ | ||
| def isRunningOnKubernetes(): Boolean = sparkMaster().startsWith("k8s") | ||
|
|
||
| /** Return Kubernetes namespace or all if not set. */ | ||
| def getKubernetesNamespaces(): Set[String] = | ||
| Option(get(KUBERNETES_ALLOWED_NAMESPACES)).filterNot(_.isEmpty) | ||
| .map(_.split(",").toSet) | ||
| .getOrElse(Set.empty) | ||
|
|
||
| /** Return the spark deploy mode Livy sessions should use. */ | ||
| def sparkDeployMode(): Option[String] = Option(get(LIVY_SPARK_DEPLOY_MODE)).filterNot(_.isEmpty) | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: "Whether'