Skip to content

Commit 02b2570

Browse files
committed
separate services
1 parent 83f4635 commit 02b2570

6 files changed

Lines changed: 73 additions & 33 deletions

File tree

RELEASENOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ https://github.com/wger-project/docker/commit/ec5893553d81445485e5d32f5a6be637a1
1010
* service and target ports changes
1111
* update the current jwt secret
1212
* add resource settings for most containers
13+
* separate service settings
1314

1415
## 0.3.0
1516

charts/wger/README.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,16 @@ For additional configuration of the Groundhog2k's PostgreSQL and Redis charts, p
9595
| `app.django.existingDatabase.existingSecret.dbuserKey` | Key containing the database user | String | `null` |
9696
| `app.django.existingDatabase.existingSecret.dbpwKey` | Key containing the database password | String | `null` |
9797

98+
99+
### Service for the wger app
100+
101+
| Name | Description | Type | Default Value |
102+
|---------------------------|--------------------------------------|------------|---------------|
103+
| `app.service.type` | Sets the http service type | String | `ClusterIP` |
104+
| `app.service.port` | Port for the service | Integer | `80` |
105+
| `app.service.annotations` | Annotations to attach to the service | Dictionary | `{}` |
106+
107+
98108
### Celery
99109

100110
Celery requires persistent volumes.
@@ -110,7 +120,10 @@ Celery requires persistent volumes.
110120
| `celery.syncImages` | sync exercise images | Boolean | `True` |
111121
| `celery.syncVideos` | sync exercise videos | Boolean | `True` |
112122
| `celery.ingredientsFrom` | source for ingredients, possible values `WGER`,`OFF` | String | `WGER` |
113-
| `celery.flower.enabled` | enable flower webinterface for celery | Boolean | `False` |
123+
| `celery.service.type` | Sets the http service type | String | `ClusterIP` |
124+
| `celery.service.port` | Port for the service | Integer | `80` |
125+
| `celery.service.annotations` | Annotations to attach to the service | Dictionary | `{}` |
126+
| `celery.flower.enabled` | enable flower webinterface for celery | Boolean | `False` |
114127
| `celery.flower.secret.name` | Name of the secret | String | `flower` |
115128
| `celery.flower.secret.password` | Password for the webinterface | String | `randAlphaNum 50` |
116129

@@ -120,7 +133,7 @@ Celery requires persistent volumes.
120133
| Name | Description | Type | Default Value |
121134
|--------------------------------|------------------------------------------|---------|-------------------|
122135
| `app.jwt.secret.name` | Name of the secret | String | `jwt` |
123-
| `app.jwt.secret.update` | Update content of the current secret | Boolean | `true` |
136+
| `app.jwt.secret.update` | Update content of the current secret | Boolean | `false` |
124137
| `app.jwt.secret.privateKey` | Private Key for JWT | String | a default key |
125138
| `app.jwt.secret.publicKey` | Public Key for JWT | String | a default key |
126139
| `app.jwt.accessTokenLifetime` | Duration of the access token, in minutes | String | `10` |
@@ -147,6 +160,10 @@ Celery requires persistent volumes.
147160
| `nginx.imagePullPolicy` | [Pull policy](https://kubernetes.io/docs/concepts/containers/images/#image-pull-policy) to use for the image | String | `IfNotPresent` |
148161

149162

163+
## Powersync
164+
165+
166+
150167
## Ingress
151168

152169
| Name | Description | Type | Default Value |
@@ -158,15 +175,6 @@ Celery requires persistent volumes.
158175
| `ingress.annotations` | Annotations to attach to the ingress | Dictionary | `{}` |
159176

160177

161-
## Service
162-
163-
| Name | Description | Type | Default Value |
164-
|-----------------------|--------------------------------------|------------|---------------|
165-
| `service.type` | Sets the http service type, valid values are `NodePort`, `ClusterIP` or `LoadBalancer`. | String | `ClusterIP` |
166-
| `service.port` | Port for the service | Integer | `8000` |
167-
| `service.annotations` | Annotations to attach to the service | Dictionary | `{}` |
168-
169-
170178
## Persistence
171179

172180
| Name | Description | Type | Default Value |

charts/wger/templates/NOTES.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ kubectl -n {{ .Release.Namespace }} logs -f -l app.kubernetes.io/name={{ .Releas
55
kubectl -n {{ .Release.Namespace }} logs -f -l app.kubernetes.io/name={{ .Release.Name }}-app -c wger
66

77
{{- if not .Values.app.django.existingDatabase.enabled }}
8+
89
Get the postgres superuser passwords:
910

1011
kubectl -n {{ .Release.Namespace }} get secret {{ .Release.Name }}-postgres -o jsonpath='{.data.POSTGRES_PASSWORD}' | base64 -d
@@ -13,3 +14,14 @@ Get the postgres user passwords:
1314

1415
kubectl -n {{ .Release.Namespace }} get secret {{ .Release.Name }}-postgres -o jsonpath='{.data.USERDB_PASSWORD}' | base64 -d
1516
{{- end }}
17+
18+
After the first installation you need to generate your own JWT keypair, this is used from the wger companion app
19+
to authenticate for offline synchronisation:
20+
21+
kubectl -n {{ .Release.Namespace }} logs -f -l app.kubernetes.io/name={{ .Release.Name }}-app -c wger ./manage.py generate-jwt-keys
22+
23+
The pair needs to be saved in the `jwt` secret you can add it in your `values.yaml`, but you need to set
24+
25+
.Values.jwt.secret.update: true
26+
27+
for it to update.

charts/wger/templates/ingress.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ spec:
3131
service:
3232
name: {{ .Release.Name }}-http
3333
port:
34-
number: {{ .Values.service.port }}
34+
number: {{ .Values.nginx.service.port }}
3535
{{- end }}

charts/wger/templates/service.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@ metadata:
77
namespace: {{.Release.Namespace}}
88
labels:
99
app.kubernetes.io/name: {{.Release.Name}}-http
10-
{{- with .Values.service.annotations }}
10+
{{- with .Values.nginx.service.annotations }}
1111
annotations:
1212
{{- range $key, $value := . }}
1313
{{ $key }}: {{ $value | quote}}
1414
{{- end }}
1515
{{- end }}
1616
spec:
17-
type: {{ .Values.service.type }}
17+
type: {{ .Values.nginx.service.type }}
1818
ports:
1919
- name: http
2020
protocol: TCP
21-
port: {{ .Values.service.port }}
21+
port: {{ .Values.nginx.service.port }}
2222
targetPort: 80
2323
selector:
2424
app.kubernetes.io/name: {{ .Release.Name }}-nginx
@@ -31,18 +31,18 @@ metadata:
3131
namespace: {{.Release.Namespace}}
3232
labels:
3333
app.kubernetes.io/name: {{.Release.Name}}-app
34-
{{- with .Values.service.annotations }}
34+
{{- with .Values.app.service.annotations }}
3535
annotations:
3636
{{- range $key, $value := . }}
3737
{{ $key }}: {{ $value | quote}}
3838
{{- end }}
3939
{{- end }}
4040
spec:
41-
type: {{ .Values.service.type }}
41+
type: {{ .Values.app.service.type }}
4242
ports:
4343
- name: app
4444
protocol: TCP
45-
port: 8000
45+
port: {{ .Values.app.service.port }}
4646
targetPort: 8000
4747
selector:
4848
app.kubernetes.io/name: {{ .Release.Name }}-app
@@ -55,18 +55,18 @@ metadata:
5555
namespace: {{.Release.Namespace}}
5656
labels:
5757
app.kubernetes.io/name: {{.Release.Name}}-powersync-api
58-
{{- with .Values.service.annotations }}
58+
{{- with .Values.powersync.serviceApi.annotations }}
5959
annotations:
6060
{{- range $key, $value := . }}
6161
{{ $key }}: {{ $value | quote}}
6262
{{- end }}
6363
{{- end }}
6464
spec:
65-
type: {{ .Values.service.type }}
65+
type: {{ .Values.powersync.serviceApi.type }}
6666
ports:
67-
- name: app
67+
- name: api
6868
protocol: TCP
69-
port: 8080
69+
port: {{ .Values.powersync.serviceApi.port }}
7070
targetPort: 8080
7171
selector:
7272
app.kubernetes.io/name: {{ .Release.Name }}-powersync
@@ -79,18 +79,18 @@ metadata:
7979
namespace: {{.Release.Namespace}}
8080
labels:
8181
app.kubernetes.io/name: {{.Release.Name}}-powersync-prometheus
82-
{{- with .Values.service.annotations }}
82+
{{- with .Values.powersync.servicePrometheus.annotations }}
8383
annotations:
8484
{{- range $key, $value := . }}
8585
{{ $key }}: {{ $value | quote}}
8686
{{- end }}
8787
{{- end }}
8888
spec:
89-
type: {{ .Values.service.type }}
89+
type: {{ .Values.powersync.servicePrometheus.type }}
9090
ports:
9191
- name: app
9292
protocol: TCP
93-
port: 9090
93+
port: {{ .Values.powersync.servicePrometheus.port }}
9494
targetPort: 9090
9595
selector:
9696
app.kubernetes.io/name: {{ .Release.Name }}-powersync

charts/wger/values.yaml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ app:
3535
limits:
3636
memory: 1Gi
3737
cpu: 500m
38+
service:
39+
annotations: {}
40+
type: ClusterIP
41+
port: 8000
3842
django:
3943
secret:
4044
name: null
@@ -72,7 +76,7 @@ app:
7276
# JWT auth
7377
jwt:
7478
secret:
75-
update: true
79+
update: false
7680
name: "jwt"
7781
# JWT keys, used by the mobile app. This default NEEDS to be changed.
7882
# Generate fresh keys with: docker compose exec web ./manage.py generate-jwt-keys
@@ -114,6 +118,10 @@ app:
114118
nginx:
115119
image: nginx:stable
116120
imagePullPolicy: IfNotPresent
121+
service:
122+
annotations: {}
123+
type: ClusterIP
124+
port: 80
117125
resources: null
118126
# requests:
119127
# memory: 512Mi
@@ -135,6 +143,14 @@ powersync:
135143
replicasWorker: 1
136144
securityContext:
137145
fsGroup: 1000
146+
serviceApi:
147+
annotations: {}
148+
type: ClusterIP
149+
port: 8080
150+
servicePrometheus:
151+
annotations: {}
152+
type: ClusterIP
153+
port: 9090
138154
configPath: null
139155
jwksURL: null
140156
resources: null
@@ -190,11 +206,6 @@ ingress:
190206
tls: true
191207
annotations: {}
192208

193-
service:
194-
annotations: {}
195-
type: ClusterIP
196-
port: 8000
197-
198209
# PostgreSQL Settings for groundhog2k chart. Only a minimum has been specified below.
199210
# For more options, see https://github.com/groundhog2k/helm-charts/tree/master/charts/postgres
200211
postgres:
@@ -219,15 +230,23 @@ postgres:
219230
# some database migration in django requires this
220231
# otherwise it was not able to create the database
221232
extraScripts: wger-pg-init
233+
args: [
234+
"-c", "wal_level=logical",
235+
"-c", "shared_buffers=256MB",
236+
"-c", "effective_cache_size=768MB",
237+
"-c", "work_mem=8MB",
238+
"-c", "random_page_cost=1.1",
239+
"-c", "max_connections=30"
240+
]
222241
service:
223242
port: 5432
224243
resources:
225244
limits:
226245
cpu: 500m
227-
memory: 512Mi
246+
memory: 1280Mi
228247
requests:
229248
cpu: 100m
230-
memory: 128Mi
249+
memory: 1032Mi
231250
## Storage parameters
232251
storage:
233252
## Set persistentVolumenClaimName to reference an existing PVC

0 commit comments

Comments
 (0)