1
0
Fork 0
home-stack-kustomize/kustomize/bases/nextcloud/nextcloud-deployment.yaml

116 lines
2.9 KiB
YAML
Raw Normal View History

2020-05-02 01:55:34 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
2020-05-18 20:18:39 +00:00
name: nextcloud
2020-05-02 01:55:34 +00:00
labels:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: nextcloud
2020-05-02 01:55:34 +00:00
spec:
2021-08-27 04:57:25 +00:00
replicas: 1
strategy:
type: Recreate
2020-05-02 01:55:34 +00:00
selector:
matchLabels:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: nextcloud
2020-05-02 01:55:34 +00:00
template:
metadata:
labels:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: nextcloud
2020-05-02 01:55:34 +00:00
spec:
2021-08-28 03:54:21 +00:00
affinity:
nodeAffinity:
# prefer to not be on a server node (resource contention)
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: NotIn
values:
- k3s-s0
2020-05-02 01:55:34 +00:00
containers:
- name: nextcloud
2021-08-27 04:57:25 +00:00
image: nextcloud
2020-05-02 01:55:34 +00:00
env:
2021-08-27 04:57:25 +00:00
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
2020-05-02 01:55:34 +00:00
- name: TRUSTED_PROXIES
value: 10.0.0.0/8
2021-08-28 03:54:21 +00:00
- name: REDIS_HOST
value: redis.$(NAMESPACE).svc.cluster.local
- name: REDIS_HOST_PASSWORD
valueFrom:
secretKeyRef:
name: redis-credentials
key: password
2021-08-26 16:42:10 +00:00
- name: POSTGRES_HOST
2021-08-27 04:57:25 +00:00
value: postgres.$(NAMESPACE).svc.cluster.local
- name: POSTGRES_DB
2020-05-02 01:55:34 +00:00
valueFrom:
secretKeyRef:
2021-08-28 03:54:21 +00:00
name: postgres-credentials
2020-05-02 01:55:34 +00:00
key: database
2021-08-26 16:42:10 +00:00
- name: POSTGRES_USER
2020-05-02 01:55:34 +00:00
valueFrom:
secretKeyRef:
2021-08-28 03:54:21 +00:00
name: postgres-credentials
2020-05-02 01:55:34 +00:00
key: username
2021-08-26 16:42:10 +00:00
- name: POSTGRES_PASSWORD
2020-05-02 01:55:34 +00:00
valueFrom:
secretKeyRef:
2021-08-28 03:54:21 +00:00
name: postgres-credentials
2020-05-02 01:55:34 +00:00
key: password
ports:
- name: http
containerPort: 80
2021-08-27 04:57:25 +00:00
resources:
requests:
cpu: 2000m
2021-09-06 16:40:08 +00:00
memory: 1Gi
2021-08-27 04:57:25 +00:00
limits:
cpu: 4000m
2021-09-06 16:40:08 +00:00
memory: 1.5Gi
2020-05-02 01:55:34 +00:00
volumeMounts:
2021-08-27 04:57:25 +00:00
- name: nextcloud-pv
2020-05-02 01:55:34 +00:00
mountPath: /var/www/html
2021-08-28 03:54:21 +00:00
# - name: nextcloud-cron
2021-08-29 05:15:00 +00:00
# image: badjware/nextcloud-tweak
# command: ['cron', '-f']
2021-08-28 03:54:21 +00:00
# volumeMounts:
# - name: nextcloud-pv
# mountPath: /var/www/html
# resources:
# limits:
# cpu: 250m
# memory: 250Mi
2020-05-02 01:55:34 +00:00
volumes:
2021-08-27 04:57:25 +00:00
- name: nextcloud-pv
2020-05-02 01:55:34 +00:00
persistentVolumeClaim:
2021-08-27 04:57:25 +00:00
claimName: nextcloud-pvc
2020-05-02 01:55:34 +00:00
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
2021-08-27 04:57:25 +00:00
name: nextcloud-pvc
2020-05-02 01:55:34 +00:00
spec:
accessModes:
2021-08-27 04:57:25 +00:00
- ReadWriteOnce
2020-05-02 01:55:34 +00:00
resources:
requests:
2021-08-27 04:57:25 +00:00
storage: 20Gi
2020-05-02 01:55:34 +00:00
---
apiVersion: v1
kind: Service
metadata:
name: nextcloud
labels:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: nextcloud
2020-05-02 01:55:34 +00:00
spec:
selector:
2021-08-26 16:42:32 +00:00
app.kubernetes.io/name: nextcloud
2020-05-02 01:55:34 +00:00
ports:
- name: http
port: 80
2021-08-28 03:54:21 +00:00
targetPort: http