ADD: added nextcloud
This commit is contained in:
37
k3s/apps/Nextcloud/manifest/mariadb-deployment.yaml
Normal file
37
k3s/apps/Nextcloud/manifest/mariadb-deployment.yaml
Normal file
@@ -0,0 +1,37 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: mariadb
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: mariadb
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: mariadb
|
||||
spec:
|
||||
containers:
|
||||
- name: mariadb
|
||||
image: mariadb:10.8
|
||||
imagePullPolicy: IfNotPresent
|
||||
env:
|
||||
- name: MYSQL_ROOT_PASSWORD
|
||||
value: "123456"
|
||||
- name: MYSQL_DATABASE
|
||||
value: nextcloud
|
||||
- name: MYSQL_USER
|
||||
value: nextcloud
|
||||
- name: MYSQL_PASSWORD
|
||||
value: nextcloud
|
||||
ports:
|
||||
- containerPort: 3306
|
||||
volumeMounts:
|
||||
- name: mariadb-data
|
||||
mountPath: /var/lib/mysql
|
||||
volumes:
|
||||
- name: mariadb-data
|
||||
persistentVolumeClaim:
|
||||
claimName: pvc-mariadb
|
||||
32
k3s/apps/Nextcloud/manifest/mariadb-pv-pvc.yaml
Normal file
32
k3s/apps/Nextcloud/manifest/mariadb-pv-pvc.yaml
Normal file
@@ -0,0 +1,32 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: pvc-mariadb
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 10Gi
|
||||
storageClassName: local-path # <-- explicit default StorageClass
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pv-mariadb
|
||||
labels:
|
||||
app: mariadb
|
||||
spec:
|
||||
capacity:
|
||||
storage: 10Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: local-path
|
||||
claimRef:
|
||||
namespace: nextcloud
|
||||
name: pvc-mariadb
|
||||
hostPath:
|
||||
path: /var/lib/mariadb-data
|
||||
type: DirectoryOrCreate
|
||||
11
k3s/apps/Nextcloud/manifest/mariadb-service.yaml
Normal file
11
k3s/apps/Nextcloud/manifest/mariadb-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: mariadb
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
selector:
|
||||
app: mariadb
|
||||
ports:
|
||||
- port: 3306
|
||||
targetPort: 3306
|
||||
55
k3s/apps/Nextcloud/manifest/nextcloud-deployment.yaml
Normal file
55
k3s/apps/Nextcloud/manifest/nextcloud-deployment.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nextcloud
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nextcloud
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nextcloud
|
||||
spec:
|
||||
# fsGroup sorgt dafür, dass gemountete Volumes die Gruppe www-data (33) bekommen
|
||||
securityContext:
|
||||
fsGroup: 33
|
||||
containers:
|
||||
- name: nextcloud
|
||||
image: nextcloud:33-apache
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- containerPort: 80
|
||||
env:
|
||||
# - name: NEXTCLOUD_ADMIN_USER
|
||||
# value: admin
|
||||
# - name: NEXTCLOUD_ADMIN_PASSWORD
|
||||
# value: admin
|
||||
- name: MYSQL_HOST
|
||||
value: mariadb.nextcloud.svc.cluster.local
|
||||
- name: MYSQL_DATABASE
|
||||
value: nextcloud
|
||||
- name: MYSQL_USER
|
||||
value: nextcloud
|
||||
- name: MYSQL_PASSWORD
|
||||
value: "nextcloud"
|
||||
- name: REDIS_HOST
|
||||
value: redis.nextcloud.svc.cluster.local
|
||||
- name: NEXTCLOUD_TRUSTED_DOMAINS
|
||||
value: "henryathome.home64.de,192.168.178.0/24,192.168.178.138"
|
||||
# resources:
|
||||
# requests:
|
||||
# memory: "512Mi"
|
||||
# cpu: "250m"
|
||||
# limits:
|
||||
# memory: "1Gi"
|
||||
# cpu: "1000m"
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /var/www/html/data # angepasst auf Standard Nextcloud Datadir
|
||||
volumes:
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: nextcloud-data-pvc
|
||||
33
k3s/apps/Nextcloud/manifest/nextcloud-pv-pvc.yaml
Normal file
33
k3s/apps/Nextcloud/manifest/nextcloud-pv-pvc.yaml
Normal file
@@ -0,0 +1,33 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pv-nextcloud-data-nfs
|
||||
spec:
|
||||
capacity:
|
||||
storage: 500Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: nfs
|
||||
mountOptions:
|
||||
- vers=4
|
||||
- rsize=65536
|
||||
- wsize=65536
|
||||
- noatime
|
||||
nfs:
|
||||
server: 192.168.178.186 # <-- ERSETZEN: IP oder Hostname deiner NAS
|
||||
path: /volume1/Nextcloud/data # <-- ERSETZEN: Pfad zum Share auf der NAS (z.B. /volume1/nextcloud)
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: nextcloud-data-pvc
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
storageClassName: nfs
|
||||
resources:
|
||||
requests:
|
||||
storage: 500Gi
|
||||
volumeName: pv-nextcloud-data-nfs
|
||||
13
k3s/apps/Nextcloud/manifest/nextcloud-service.yaml
Normal file
13
k3s/apps/Nextcloud/manifest/nextcloud-service.yaml
Normal file
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nextcloud
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
app: nextcloud
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: 80
|
||||
nodePort: 30180
|
||||
26
k3s/apps/Nextcloud/manifest/redis-deployment.yaml
Normal file
26
k3s/apps/Nextcloud/manifest/redis-deployment.yaml
Normal file
@@ -0,0 +1,26 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: redis
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: redis
|
||||
spec:
|
||||
containers:
|
||||
- name: redis
|
||||
image: redis:7.0
|
||||
ports:
|
||||
- containerPort: 6379
|
||||
volumeMounts:
|
||||
- name: redis-data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: redis-data
|
||||
emptyDir: {}
|
||||
11
k3s/apps/Nextcloud/manifest/redis-service.yaml
Normal file
11
k3s/apps/Nextcloud/manifest/redis-service.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: nextcloud
|
||||
spec:
|
||||
selector:
|
||||
app: redis
|
||||
ports:
|
||||
- port: 6379
|
||||
targetPort: 6379
|
||||
Reference in New Issue
Block a user