Skip to content
Snippets Groups Projects
Commit 68ce34d8 authored by Hugo Renard's avatar Hugo Renard Committed by Pierre Ozoux
Browse files

Makes Nextcloud mono pod.

parent 5d78e77a
No related branches found
No related tags found
1 merge request!2Nextcloud mono pod
...@@ -9,29 +9,6 @@ metadata: ...@@ -9,29 +9,6 @@ metadata:
app.kubernetes.io/part-of: Nextcloud app.kubernetes.io/part-of: Nextcloud
name: ${FQDN}-app name: ${FQDN}-app
namespace: ${NS} namespace: ${NS}
spec:
ports:
- name: api
port: 9000
protocol: TCP
targetPort: api
selector:
app.kubernetes.io/component: app
app.kubernetes.io/instance: ${FQDN}
app.kubernetes.io/name: nextcloud
app.kubernetes.io/part-of: Nextcloud
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/component: web
app.kubernetes.io/instance: ${FQDN}
app.kubernetes.io/name: nextcloud
app.kubernetes.io/part-of: Nextcloud
name: ${FQDN}-web
namespace: ${NS}
spec: spec:
ports: ports:
- name: http - name: http
...@@ -39,11 +16,10 @@ spec: ...@@ -39,11 +16,10 @@ spec:
protocol: TCP protocol: TCP
targetPort: http targetPort: http
selector: selector:
app.kubernetes.io/component: web app.kubernetes.io/component: app
app.kubernetes.io/instance: ${FQDN} app.kubernetes.io/instance: ${FQDN}
app.kubernetes.io/name: nextcloud app.kubernetes.io/name: nextcloud
app.kubernetes.io/part-of: Nextcloud app.kubernetes.io/part-of: Nextcloud
sessionAffinity: None
type: ClusterIP type: ClusterIP
--- ---
apiVersion: extensions/v1beta1 apiVersion: extensions/v1beta1
...@@ -66,7 +42,7 @@ spec: ...@@ -66,7 +42,7 @@ spec:
http: http:
paths: paths:
- backend: - backend:
serviceName: ${FQDN}-web serviceName: ${FQDN}-app
servicePort: http servicePort: http
path: / path: /
tls: tls:
...@@ -117,20 +93,36 @@ spec: ...@@ -117,20 +93,36 @@ spec:
operator: In operator: In
values: values:
- "true" - "true"
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app.kubernetes.io/instance
operator: In
values:
- ${FQDN}
- key: app.kubernetes.io/component
operator: In
values:
- app
containers: containers:
- image: libresh/nextcloud:${NC_WEB_IMAGE_TAG}
imagePullPolicy: Always
name: web
ports:
- containerPort: 80
name: http
protocol: TCP
env:
- name: BACKEND_HOST
value: localhost
livenessProbe:
httpGet:
path: /heartbeat
port: 80
httpHeaders:
- name: Host
value: localhost
readinessProbe:
httpGet:
path: /heartbeat
port: 80
httpHeaders:
- name: Host
value: localhost
resources:
requests:
memory: "80Mi"
limits:
memory: "400Mi"
- command: ["/bin/sh"] - command: ["/bin/sh"]
args: args:
- -c - -c
...@@ -179,18 +171,20 @@ spec: ...@@ -179,18 +171,20 @@ spec:
image: libresh/nextcloud:${NC_IMAGE_TAG} image: libresh/nextcloud:${NC_IMAGE_TAG}
imagePullPolicy: Always imagePullPolicy: Always
name: app name: app
securityContext:
runAsUser: 82
runAsGroup: 82
livenessProbe: livenessProbe:
exec: httpGet:
command: path: /heartbeat
- /php-fpm-healthcheck port: 80
initialDelaySeconds: 10 httpHeaders:
periodSeconds: 60 - name: Host
value: localhost
readinessProbe: readinessProbe:
exec: exec:
command: command:
- /php-fpm-healthcheck - /php-fpm-healthcheck
initialDelaySeconds: 10
periodSeconds: 60
ports: ports:
- containerPort: 9000 - containerPort: 9000
name: api name: api
...@@ -205,92 +199,6 @@ spec: ...@@ -205,92 +199,6 @@ spec:
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
restartPolicy: Always restartPolicy: Always
schedulerName: default-scheduler schedulerName: default-scheduler
securityContext:
fsGroup: 82
runAsGroup: 82
runAsUser: 82
terminationGracePeriodSeconds: 30
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/component: web
app.kubernetes.io/instance: ${FQDN}
app.kubernetes.io/name: nextcloud
app.kubernetes.io/part-of: Nextcloud
name: ${FQDN}-web
namespace: ${NS}
spec:
progressDeadlineSeconds: 600
replicas: 2
revisionHistoryLimit: 10
selector:
matchLabels:
app.kubernetes.io/component: web
app.kubernetes.io/instance: ${FQDN}
app.kubernetes.io/name: nextcloud
app.kubernetes.io/part-of: Nextcloud
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/component: web
app.kubernetes.io/instance: ${FQDN}
app.kubernetes.io/name: nextcloud
app.kubernetes.io/part-of: Nextcloud
spec:
affinity:
podAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 10
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app.kubernetes.io/instance
operator: In
values:
- ${FQDN}
- key: app.kubernetes.io/component
operator: In
values:
- app
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app.kubernetes.io/instance
operator: In
values:
- ${FQDN}
- key: app.kubernetes.io/component
operator: In
values:
- web
containers:
- image: libresh/nextcloud:${NC_WEB_IMAGE_TAG}
imagePullPolicy: Always
name: web
ports:
- containerPort: 80
name: http
protocol: TCP
env:
- name: BACKEND_HOST
value: ${FQDN}-app
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30 terminationGracePeriodSeconds: 30
--- ---
apiVersion: batch/v1beta1 apiVersion: batch/v1beta1
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment