Skip to content

Commit 5838cc7

Browse files
authored
Merge pull request #1667 from eclipse-ditto/bugfix/helm-chart-nginx-workers
#1663 fix that nginx's worker_processes setting 'auto' causes problems
2 parents 2157ca5 + 0b0f1f8 commit 5838cc7

File tree

6 files changed

+86
-5
lines changed

6 files changed

+86
-5
lines changed

deployment/helm/ditto/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ description: |
1616
A digital twin is a virtual, cloud based, representation of his real world counterpart
1717
(real world “Things”, e.g. devices like sensors, smart heating, connected cars, smart grids, EV charging stations etc).
1818
type: application
19-
version: 3.3.0 # chart version is effectively set by release-job
19+
version: 3.3.1 # chart version is effectively set by release-job
2020
appVersion: 3.3.0
2121
keywords:
2222
- iot-chart
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
worker_processes 1;
2+
3+
error_log /var/log/nginx/error.log notice;
4+
pid /tmp/nginx.pid;
5+
6+
events {
7+
worker_connections 1024;
8+
}
9+
10+
http {
11+
proxy_temp_path /tmp/proxy_temp;
12+
client_body_temp_path /tmp/client_temp;
13+
fastcgi_temp_path /tmp/fastcgi_temp;
14+
uwsgi_temp_path /tmp/uwsgi_temp;
15+
scgi_temp_path /tmp/scgi_temp;
16+
17+
include /etc/nginx/mime.types;
18+
default_type application/octet-stream;
19+
20+
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
21+
'$status $body_bytes_sent "$http_referer" '
22+
'"$http_user_agent" "$http_x_forwarded_for"';
23+
24+
access_log /var/log/nginx/access.log main;
25+
26+
server_tokens off; # Hide Nginx version
27+
28+
sendfile on;
29+
#tcp_nopush on;
30+
31+
keepalive_timeout 65;
32+
33+
#gzip on;
34+
35+
include /etc/nginx/conf.d/*.conf;
36+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2023 Contributors to the Eclipse Foundation
2+
#
3+
# See the NOTICE file(s) distributed with this work for additional
4+
# information regarding copyright ownership.
5+
#
6+
# This program and the accompanying materials are made available under the
7+
# terms of the Eclipse Public License 2.0 which is available at
8+
# http://www.eclipse.org/legal/epl-2.0
9+
#
10+
# SPDX-License-Identifier: EPL-2.0
11+
{{- if .Values.dittoui.enabled -}}
12+
{{- $releaseName := .Release.Name -}}
13+
{{- $name := include "ditto.name" . -}}
14+
{{- $labels := include "ditto.labels" . -}}
15+
{{ $root := . }}
16+
{{ range $path, $bytes := .Files.Glob "dittoui-config/**" }}
17+
---
18+
apiVersion: v1
19+
kind: ConfigMap
20+
metadata:
21+
name: {{ $releaseName }}-{{ $path | replace "/" "-" | replace "." "-" }}
22+
labels:
23+
app.kubernetes.io/name: {{ $name }}-dittoui-config
24+
{{ $labels | indent 4 }}
25+
data:
26+
{{ $path | replace "dittoui-config/" ""}}: |-
27+
{{ $root.Files.Get $path | indent 4 }}
28+
---
29+
{{- end -}}
30+
{{- end -}}

deployment/helm/ditto/templates/dittoui-deployment.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,4 +63,12 @@ spec:
6363
limits:
6464
# cpu: ""
6565
memory: {{ .Values.dittoui.resources.memoryMi }}Mi
66+
volumeMounts:
67+
- name: dittoui-nginx-conf
68+
mountPath: /etc/nginx/nginx.conf
69+
subPath: nginx.conf
70+
volumes:
71+
- name: dittoui-nginx-conf
72+
configMap:
73+
name: {{ .Release.Name }}-dittoui-config-nginx-conf
6674
{{- end }}

deployment/helm/ditto/templates/nginx-configmap.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ metadata:
1919
{{ include "ditto.labels" . | indent 4 }}
2020
data:
2121
nginx.conf: |-
22-
worker_processes auto;
22+
worker_processes {{ .Values.nginx.config.workerProcesses }};
2323
2424
events {
25-
worker_connections 1024;
25+
worker_connections {{ .Values.nginx.config.workerConnections }};
2626
}
2727
2828
http {

deployment/helm/ditto/values.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ nginx:
13861386
# repository for the nginx docker image
13871387
repository: docker.io/nginx
13881388
# tag for the nginx docker image
1389-
tag: 1.23
1389+
tag: 1.25
13901390
# pullPolicy for the nginx docker image
13911391
pullPolicy: IfNotPresent
13921392
# extraEnv to add arbitrary environment variables to nginx container
@@ -1429,6 +1429,13 @@ nginx:
14291429
enabled: true
14301430
name: wait-for-gateway
14311431
image: rancher/curlimages-curl:7.73.0
1432+
# config holds nginx specific configuration
1433+
config:
1434+
# workerProcesses the 'worker_processes' option for nginx to use - can also be set to 'auto' in order to let nginx
1435+
# determine the worker processes based on the CPU count
1436+
workerProcesses: 4
1437+
# workerProcesses the 'events' 'worker_connections' option for nginx to use
1438+
workerConnections: 1024
14321439

14331440
## ----------------------------------------------------------------------------
14341441
## Ditto UI configuration
@@ -1497,7 +1504,7 @@ swaggerui:
14971504
# repository for the swagger ui docker image
14981505
repository: docker.io/swaggerapi/swagger-ui
14991506
# tag for the swagger ui docker image
1500-
tag: v4.15.5
1507+
tag: v4.19.1
15011508
# pullPolicy for the swagger ui docker image
15021509
pullPolicy: IfNotPresent
15031510
# extraEnv to add arbitrary environment variable to swagger ui container

0 commit comments

Comments
 (0)