updated nginx, added git-sync, decoupled filebrowser
This commit is contained in:
+65
-8
@@ -55,7 +55,7 @@ data:
|
|||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name _;
|
server_name _;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html/current/website;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Enable clean URLs - serve .html files without extension
|
# Enable clean URLs - serve .html files without extension
|
||||||
@@ -104,7 +104,7 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: website-content
|
- name: filebrowser-files
|
||||||
mountPath: /srv
|
mountPath: /srv
|
||||||
- name: database
|
- name: database
|
||||||
mountPath: /database
|
mountPath: /database
|
||||||
@@ -131,9 +131,9 @@ spec:
|
|||||||
initialDelaySeconds: 5
|
initialDelaySeconds: 5
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
volumes:
|
volumes:
|
||||||
- name: website-content
|
- name: files
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: felhom-website-content
|
claimName: filebrowser-files
|
||||||
- name: database
|
- name: database
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: filebrowser-db
|
claimName: filebrowser-db
|
||||||
@@ -179,6 +179,15 @@ spec:
|
|||||||
port:
|
port:
|
||||||
number: 80
|
number: 80
|
||||||
---
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: git-sync-sparse-checkout
|
||||||
|
namespace: felhom-system
|
||||||
|
data:
|
||||||
|
sparse-checkout: |
|
||||||
|
/website/
|
||||||
|
---
|
||||||
# ===================
|
# ===================
|
||||||
# WEBPAGE (nginx)
|
# WEBPAGE (nginx)
|
||||||
# ===================
|
# ===================
|
||||||
@@ -205,8 +214,9 @@ spec:
|
|||||||
ports:
|
ports:
|
||||||
- containerPort: 80
|
- containerPort: 80
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: website-content
|
- name: git-data
|
||||||
mountPath: /usr/share/nginx/html
|
mountPath: /usr/share/nginx/html
|
||||||
|
readOnly: true
|
||||||
- name: nginx-config
|
- name: nginx-config
|
||||||
mountPath: /etc/nginx/conf.d/default.conf
|
mountPath: /etc/nginx/conf.d/default.conf
|
||||||
subPath: default.conf
|
subPath: default.conf
|
||||||
@@ -229,13 +239,60 @@ spec:
|
|||||||
port: 80
|
port: 80
|
||||||
initialDelaySeconds: 3
|
initialDelaySeconds: 3
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
|
|
||||||
|
- name: git-sync
|
||||||
|
image: registry.k8s.io/git-sync/git-sync:v4.4.0
|
||||||
|
args:
|
||||||
|
- --repo=https://gitea.dooplex.hu/admin/felhom.eu.git
|
||||||
|
- --branch=main
|
||||||
|
- --root=/git
|
||||||
|
- --link=current
|
||||||
|
- --period=30s
|
||||||
|
# Only sync the website subdirectory
|
||||||
|
- --sparse-checkout-file=/etc/git-sync/sparse-checkout
|
||||||
|
volumeMounts:
|
||||||
|
- name: git-data
|
||||||
|
mountPath: /git
|
||||||
|
- name: sparse-checkout
|
||||||
|
mountPath: /etc/git-sync
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "32Mi"
|
||||||
|
cpu: "10m"
|
||||||
|
limits:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 65534 # nobody
|
||||||
|
|
||||||
|
# Init container: wait for first sync before nginx starts
|
||||||
|
initContainers:
|
||||||
|
- name: git-sync-init
|
||||||
|
image: registry.k8s.io/git-sync/git-sync:v4.4.0
|
||||||
|
args:
|
||||||
|
- --repo=https://gitea.dooplex.hu/admin/felhom.eu.git
|
||||||
|
- --branch=main
|
||||||
|
- --root=/git
|
||||||
|
- --link=current
|
||||||
|
- --one-time
|
||||||
|
- --sparse-checkout-file=/etc/git-sync/sparse-checkout
|
||||||
|
volumeMounts:
|
||||||
|
- name: git-data
|
||||||
|
mountPath: /git
|
||||||
|
- name: sparse-checkout
|
||||||
|
mountPath: /etc/git-sync
|
||||||
|
securityContext:
|
||||||
|
runAsUser: 65534
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
- name: website-content
|
- name: git-data
|
||||||
persistentVolumeClaim:
|
emptyDir: {}
|
||||||
claimName: felhom-website-content
|
|
||||||
- name: nginx-config
|
- name: nginx-config
|
||||||
configMap:
|
configMap:
|
||||||
name: nginx-config
|
name: nginx-config
|
||||||
|
- name: sparse-checkout
|
||||||
|
configMap:
|
||||||
|
name: git-sync-sparse-checkout
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|||||||
Reference in New Issue
Block a user