Skip to content

Commit a2ad376

Browse files
committed
Add some missing configuration
- nginx worker processes - containerPool akkaClient - controller and invoker use its own Couchdb username and password
1 parent 59285fe commit a2ad376

File tree

8 files changed

+70
-15
lines changed

8 files changed

+70
-15
lines changed

helm/openwhisk/configMapFiles/initCouchDB/initdb.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ pushd /openwhisk/ansible
7070
-e db_host=$DB_HOST \
7171
-e db_username=$COUCHDB_USER \
7272
-e db_password=$COUCHDB_PASSWORD \
73+
-e db_controller_user=$COUCHDB_CONTROLLER_USER \
74+
-e db_controller_pass=$COUCHDB_CONTROLLER_PASSWORD \
75+
-e db_invoker_user=$COUCHDB_INVOKER_USER \
76+
-e db_invoker_pass=$COUCHDB_INVOKER_PASSWORD \
7377
-e db_port=$DB_PORT \
7478
-e openwhisk_home=/openwhisk
7579

@@ -79,6 +83,10 @@ pushd /openwhisk/ansible
7983
-e db_host=$DB_HOST \
8084
-e db_username=$COUCHDB_USER \
8185
-e db_password=$COUCHDB_PASSWORD \
86+
-e db_controller_user=$COUCHDB_CONTROLLER_USER \
87+
-e db_controller_pass=$COUCHDB_CONTROLLER_PASSWORD \
88+
-e db_invoker_user=$COUCHDB_INVOKER_USER \
89+
-e db_invoker_pass=$COUCHDB_INVOKER_PASSWORD \
8290
-e db_port=$DB_PORT \
8391
-e openwhisk_home=/openwhisk
8492
popd

helm/openwhisk/templates/_helpers.tpl

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ app: {{ template "openwhisk.fullname" . }}
5252
{{- end -}}
5353

5454
{{- define "openwhisk.db_authentication" -}}
55-
{{ .Values.db.auth.username }}:{{ .Values.db.auth.password }}
55+
{{ .Values.db.auth.admin.username }}:{{ .Values.db.auth.admin.password }}
5656
{{- end -}}
5757

5858
{{- define "openwhisk.elasticsearch_authentication" -}}
@@ -114,16 +114,6 @@ app: {{ template "openwhisk.fullname" . }}
114114

115115
{{/* Environment variables required for accessing CouchDB from a pod */}}
116116
{{- define "openwhisk.dbEnvVars" -}}
117-
- name: "CONFIG_whisk_couchdb_username"
118-
valueFrom:
119-
secretKeyRef:
120-
name: {{ .Release.Name }}-db.auth
121-
key: db_username
122-
- name: "CONFIG_whisk_couchdb_password"
123-
valueFrom:
124-
secretKeyRef:
125-
name: {{ .Release.Name }}-db.auth
126-
key: db_password
127117
- name: "CONFIG_whisk_couchdb_port"
128118
valueFrom:
129119
configMapKeyRef:

helm/openwhisk/templates/controller-pod.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,16 @@ spec:
151151
value: "{{ include "openwhisk.kafka_connect" . }}"
152152
{{ include "openwhisk.kafkaConfigEnvVars" . | indent 8 }}
153153

154+
- name: "CONFIG_whisk_couchdb_username"
155+
valueFrom:
156+
secretKeyRef:
157+
name: {{ .Release.Name }}-db.auth
158+
key: db_controller_username
159+
- name: "CONFIG_whisk_couchdb_password"
160+
valueFrom:
161+
secretKeyRef:
162+
name: {{ .Release.Name }}-db.auth
163+
key: db_controller_password
154164
# properties for DB connection
155165
{{ include "openwhisk.dbEnvVars" . | indent 8 }}
156166

helm/openwhisk/templates/couchdb-init-job.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ spec:
8383
secretKeyRef:
8484
name: {{ .Release.Name }}-db.auth
8585
key: db_password
86+
- name: "COUCHDB_CONTROLLER_USER"
87+
valueFrom:
88+
secretKeyRef:
89+
name: {{ .Release.Name }}-db.auth
90+
key: db_controller_username
91+
- name: "COUCHDB_CONTROLLER_PASSWORD"
92+
valueFrom:
93+
secretKeyRef:
94+
name: {{ .Release.Name }}-db.auth
95+
key: db_controller_password
96+
- name: "COUCHDB_INVOKER_USER"
97+
valueFrom:
98+
secretKeyRef:
99+
name: {{ .Release.Name }}-db.auth
100+
key: db_invoker_username
101+
- name: "COUCHDB_INVOKER_PASSWORD"
102+
valueFrom:
103+
secretKeyRef:
104+
name: {{ .Release.Name }}-db.auth
105+
key: db_invoker_password
86106
- name: "NODENAME"
87107
value: "couchdb0"
88108

helm/openwhisk/templates/invoker-pod.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,26 @@ spec:
155155
- name: "WHISK_LOGS_DIR"
156156
value: ""
157157

158+
- name: "CONFIG_whisk_containerPool_akkaClient"
159+
value: "{{ .Values.whisk.containerPool.akkaClient }}"
160+
158161
# this version is the day it is deployed,
159162
- name: "CONFIG_whisk_info_date"
160163
valueFrom:
161164
configMapKeyRef:
162165
name: {{ .Release.Name }}-whisk.config
163166
key: whisk_info_date
164167

168+
- name: "CONFIG_whisk_couchdb_username"
169+
valueFrom:
170+
secretKeyRef:
171+
name: {{ .Release.Name }}-db.auth
172+
key: db_invoker_username
173+
- name: "CONFIG_whisk_couchdb_password"
174+
valueFrom:
175+
secretKeyRef:
176+
name: {{ .Release.Name }}-db.auth
177+
key: db_invoker_password
165178
# properties for DB connection
166179
{{ include "openwhisk.dbEnvVars" . | indent 10 }}
167180

helm/openwhisk/templates/nginx-cm.yaml

Lines changed: 1 addition & 0 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 {

helm/openwhisk/templates/ow-db-secret.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,9 @@ metadata:
2323
{{ include "openwhisk.label_boilerplate" . | indent 4 }}
2424
type: Opaque
2525
data:
26-
db_username: {{ .Values.db.auth.username | b64enc }}
27-
db_password: {{ .Values.db.auth.password | b64enc }}
26+
db_username: {{ .Values.db.auth.admin.username | b64enc }}
27+
db_password: {{ .Values.db.auth.admin.password | b64enc }}
28+
db_controller_username: {{ .Values.db.auth.controller.username | b64enc }}
29+
db_controller_password: {{ .Values.db.auth.controller.password | b64enc }}
30+
db_invoker_username: {{ .Values.db.auth.invoker.username | b64enc }}
31+
db_invoker_password: {{ .Values.db.auth.invoker.password | b64enc }}

helm/openwhisk/values.yaml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ whisk:
123123
retentionMs: ""
124124
containerPool:
125125
userMemory: "2048m"
126+
akkaClient: false
126127
runtimes: "runtimes.json"
127128
testing:
128129
includeTests: true
@@ -220,8 +221,15 @@ db:
220221
protocol: "http"
221222
# Production deployments _MUST_ override the default user/password values
222223
auth:
223-
username: "whisk_admin"
224-
password: "some_passw0rd"
224+
admin:
225+
username: "test_admin"
226+
password: "some_passw0rd"
227+
controller:
228+
username: "test_controller0"
229+
password: "some_controller_passw0rd"
230+
invoker:
231+
username: "test_invoker"
232+
password: "some_invoker_passw0rd"
225233
dbPrefix: "test_"
226234
activationsTable: "test_activations"
227235
actionsTable: "test_whisks"
@@ -239,6 +247,7 @@ nginx:
239247
imagePullPolicy: "IfNotPresent"
240248
replicaCount: 1
241249
restartPolicy: "Always"
250+
workerProcesses: 1
242251
httpPort: 80
243252
httpsPort: 443
244253
httpsNodePort: 31001

0 commit comments

Comments
 (0)