Skip to content

Commit cfcb9c3

Browse files
author
Mike Ludwig
committed
Merge branch 'master' of github.com:apache/openwhisk-deploy-kube
2 parents b4c1e1b + 2b6abd3 commit cfcb9c3

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

docs/okd-311.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ oc adm policy add-scc-to-user anyuid -z default
4141
oc adm policy add-scc-to-user privileged -z default
4242
oc adm policy add-scc-to-user anyuid -z openwhisk-core
4343
oc adm policy add-scc-to-user privileged -z openwhisk-core
44+
oc adm policy add-scc-to-user anyuid -z owdev-init-sa
45+
oc adm policy add-scc-to-user privileged -z owdev-init-sa
4446
```
4547

4648
## Configuring OpenWhisk

helm/openwhisk/templates/controller-pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ spec:
182182
- name: "METRICS_KAMON"
183183
value: "true"
184184
{{ end }}
185-
{{ if or .Values.metrics.kamonTags .Values.metrics.prometheusEnabled }}
185+
{{ if .Values.metrics.kamonTags }}
186186
- name: "METRICS_KAMON_TAGS"
187187
value: "true"
188188
{{ end }}

helm/openwhisk/templates/invoker-pod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ spec:
191191
- name: "METRICS_KAMON"
192192
value: "true"
193193
{{ end }}
194-
{{ if and .Values.metrics.kamonTags .Values.metrics.prometheusEnabled }}
194+
{{ if .Values.metrics.kamonTags }}
195195
- name: "METRICS_KAMON_TAGS"
196196
value: "true"
197197
{{ end }}

helm/openwhisk/templates/nginx-cm.yaml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ metadata:
2424
{{ include "openwhisk.label_boilerplate" . | indent 4 }}
2525
data:
2626
nginx.conf: |
27+
worker_processes {{ .Values.nginx.workerProcesses }};
2728
worker_rlimit_nofile 4096;
2829
2930
events {
@@ -45,6 +46,17 @@ data:
4546
proxy_http_version 1.1;
4647
proxy_set_header Connection "";
4748
49+
upstream controllers {
50+
# Mark the controller as unavailable after fail_timeout seconds, to not get any requests during restart.
51+
# Otherwise, nginx would dispatch requests when the container is up, but the backend in the container not.
52+
# From the docs:
53+
# "normally, requests with a non-idempotent method (POST, LOCK, PATCH) are not passed to
54+
# the next server if a request has been sent to an upstream server"
55+
server {{ include "openwhisk.controller_host" . }}:{{ .Values.controller.port }} fail_timeout=60s;
56+
57+
keepalive 512;
58+
}
59+
4860
server {
4961
listen 80;
5062
listen 443 default ssl;
@@ -72,7 +84,6 @@ data:
7284
7385
# Hack to convince nginx to dynamically resolve the dns entries.
7486
resolver {{ .Values.k8s.dns }};
75-
set $controllers {{ include "openwhisk.controller_host" . }};
7687
{{- if or (eq .Values.whisk.ingress.type "NodePort") (eq .Values.whisk.ingress.type "LoadBalancer") }}
7788
set $apigw {{ include "openwhisk.apigw_host" . }};
7889
{{ if or .Values.metrics.prometheusEnabled .Values.metrics.userMetricsEnabled }}
@@ -85,12 +96,12 @@ data:
8596
if ($namespace) {
8697
rewrite /(.*) /api/v1/web/${namespace}/$1 break;
8798
}
88-
proxy_pass http://$controllers:{{ .Values.controller.port }};
99+
proxy_pass http://controllers;
89100
proxy_read_timeout 75s; # 70+5 additional seconds to allow controller to terminate request
90101
}
91102

92103
location /api/v1 {
93-
proxy_pass http://$controllers:{{ .Values.controller.port }};
104+
proxy_pass http://controllers;
94105
proxy_read_timeout 75s; # 70+5 additional seconds to allow controller to terminate request
95106
}
96107

@@ -116,7 +127,7 @@ data:
116127
if ($namespace) {
117128
rewrite /(.*) /api/v1/web/${namespace}/$1 break;
118129
}
119-
proxy_pass http://$controllers:{{ .Values.controller.port }};
130+
proxy_pass http://controllers;
120131
proxy_read_timeout 75s; # 70+5 additional seconds to allow controller to terminate request
121132
}
122133

helm/openwhisk/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ nginx:
242242
httpPort: 80
243243
httpsPort: 443
244244
httpsNodePort: 31001
245+
workerProcesses: "auto"
245246
certificate:
246247
external: false
247248
cert_file: ""

0 commit comments

Comments
 (0)