Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion core/invoker/src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ whisk {
key: "openwhisk-role"
value: "invoker"
}

# Enables forwarding to remote port via a local random port. This mode is mostly useful
# for development via Standalone mode
port-forwarding-enabled = false
Expand All @@ -87,6 +86,12 @@ whisk {
# 2. OR yaml formatted multi line string. See multi line config support https://github.com/lightbend/config/blob/master/HOCON.md#multi-line-strings
#
#pod-template =

# Set this optional string to be the namespace that the invoker should target for adding pods. This allows the invoker to run in a namesapce it doesn't have API access to but add pods to another namespace. See also https://github.com/apache/openwhisk/issues/4711
# When not set the underlying client may pickup the namesapce from the kubeconfig or via system property setting.
# See https://github.com/fabric8io/kubernetes-client#configuring-the-client for more information.
# action-namespace = "ns-actions"

}

# Timeouts for runc commands. Set to "Inf" to disable timeout.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ case class KubernetesClientConfig(timeouts: KubernetesClientTimeoutConfig,
invokerAgent: KubernetesInvokerAgentConfig,
userPodNodeAffinity: KubernetesInvokerNodeAffinity,
portForwardingEnabled: Boolean,
actionNamespace: Option[String] = None,
podTemplate: Option[ConfigMapValue] = None)

/**
Expand All @@ -93,11 +94,13 @@ class KubernetesClient(
with ProcessRunner {
implicit protected val ec = executionContext
implicit protected val am = ActorMaterializer()
implicit protected val kubeRestClient = new DefaultKubernetesClient(
new ConfigBuilder()
implicit protected val kubeRestClient = {
val configBuilder = new ConfigBuilder()
.withConnectionTimeout(config.timeouts.logs.toMillis.toInt)
.withRequestTimeout(config.timeouts.logs.toMillis.toInt)
.build())
config.actionNamespace.foreach(configBuilder.withNamespace)
new DefaultKubernetesClient(configBuilder.build())
}

private val podBuilder = new WhiskPodBuilder(kubeRestClient, config.userPodNodeAffinity, config.podTemplate)

Expand Down