updated nginx, added git-sync, decoupled filebrowser
This commit is contained in:
+65
-8
@@ -55,7 +55,7 @@ data:
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
root /usr/share/nginx/html/current/website;
|
||||
index index.html;
|
||||
|
||||
# Enable clean URLs - serve .html files without extension
|
||||
@@ -104,7 +104,7 @@ spec:
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
volumeMounts:
|
||||
- name: website-content
|
||||
- name: filebrowser-files
|
||||
mountPath: /srv
|
||||
- name: database
|
||||
mountPath: /database
|
||||
@@ -131,9 +131,9 @@ spec:
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
volumes:
|
||||
- name: website-content
|
||||
- name: files
|
||||
persistentVolumeClaim:
|
||||
claimName: felhom-website-content
|
||||
claimName: filebrowser-files
|
||||
- name: database
|
||||
persistentVolumeClaim:
|
||||
claimName: filebrowser-db
|
||||
@@ -179,6 +179,15 @@ spec:
|
||||
port:
|
||||
number: 80
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: git-sync-sparse-checkout
|
||||
namespace: felhom-system
|
||||
data:
|
||||
sparse-checkout: |
|
||||
/website/
|
||||
---
|
||||
# ===================
|
||||
# WEBPAGE (nginx)
|
||||
# ===================
|
||||
@@ -205,8 +214,9 @@ spec:
|
||||
ports:
|
||||
- containerPort: 80
|
||||
volumeMounts:
|
||||
- name: website-content
|
||||
- name: git-data
|
||||
mountPath: /usr/share/nginx/html
|
||||
readOnly: true
|
||||
- name: nginx-config
|
||||
mountPath: /etc/nginx/conf.d/default.conf
|
||||
subPath: default.conf
|
||||
@@ -229,13 +239,60 @@ spec:
|
||||
port: 80
|
||||
initialDelaySeconds: 3
|
||||
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:
|
||||
- name: website-content
|
||||
persistentVolumeClaim:
|
||||
claimName: felhom-website-content
|
||||
- name: git-data
|
||||
emptyDir: {}
|
||||
- name: nginx-config
|
||||
configMap:
|
||||
name: nginx-config
|
||||
- name: sparse-checkout
|
||||
configMap:
|
||||
name: git-sync-sparse-checkout
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
Reference in New Issue
Block a user