This is an automated email from the ASF dual-hosted git repository.
daisyguo pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/incubator-openwhisk-deploy-kube.git
The following commit(s) were added to refs/heads/master by this push:
new 0b6a367 Improve support for configuration of action container DNS
(#370)
0b6a367 is described below
commit 0b6a3676927ac33a42edfb722ba02e5e49501e77
Author: David Grove <[email protected]>
AuthorDate: Wed Nov 28 00:22:19 2018 -0500
Improve support for configuration of action container DNS (#370)
Use go template loops to allow specification of a colon
separated list of DNS servers for user action containers.
Also align the name/placement of the action networking
fields in values.yaml to better match PureConfig tree structure.
Fixes #160.
---
docs/configurationChoices.md | 5 +++--
helm/openwhisk/templates/invoker-pod.yaml | 17 ++++++++++-------
helm/openwhisk/values.yaml | 5 +++--
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/docs/configurationChoices.md b/docs/configurationChoices.md
index 61d1436..54b68d2 100644
--- a/docs/configurationChoices.md
+++ b/docs/configurationChoices.md
@@ -55,13 +55,14 @@ providers:
username: "admin"
password: "secret"
```
-2. Configure the DNS lookup for the user containers created by
DockerContainerFactory to
+2. Configure the DNS nameservers for the user containers created by
DockerContainerFactory to
use Kubernetes's DNS service. For example, if your cluster uses kube-dns,
then first
get the IP address of Kubernetes DNS server by `echo $(kubectl get svc
kube-dns -n kube-system -o 'jsonpath={.spec.clusterIP}')`
and then add below stanza to your `mycluster.yaml`:
```yaml
invoker:
- kubeDNS: "<IP_Address_Of_Kube_DNS>"
+ containerFactory:
+ nameservers: "<IP_Address_Of_Kube_DNS>"
```
3. Use the lower performance `KubernetesContainerFactory` by adding the
following stanza
to your `mycluster.yaml`
diff --git a/helm/openwhisk/templates/invoker-pod.yaml
b/helm/openwhisk/templates/invoker-pod.yaml
index 836427f..61c4768 100644
--- a/helm/openwhisk/templates/invoker-pod.yaml
+++ b/helm/openwhisk/templates/invoker-pod.yaml
@@ -79,19 +79,22 @@ spec:
configMapKeyRef:
name: whisk.config
key: whisk_api_host_name
- - name: "INVOKER_CONTAINER_NETWORK"
- value: {{ .Values.invoker.containerNetwork | quote }}
+
- name: "CONFIG_whisk_docker_containerFactory_useRunc"
value: {{ .Values.invoker.containerFactory.useRunc | quote }}
- name: "CONFIG_whisk_containerPool_userMemory"
value: {{ .Values.whisk.containerPool.userMemory | quote }}
- # DNS Server passed to action containers
-{{- if not (eq .Values.invoker.kubeDNS "nil") }}
- - name: "CONFIG_whisk_containerFactory_containerArgs_dnsServers_0"
- value: {{ .Values.invoker.kubeDNS }}
-{{ end }}
+{{- if ne .Values.invoker.containerFactory.nameservers "" }}
+ # DNS Server(s) to be used by action containers
+ {{- range $index, $element := splitList ":"
.Values.invoker.containerFactory.nameservers }}
+ - name: "CONFIG_whisk_containerFactory_containerArgs_dnsServers_{{
$index }}"
+ value: {{ $element | quote }}
+ {{- end }}
+{{- end }}
+ - name: "CONFIG_whisk_docker_containerFactory_containerArgs_network"
+ value: {{ .Values.invoker.containerFactory.containerNetwork |
quote }}
# Invoker name is the name of the node (DaemonSet) or pod
(StatefulSet)
- name: "INVOKER_NAME"
diff --git a/helm/openwhisk/values.yaml b/helm/openwhisk/values.yaml
index 9bba833..d19c8f8 100644
--- a/helm/openwhisk/values.yaml
+++ b/helm/openwhisk/values.yaml
@@ -207,8 +207,9 @@ invoker:
imagePullPolicy: "IfNotPresent"
enabled: false
port: 3233
- containerNetwork: "bridge"
- kubeDNS: nil
+ containerNetwork: "bridge"
+ # nameservers is an empty string or a colon separated list of IP addresses
of DNS servers.
+ nameservers: ""
# API Gateway configurations
apigw: