Skip to content

Commit 15dd27b

Browse files
committed
examples
1 parent b3552bf commit 15dd27b

File tree

3 files changed

+58
-3
lines changed

3 files changed

+58
-3
lines changed

examples/fpm-nginx-dhi-k8s/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Change `ConfigMap` and `Secret` (Passwords) in `wsc-db.yaml` and `wsc-db.yaml`.
1010
* Set Domain/Host(s) in `Ingress` in `wsc-db.yaml` and set ssl-cert.
1111
* Set `storageClassName` in `volumes.yaml`.
12+
* check rest of yaml`s/configs ...
1213
4. ```kubectl apply -f volumes.yaml```
1314
5. ```kubectl apply -f wsc-db.yaml```
1415
* create database and user and set permission:
@@ -29,8 +30,19 @@
2930
```
3031
* Now you can edit `wsc-db.yaml` and use `MYSQL_EXPORTER_USER` and `MYSQLD_EXPORTER_PASSWORD` for exporter and optional use other user instead root for healtcheck. Then redeploy.
3132
6. ```kubectl apply -f wsc-web.yaml```
32-
7. copy wsc files to html folder in wsc-web deployment: ```kubectl cp ....```
33-
8. ...
33+
7. check:
34+
```sh
35+
kubectl -n wsc get secrets,configmaps,ingresses,services,pods,deployments,pvc,pv
36+
```
37+
8. [Download WSC](https://www.woltlab.com/en/woltlab-suite-download/) and unzip archive and copy wsc files form upload-folder to html-folder in wsc-web deployment:
38+
```sh
39+
kubectl -n wsc cp ./upload/. $(kubectl -n wsc get pod -l app.kubernetes.io/name=wsc-web -o jsonpath="{.items[0].metadata.name}"):/var/www/html/ -c helper
40+
```
41+
9. Call your domain and file test.php, example: `http://example.com/test.php`
42+
10. Now follows the installation setup of the WSC.
43+
Manual/Help: https://manual.woltlab.com/en/installation/
44+
(Notice: Database Host is `wsc-db`!)
45+
11. Installation complete.
3446

3547
## Registry Login
3648

examples/fpm-nginx-dhi-k8s/wsc-db.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ spec:
9797
- containerPort: 3306
9898
name: mysql
9999
protocol: TCP
100+
- containerPort: 33306
101+
name: mysqlx
102+
protocol: TCP
100103
readinessProbe:
101104
exec:
102105
command: ["/bin/sh", "-c", "mysqladmin ping -h localhost -P 3306 -u root || exit 1"]
@@ -187,6 +190,10 @@ spec:
187190
protocol: TCP
188191
port: 3306
189192
targetPort: 3306
193+
- name: "mysqlx"
194+
protocol: TCP
195+
port: 33306
196+
targetPort: 33306
190197
- name: "exporter"
191198
protocol: TCP
192199
port: 9104

examples/fpm-nginx-dhi-k8s/wsc-web.yaml

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ spec:
9393
volumeMounts:
9494
- name: wsc-web-data
9595
mountPath: /var/www/html
96+
#readOnly: true
9697
- name: nginx-config
9798
subPath: default.conf
9899
mountPath: /etc/nginx/conf.d/default.conf
@@ -193,6 +194,24 @@ spec:
193194
limits:
194195
memory: "128Mi"
195196
cpu: "0.5"
197+
# helper (for "kubectl cp", tar-backups from "html"-folder, ... when using ReadWriteOnce-PVC)
198+
- name: helper
199+
image: dhi.io/alpine-base:3.23 # or: docker.io/tobi312/php:dhi-helper-alpine
200+
imagePullPolicy: Always
201+
args: [ "tail", "-f", "/dev/null" ]
202+
resources:
203+
requests:
204+
memory: "64Mi"
205+
cpu: "0.1"
206+
limits:
207+
memory: "128Mi"
208+
cpu: "0.5"
209+
volumeMounts:
210+
- name: wsc-web-data
211+
mountPath: /var/www/html
212+
#readOnly: true
213+
- name: wsc-web-helper
214+
mountPath: /data
196215
volumes:
197216
- name: wsc-web-data
198217
persistentVolumeClaim:
@@ -203,6 +222,9 @@ spec:
203222
- name: php-fpm-config
204223
configMap:
205224
name: wsc-web-file-config-php-fpm
225+
# helper
226+
- name: wsc-web-helper
227+
emptyDir: {}
206228

207229
---
208230

@@ -424,7 +446,7 @@ metadata:
424446
nginx.ingress.kubernetes.io/proxy-body-size: "0"
425447
nginx.ingress.kubernetes.io/backend-protocol: "HTTP"
426448
## Traefik
427-
#traefik.ingress.kubernetes.io/router.middlewares: 'default-https-redirectscheme@kubernetescrd'
449+
#traefik.ingress.kubernetes.io/router.middlewares: 'wsc-https-redirectscheme@kubernetescrd'
428450
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
429451
traefik.ingress.kubernetes.io/service.serversscheme: http
430452
spec:
@@ -461,6 +483,20 @@ spec:
461483
# tls.crt: <ssl.crt>
462484
# tls.key: <ssl.key
463485

486+
#---
487+
## redirect http to https
488+
#
489+
#apiVersion: traefik.io/v1alpha1
490+
#kind: Middleware
491+
#metadata:
492+
# name: https-redirectscheme
493+
# namespace: wsc
494+
#spec:
495+
# redirectScheme:
496+
# scheme: https
497+
# #port: "443"
498+
# #permanent: true
499+
464500
#---
465501
#
466502
### After this line ONLY for Monitoring !

0 commit comments

Comments
 (0)